Graphic LCD Driver

A LCD Controller typically consists of logic for transferring LCD image data from an external display buffer to an LCD module. The Graphic LCD driver is designed to provide basic interface for LCD Controller, like initialization and de-initialization, enabling and disabling. And some common interface used to work with thirdpart graphic library like SEGGER emWin and Microchip Graphic library. So for most use cases, the Graphic LCD driver should works with a graphic library.

Summary of the API's Functional Features

The API provides functions to:
  • Initializing and deinitializing the driver and associated hardware

  • Enabling and Disabling

  • Interface for thirdpart graphic library.

Summary of Configuration Options

Depend on device, LCD controller parameters can be configured in START.

Driver Implementation Description

The driver supply some API for working with thirdpart graphic library. And the range of layer parameter for the API depends on device. The driver supports to operate display layer by given layer index.

Example of Usage

The following shows a simple example of using the Graphic LCD. The Graphic driver must have been initialized fristly. This initialization configures the hardware LCD controller instance.

The example sets the base layer to visible on LCD Display. The framebuffer(fb) was allocated by application, normally in SDRAM memory area. And the size of the framebuffer is depend on LCD size and bpp size (Bits per pixel) which defined in LCD's configurations. For example if LCD size is 480 * 320, and bpp is 32bits. Then the framebuffer size is 480 * 320 * 4bytes.

          /**
           * Example of using Graphic LCD to set backgroup layer visible.
            
           * \param[in] fb Pointer to framebuffer
           */
          void LCD_0_example(void *fb)
          {
              /* Enable LCD Controller */
              lcd_enable();
              /* Set Layer 0(backgroup layer) framebuffer */
              lcd_show(0, fb);
              /* Set layer 0(backgroup layer) to visible */
              lcd_set_visible(0, 1);
          }
        

Dependencies

  • LCD Controller peripheral, clock and singals.