芯片解AT32F403A那丰富的存储资源,这次为它配上一个2.2'彩色TFT屏,该显示屏采用SPI接口,故将I2C接口和SPI接口联合起来驱动它。
图1 接口资源
芯片解相关引脚输出高低电平的引脚定义为:
- #define LCD_CS_High() GPIO_SetBits(GPIOB, GPIO_Pins_13)
- #define LCD_CS_Low() GPIO_ResetBits(GPIOB, GPIO_Pins_13) //CS
- #define LCD_REST_High() GPIO_SetBits(GPIOB, GPIO_Pins_11)
- #define LCD_REST_Low() GPIO_ResetBits(GPIOB, GPIO_Pins_11) //RES
- #define LCD_DC_High() GPIO_SetBits(GPIOB, GPIO_Pins_12)
- #define LCD_DC_Low() GPIO_ResetBits(GPIOB, GPIO_Pins_12) //DC
- #define LCD_SDI_High() GPIO_SetBits(GPIOB, GPIO_Pins_9)
- #define LCD_SDI_Low() GPIO_ResetBits(GPIOB, GPIO_Pins_9)//SDI
- #define LCD_SCK_High() GPIO_SetBits(GPIOB, GPIO_Pins_8)
- #define LCD_SCK_Low() GPIO_ResetBits(GPIOB, GPIO_Pins_8)//SCK
- #define LCD_LED_High() GPIO_SetBits(GPIOB, GPIO_Pins_14)
- #define LCD_LED_Low() GPIO_ResetBits(GPIOB, GPIO_Pins_14) //BLK