In case you use the HighTech toolchain. There are some examples using the SPI interface.
For example, the LCD and MicroSD card on the Application Kit board are accessed via the SPI interface.
See the comment:
For example, the LCD and MicroSD card on the Application Kit board are accessed via the SPI interface.
See the comment:
Code:
/*--------------- Graphic LCD interface hardware definitions -----------------*/
/*
LCD is connected to QSPI0 interface
Port Function Type Note
P20.3 SLSO09 O Touch Chip Select
P20.6 SLSO08 O CPLD Chip Select
P20.11 SCLK0 O Serial Clock
P20.12 MRST0A I Master Receive Slave Transmit
P20.14 MTSR0 O Master Transmit Slave Receive
P20.13 BGL O background light
remarks: accessing LCD controller through serial interface
command byte: bit7=R/W,bit6=RS,bits5:0=cmd reg
RS R/W function
0 0 set an index register
0 1 read a status
1 0 write a register or GRAM data
1 1 read a register or GRAM data
remarks: using a CPLD for serial (SPI) to parallel (LCD) conversion
bit9=R/W,bit8=E/S (endless | single transfer)
*/