Often the graphics controller is connected to MCU via the parallel interface. This kind of connection provides a very fast access to the frame buffer. Sometimes the rendering is done so quickly that the double buffering (virtual frame) is not required. But the parallel interface may not be acceptable for the low-cost systems on account of the following reasons:
- Large signals quantity. Usually graphics controllers support 8 or 16 bits data bus. Additionally 18-20 lines may be required for the address bus if the direct addressing mode is used.
- The limited number of MCUs has the external parallel bus peripheral available.
In opposite to parallel interface the serial interface is simple, it has just 4 wires. Almost any MCU has an SPI module. The cheap, low pin count MCUs can be used. The graphics application transfers a big amount of data. The SPI is significantly slower than parallel interface and the rendering process, flickering and others artifacts become visible on the screen. To decide this problem the double buffering has to be used.
- Virtual Buffer. In the system with virtual buffer the one buffer is hidden and the second buffer is displayed on LCD. The graphics library draws in the hidden buffer then copies updated area or the whole buffer into the second visible buffer. Usually, the copy process is much faster than the graphics rendering. In this case, the use of such hidden buffer hides the drawing flicker and artifacts.
- Buffers Switching. The system has buffers with the same images and switches them after update. At first the image is updated in the hidden buffer, then this buffer is switched to be visible and the graphics library makes the same change in the second buffer. So the graphics library must maintain two same screens all the time and copy the modified part or the whole content between buffers (from visible to hidden).
Colibri Graphics embedded GUI library supports all double buffering methods described above.
When the visible buffer is switched or updated at the arbitrary time then the situation, when one half of screen displays the first buffer and the second half shows the data from the second buffer, is possible.This effect is known as tearing. Usually the buffer switching should be synchronized with the vertical LCD beam in order to avoid tearing.
The Virtual Buffer method is simple but requires a very fast copy operation between buffers. In case of the low speed the Buffer Switching methods can be used.
Epson S1D13781 graphics controller has a unique set of features to support SPI operation:
- It has a large memory to allocate two buffers inside the controller. The buffers can have RGB 5:6:5 format for QVGA (320x240) resolution and 8 bit per pixel format for WQVGA (480x272) resolution.
- The S1D13781 has a built-in graphics accelerator. The memory copy operation for the double buffering can be performed by the graphics controller without involving of the MCU. This frees the MCU resources for other tasks. The cheap MCU with lower MIPS can be used. Also the accelerated copy operation is very fast. In this situation the Virtual Buffer double buffering method can be used even for the SPI connection.
Colibri Graphics library supports Epson S1D13781 controller. It has a unique features set for the low-cost systems using SPI:
- Colibri Graphics Embedded GUI library works with all double buffering methods described above.
- The library has an extensive 8bit per pixel support. The palettes can be optimized for several images; intermediate palettes with indexes of another top palette can be used; the images can be adjusted for the selected palette. This allows the application to use S1D13781 via SPI for WQVGA resolution LCDs.
- Colibri Graphics hardware has an SPI option for S1D13781 controller.
- The library code is written in ANSI C, has a very small footprint (less than 2Kbytes in RAM and 30Kbytes in ROM). The code porting to different compiler or MCU is easy.
- Free extensive customer support.
Colibri Software, 2010