Adding New Device Driver

Microchip Graphics Library

Microchip Graphics Library
Adding New Device Driver

Adding a new display device driver requires the following functions and macros to be implemented. Please refer to the API section of the Device Driver Layer for details.

Function/Macro 
Description 
Initializes the display device. 
GetMaxX() 
Returns the maximum x-coordinate for the display. 
GetMaxY() 
Returns the maximum y-coordinate for the display. 
Sets the current drawing color. 
Returns the current drawing color. 
Sets the current active graphic page (optional). 
Sets the current visual graphic page (optional). 
Modifies pixel on the screen. 
Returns the pixel color. 
Renders an image on the screen. This function is dependent on the color format used. 
Set the current clipping region borders. 
Returns the left, top, right and bottom clipping borders. 
SetClip() 
Enables or disables the clipping region. 
Checks if the display controller is busy executing the previous rendering operation. 
Sets the palette register of the device. 

 

Adding new Display Device Drivers 

The DisplayDriver.h file should be used as a guide to make your new driver compatible with the Microchip Graphics Library. All the API's defined in this header file are required functions to be implemented in the driver. There are portions of that file that states optional functions. These functions are not needed to interface to the Graphics Library. These are only implemented if the display controller used has hardware features that can implement these functions. 

The best way to implement this is to try to find the nearest existing driver and modify the C and H files. Most graphics controllers has a lot of control registers to be initialized. Values programmed into the registers depends on the specification of the LCD glass used. If LCD module has a built-in graphics controller, initialization code for the glass can be found in the LCD specifications or get this information from the manufacturer.

Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved