#ifndef __LCD_H_ #define __LCD_H_ #include "stm32f10x.h" #define LCD_WIDTH 128 #define LCD_HEIGHT 128 #define LCD_BUS_IO 0 #define LCD_BUS_SPI 1 #define LCD_BUS_TYPE LCD_BUS_SPI//LCD_BUS_IO //LCD_BUS_SPI #if(LCD_BUS_TYPE==LCD_BUS_IO) #define LCD_CS_PIN GPIO_Pin_12 #define LCD_CS_PORT GPIOB #define LCD_CS_HIGH LCD_CS_PORT->BSRR = LCD_CS_PIN #define LCD_CS_LOW LCD_CS_PORT->BRR = LCD_CS_PIN #define LCD_SCK_PIN GPIO_Pin_13 #define LCD_SCK_PORT GPIOB #define LCD_SCK_HIGH LCD_SCK_PORT->BSRR = LCD_SCK_PIN #define LCD_SCK_LOW LCD_SCK_PORT->BRR = LCD_SCK_PIN #define LCD_DCX_PIN GPIO_Pin_14 #define LCD_DCX_PORT GPIOB #define LCD_DCX_HIGH LCD_DCX_PORT->BSRR = LCD_DCX_PIN #define LCD_DCX_LOW LCD_DCX_PORT->BRR = LCD_DCX_PIN #define LCD_SDA_PIN GPIO_Pin_15 #define LCD_SDA_PORT GPIOB #define LCD_SDA_HIGH LCD_SDA_PORT->BSRR = LCD_SDA_PIN #define LCD_SDA_LOW LCD_SDA_PORT->BRR = LCD_SDA_PIN #elif(LCD_BUS_TYPE==LCD_BUS_SPI) #define LCD_SPI_NSS_PIN GPIO_Pin_12 #define LCD_SPI_SCK_PIN GPIO_Pin_13 #define LCD_DCX_PIN GPIO_Pin_14 #define LCD_SPI_MOSI_PIN GPIO_Pin_15 #define LCD_SPI_PORT GPIOB #define LCD_SPI_HANDLE SPI2 #define LCD_DCX_PORT GPIOB #define LCD_SPI_NSS_HIGH LCD_SPI_PORT->BSRR = LCD_SPI_NSS_PIN #define LCD_SPI_NSS_LOW LCD_SPI_PORT->BRR = LCD_SPI_NSS_PIN #define LCD_DCX_HIGH LCD_DCX_PORT->BSRR = LCD_DCX_PIN #define LCD_DCX_LOW LCD_DCX_PORT->BRR = LCD_DCX_PIN #endif #define LCD_RESET_PIN GPIO_Pin_11 #define LCD_RESET_PORT GPIOA #define LCD_RESET_HIGH LCD_RESET_PORT->BSRR = LCD_RESET_PIN #define LCD_RESET_LOW LCD_RESET_PORT->BRR = LCD_RESET_PIN #define LCD_BL_PIN GPIO_Pin_12 #define LCD_BL_PORT GPIOA #define LCD_BL_HIGH LCD_BL_PORT->BSRR = LCD_BL_PIN #define LCD_BL_LOW LCD_BL_PORT->BRR = LCD_BL_PIN extern unsigned char showApn; extern unsigned char LastKeyLight; extern unsigned char KeyLightFlag; void LcdInit(void); void LCDBackLight(char Ct); void LcdSendData(unsigned char Data); void LcdClrAll(void); void LcdBlockWrite(u16 x1,u16 y1,u16 x2,u16 y2); #endif