Creating a new low level driver from the template is simple and can be executed in a few simple steps.
First, the new driver has to be created with a unique name that describes the driver and has not already been used in the "eGUI/D4D". Example: For LCD controller layer and LCD driver SSD1926 from Solomon Systech company, the name must be "ssd1926".
Second, create a folder for a new driver in the correct place in the D4D directory structure: Directory paths for drivers:
In this step the directory must be filled with the template driver files. The templates are stored in the low-level driver directory and the folder name is called "template". After copying these files into the user new driver folder, all the files must be renamed to a valid name. This must be executed by replacing the template word in the name of the files by the user name selected in first place. Example: Copy the content of the template directory placed in "D4D\low_level_drivers\LCD\lcd_controllers_drivers\" into the new folder "ssd1926" and rename all the file names with the word "template" to "ssd1926".
Finally add these files into the CodeWarrior project. This can be executed by dragging and dropping the new created folder with the renamed template files into the corresponding group in the eGUI/D4D main group. Example: Drag and drop the new created folder "ssd1926" with the renamed files and place them into the CodeWarrior project with eGUI/D4D to the correct group: "D4D\low_level_drivers\LCD\lcd_controllers_drivers\".
The new driver files from the template contain all the necessary functions and mainly the API structure, but with a default name. All functions, macros, variables, and defines contain the word "template" in a different letter case. The step is renamed and all the contents to their correct names as the driver name selected in the first step.The fastest way to rename all the things needed in these new files are the following:
The last step is filling up the function bodies with correct code that manages the LCD display for a correct run. After the API is completed by the template the user must fill up only the power code and not the API. This speeds up the new driver development.
REFERENCE