Template Source Code

This document discusses the template code from which device drivers are created.

Template source code

To help enable a base port be produced quickly, Symbian platform provides template source code for drivers for most peripherals. The template implements a framework and protocols for the type of peripheral; the base port implementer then supplies additional implementation for the particular hardware device. For example, for the UART driver, the PDD template implements the standard hardware abstraction interfaces for serial communication, such as the DComm class. It leaves some sections marked as "TBD", which are specific to the device. Driver developers can start with these templates and fill in the "TBD" functions to create a basic driver. If required, additional functionality can then be added to this.

The template drivers are located in the sf\os\kernelhwsrv\bsptemplate\asspandvariant\template_variant source directory. The template directory provides a variant base port that includes all the drivers required to do the minimal base port for any variant.

Details of the templates for particular drivers are discussed in the relevant sections of the Base Porting Guide. This tutorial presents an additional example device driver.