SoCKit User Manual
86
www.terasic.com
December 1, 2015
called to draw graphic on the LCD.
APIs in lcd_graphic.c don’t drive LCD to draw graphic pixels directly. All graphic pixels are stored
in a temporary image buffer called "Canvas". When API "DRAW_Refresh" is called, all drawing
data in the Canvas is transferred to LCD. In this demonstration, main program calls "DRAW_Clear"
to clear LCD Canvas first. "DRAW_Rect" and "DRAW_Circle" are called to draw geometry in
Canvas. "DRAW_PrintString" is called to draw font in Canvas. Finally, "DRAW_Refresh" is called
to move Canvas data onto LCD.
Demonstration Source Code
Build tool: Altera SoC EDS v13.1
Project directory: \Demonstration\SoC\hps_lcd
Binary file: hps_lcd
Build command: make ("
make clean
" to remove all temporary files)
Execute command: ./hps_lcd
Demonstration Setup
Make sure BOOTSEL[2:0] = 101 (Boot from SD card)
Make sure CLKSEL[1:0] = 00
Make sure MSEL[4:0] = 00001
Connect the USB cable to the USB-to-UART connector (J4) on the SoCKit board and host PC.
Make sure the executable file "
hps_lcd
" is copied into the SD card under the /home/root folder
in Linux.
Insert the booting micro SD card into the SoCKit board.
Power on the SoCKit board.
Launch PuTTY to connect to the UART port of SoCKit board and type "
root
" to login Yocto
Linux.
In the UART terminal of PuTTY, type "
./hps_lcd
" to start the LCD demo, as shown in
Figure
6-13
.
Figure 6-13 Launch LCD Demonstration