[W7200 EVM] SD Card를 이용한 TFT LCD 테스트
W7200은 STM32-SM EVM보드와 호환이 가능하다. STM32코어 이므로 기존 코드를 활용하여 여러가지 테스틀 쉽게 해볼 수 있다.
SD Card를 이용하여 웹서버를 제작하기위해 먼저 SD카드 호환되는 TFT LCD보드를 테스트 해 보았다.
W7200 TFT-LCD 테스트 동영상
W7200 TFT-LCD 제어 드라이버 코드
//-----------------------------------------------------------------------------
//LED Driver
#define TFT_DRV_HD66791 0
#define TFT_DRV_COM44 0
#define TFT_DRV_ST7735 1
#define LCD_LAT_BIT BIT14
#define LCD_LAT_PORT PORTA
#define LCD_LAT_ON() //Sbi(LCD_LAT_PORT, LCD_LAT_BIT)
#define LCD_LAT_OFF() //Cbi(LCD_LAT_PORT, LCD_LAT_BIT)
#define LCD_DATA_LATCH() //LCD_LAT_ON();LCD_LAT_OFF();
#define LCD_EN_BIT BIT13
#define LCD_EN_PORT GPIOA
#define LCD_ENABLE() cbi(LCD_EN_PORT, LCD_EN_BIT)
#define LCD_DISABLE() sbi(LCD_EN_PORT, LCD_EN_BIT)
#define LCD_RST_BIT //BIT8
#define LCD_RST_PORT //PORTB
#define LCD_RST_ON() //Sbi(LCD_RST_PORT, LCD_RST_BIT)
#define LCD_RST_OFF() //Cbi(LCD_RST_PORT, LCD_RST_BIT)
#define LCD_RS_BIT BIT14
#define LCD_RS_PORT GPIOA
#define LCD_RS_OFF() cbi(LCD_RS_PORT, LCD_RS_BIT)
#define LCD_RS_ON() sbi(LCD_RS_PORT, LCD_RS_BIT)
#define LCD_WR_BIT BIT15
#define LCD_WR_PORT GPIOA
#define LCD_WR_OFF() cbi(LCD_WR_PORT, LCD_WR_BIT)
#define LCD_WR_ON() sbi(LCD_WR_PORT, LCD_WR_BIT)
#define LCD_RD_BIT ///BIT9
#define LCD_RD_PORT //PORTB
#define LCD_RD_OFF() //Cbi(LCD_RD_PORT, LCD_RD_BIT)
#define LCD_RD_ON() //Sbi(LCD_RD_PORT, LCD_RD_BIT)
#define LCD_BL_BIT BIT9
#define LCD_BL_PORT GPIOB
#define LCD_BL_OFF() cbi(LCD_BL_PORT, LCD_BL_BIT)
#define LCD_BL_ON() sbi(LCD_BL_PORT, LCD_BL_BIT)
#define _LCD_DAT_OUT(Data) PORTB = (PORTB&0xFF00) | (Data&0xFF);
#define TFTGpioInit() RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);\
GPIO_InitStructure.GPIO_Pin = BIT13|BIT14|BIT15;\
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;\
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;\
GPIO_Init(GPIOA, &GPIO_InitStructure);\
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);\
GPIO_InitStructure.GPIO_Pin = 0xFF|BIT9;\
GPIO_Init(GPIOB, &GPIO_InitStructure);