Writing to the GLCD
Although the LED flashing programs we've written so far have served to provide a tutorial introduction to C, you are probably ready for something a little more exciting. The Graphic LCD (GLCD) touchscreen provides an interactive interface based on a 320 x 240 pixel color display. Keil provides a library of functions to write characters and bit-mapped graphics to the screen.
Getting ready
Create a new folder and rename it
helloLCD_c2v0
. Invoke uVision5, and create a new project.After selecting the target device (STM32F407IGHx), use the RTE manager to select the MCBSTM32F400 target board, and check the following software components: Board Support → Graphic LCD, CMSIS → CORE, CMSIS → RTOS (API) → KeilRTX, Device → Startup, Device → STM32Cube Framework (API) → Classic. Finally, left-click on Resolve and OK.
How to do it…
Create a new C source file called
helloLCD.c
, and enter the following statements. Although hidden by a fold, don't forget to add the boilerplate code we described...