|
最近学习驱动,在LCD这一块卡了,好多没看懂。特来讨教。
#define MAIN_LCD_16BIT_MODE --这个几bit几bit的定义,根据什么来定?
#define MAIN_LCD_CMD_ADDR LCD_PARALLEL0_A0_LOW_ADDR --这个玩意儿怎么定??一定是这个值么?
#define MAIN_LCD_DATA_ADDR LCD_PARALLEL0_A0_HIGH_ADDR
#if (defined(MAIN_LCD_8BIT_MODE))
#define MAIN_LCD_OUTPUT_FORMAT LCM_8BIT_16_BPP_RGB565_1
#elif (defined(MAIN_LCD_9BIT_MODE))
#define MAIN_LCD_OUTPUT_FORMAT LCM_9BIT_18_BPP_RGB666_1
#elif (defined(MAIN_LCD_16BIT_MODE))
#define MAIN_LCD_OUTPUT_FORMAT LCM_16BIT_16_BPP_RGB565_1
#elif (defined(MAIN_LCD_18BIT_MODE))
#define MAIN_LCD_OUTPUT_FORMAT LCM_18BIT_18_BPP_RGB666_1 --这个format有怎么定?
#endif
这么着东西研究了半天,还是不懂!
#if (defined(MAIN_LCD_8BIT_MODE))
#define LCD_CtrlWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_CMD,((_data & 0xFF00)>>8));\ --为啥要偏移8位?
SET_LCD_CMD_PARAMETER(1,LCD_CMD,(_data & 0xFF));\ --为啥要写两次?
LCD_SEND_DMA_CMD(2); }
#define LCD_DataWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_DATA,((_data&0xFF00)>>8)); SET_LCD_CMD_PARAMETER(1,LCD_DATA,(_data&0xFF)); LCD_SEND_DMA_CMD(2); }
#elif (defined(MAIN_LCD_9BIT_MODE))
#define LCD_CtrlWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_CMD,(((_data & 0xFF00))<<2)); SET_LCD_CMD_PARAMETER(1,LCD_CMD,(((_data & 0x00FF))<<10)); LCD_SEND_DMA_CMD(2); }
#define LCD_DataWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_DATA,(((_data & 0xFF00))<<2)); SET_LCD_CMD_PARAMETER(1,LCD_DATA,(((_data & 0x00FF))<<10)); LCD_SEND_DMA_CMD(2); }
#elif (defined(MAIN_LCD_16BIT_MODE))
#define LCD_CtrlWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_CMD,(_data)); LCD_SEND_DMA_CMD(1); }
#define LCD_DataWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_DATA,(_data)); LCD_SEND_DMA_CMD(1); }
#elif (defined(MAIN_LCD_18BIT_MODE))
#define LCD_CtrlWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_CMD,(((_data & 0xFF00)<<2)|(_data&0xFF)<<1));\ --这里为啥只有一次??!!而上面则要两次??
LCD_SEND_DMA_CMD(1); }
#define LCD_DataWrite_ILI9327(_data) { SET_LCD_CMD_PARAMETER(0,LCD_DATA,(((_data & 0xFF00)<<2)|(_data&0xFF)<<1)); LCD_SEND_DMA_CMD(1); }
#endif |
|