PSoC 6 TFT Display Interface with EmWin Graphics Library
Document Number: 002-23726 Rev. *B
7
PSoC Creator generates the configuration files for EmWin under the
Shared Files
folder as shown in
Figure 11. Configuration Files Generated
5. Open the
LCDConf.c
file and configure the X and Y sizes of the display, the color palette, and display driver.
Figure 12. Setting the X and Y Values and Color Conversion
The ST7789S controller has a resolution of 240x320 pixels.
This controller supports various color palettes. This project uses the 16 bits per pixel RGB 5-6-5 color palette (5 bits R,
6 bits G, 6 bits G). Per the EmWin user guide Section 15.6
“Fixed Palette Modes”, this color palette is named
GUICC_M565.
The ST7789S controller is supported by the FlexColor driver; therefore, set the driver to
GUI_FLEXCOLOR
.
6. In the
LCDConf.c
file, write code in the
_InitController
function to initialize the hardware interface and display
controller. The EmWin library calls this function during the initialization stage. Some code snippets from this function
are shown below.