SoCKit User Manual
85
www.terasic.com
December 1, 2015
Display ON/OFF (Code: 0xAE~0xAF)
For details of command sets, please refer to the NT7534 datasheet in the System CD. After the LCD
is initialized, developer can start transferring display data. Due to the display area is divided into 8
page, developer must first specify target page and column address before starting to transfer display
data.
Figure 6-12
shows the relationship between image data bits and LCD display pixels when
page = 0, column = 0, and start line = 0.
Figure 6-12 Relation between LCD display pixel and image data bits
SPIM Controller
In this demonstration, the HPS SPIM1 controller is configured as TX-Only SPI with clock rate
3.125MHz. Please refer to the function "LCDHW_Init" in LCD_Hw.c for details. The header file
"socal/alt_spim.h", which needs to be included into the SPI controller program, defines all
necessary constants for the SPIM controller.
C-code Explanation
This demonstration includes the following major files:
LCD_HW.c: Low-level SPI and GPIO API to access LCD hardware
LCD_Driver.c: LCD configuration API
LCD_Lib.c: Top-level LCD control API
lcd_graphic.c: Graphic and font APIs for LCD
font.c: Font bitmap resource used by lcd_graphic.c
main.c: Main program for this demonstration
The main program main.c calls "LCDHW_Init" to initialize the SPIM1 and GPIO controllers,
which are used to control the LCD. It then calls "LCDHW_BackLight" to turn on the backlight of
LCD. "LCD_Init" is called to initialize LCD configuration. Finally, the APIs in lcd_graphic.c are