50D有没人用过9325C这颗屏?
#if defined(LCD_ILI9325C)
#define Dummy_Delay_ILI9325C()
void LCD_CtrlWrite_ILI9325C(kal_uint16 _data)
{
SET_LCD_CMD_PARAMETER(0,LCD_CMD,(_data >> 8));
LCD_SEND_DMA_CMD(1);
Dummy_Delay_ILI9325C();
SET_LCD_CMD_PARAMETER(0, LCD_CMD, (_data & 0x00FF));
LCD_SEND_DMA_CMD(1);
}
void LCD_DataWrite_ILI9325C(kal_uint16 _data)
{
SET_LCD_CMD_PARAMETER(0,LCD_DATA,(_data >> 8));
LCD_SEND_DMA_CMD(1);
Dummy_Delay_ILI9325C();
SET_LCD_CMD_PARAMETER(0, LCD_DATA, (_data & 0x00FF));
LCD_SEND_DMA_CMD(1);
}
//lcd
void LCD_Ctrl_DataWrite_ILI9325C(int adr,int val)
{
LCD_CtrlWrite_ILI9325C(adr);
LCD_DataWrite_ILI9325C(val);
}
void LCD_blockClear_ILI9325C(kal_uint16 x1,kal_uint16 y1,kal_uint16 x2,kal_uint16 y2,kal_uint16 _data)
{
int x,y;
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0050;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x1&0xFF00)>>8);
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x1&0xFF);
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0051;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x2&0xFF00)>>8);
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x2&0xFF);
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0052;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y1&0xFF00)>>8);
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y1&0xFF);
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0053;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y2&0xFF00)>>8);
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y2&0xFF);
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0020;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x1&0xFF00)>>8);
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x1&0xFF);
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0021;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y1&0xFF00)>>8);
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y1&0xFF);
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0022;
for(y=y1;y<=y2;y++)
{
for(x=x1;x<=x2;x++)
{
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = _data>>8;
*(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = _data&0xff;
}
}
}
void LCD_Init_TFT_9325C(kal_uint32 background, void **buf_addr)
{
SET_LCD_CTRL_RESET_PIN;
LCD_Delayms(1);
CLEAR_LCD_CTRL_RESET_PIN;
LCD_Delayms(10);
SET_LCD_CTRL_RESET_PIN;
LCD_Delayms(50);
//------------* Start Initial Sequence ------//
LCD_Ctrl_DataWrite_ILI9325C(0x00E3,0x3008); // Set internal timing
LCD_Ctrl_DataWrite_ILI9325C(0x00E7,0x0012); // Set internal timing
LCD_Ctrl_DataWrite_ILI9325C(0x00EF,0x1231); // Set internal timing
LCD_Ctrl_DataWrite_ILI9325C(0x00E5,0x78F0); // Set internal timing
LCD_Ctrl_DataWrite_ILI9325C(0x0000,0x0001); //start oscillation
LCD_Ctrl_DataWrite_ILI9325C(0x0001,0x0100); // set SS and SM bit
LCD_Ctrl_DataWrite_ILI9325C(0x0002,0x0700); // 0700=line inversion,0500=frame inversion
LCD_Ctrl_DataWrite_ILI9325C(0x0003,0x1030); // set GRAM write direction and BGR=0.
LCD_Ctrl_DataWrite_ILI9325C(0x0004,0x0000); // Resize register
LCD_Ctrl_DataWrite_ILI9325C(0x0008,0x0207); // set the back porch and front porch
LCD_Ctrl_DataWrite_ILI9325C(0x0009,0x0000); // set non-display area refresh cycle ISC[3:0]
LCD_Ctrl_DataWrite_ILI9325C(0x000A,0x0000); // FMARK function
LCD_Ctrl_DataWrite_ILI9325C(0x000C,0x0000); // RGB interface setting
LCD_Ctrl_DataWrite_ILI9325C(0x000D,0x0000); // Frame marker Position
LCD_Ctrl_DataWrite_ILI9325C(0x000F,0x0000); // RGB interface polarity
//------------*Power On sequence ------------//
LCD_Ctrl_DataWrite_ILI9325C(0x0010,0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB
LCD_Ctrl_DataWrite_ILI9325C(0x0011,0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
LCD_Ctrl_DataWrite_ILI9325C(0x0012,0x0000); // VREG1OUT voltage
LCD_Ctrl_DataWrite_ILI9325C(0x0013,0x0000); // VDV[4:0] for VCOM amplitude
LCD_Delayms(20);
LCD_Ctrl_DataWrite_ILI9325C(0x0010,0x1290); // DDVDH=VCI*2,VGH=VCI*6,VGL=VCI*-3
LCD_Ctrl_DataWrite_ILI9325C(0x0011,0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
LCD_Delayms(50);
LCD_Ctrl_DataWrite_ILI9325C(0x0012,0x0019); // VREG1OUT=2.8Vx1.85= 4.625V
LCD_Delayms(50);
LCD_Ctrl_DataWrite_ILI9325C(0x0013,0x1900); // VCOM AC=VREG1OUT(4.625)*1.1=5.0875
LCD_Ctrl_DataWrite_ILI9325C(0x0029,0x0027); // VCM[4:0] for VCOMH org 00x19_20090212
LCD_Delayms(50);
LCD_Ctrl_DataWrite_ILI9325C(0x0020,0x0000); // GRAM horizontal Address
LCD_Ctrl_DataWrite_ILI9325C(0x0021,0x0000); // GRAM Vertical Address
// ----------- Adjust the Gamma Curve -------//
LCD_Ctrl_DataWrite_ILI9325C(0x0030,0x0000);
LCD_Ctrl_DataWrite_ILI9325C(0x0031,0x0507);
LCD_Ctrl_DataWrite_ILI9325C(0x0032,0x0004);
LCD_Ctrl_DataWrite_ILI9325C(0x0035,0x0205);
LCD_Ctrl_DataWrite_ILI9325C(0x0036,0x0004);
LCD_Ctrl_DataWrite_ILI9325C(0x0037,0x0307);
LCD_Ctrl_DataWrite_ILI9325C(0x0038,0x0002);
LCD_Ctrl_DataWrite_ILI9325C(0x0039,0x0707);
LCD_Ctrl_DataWrite_ILI9325C(0x003C,0x0502);
LCD_Ctrl_DataWrite_ILI9325C(0x003D,0x0004);
//------------------ Set GRAM area ------------//
LCD_Ctrl_DataWrite_ILI9325C(0x0050,0x0000); // Horizontal GRAM Start Address
LCD_Ctrl_DataWrite_ILI9325C(0x0051,0x00EF); // Horizontal GRAM End Address
LCD_Ctrl_DataWrite_ILI9325C(0x0052,0x0000); // Vertical GRAM Start Address
LCD_Ctrl_DataWrite_ILI9325C(0x0053,0x013F); // Vertical GRAM Start Address
LCD_Ctrl_DataWrite_ILI9325C(0x0060,0xA700); // Gate Scan Line
LCD_Ctrl_DataWrite_ILI9325C(0x0061,0x0001); // NDL,VLE, REV
LCD_Ctrl_DataWrite_ILI9325C(0x006A,0x0000); // set scrolling line
//-------------- Panel Control ----------------//
LCD_Ctrl_DataWrite_ILI9325C(0x002B,0x000C); //000b=49.2HZ,000d=75HZ
LCD_Delayms(50);
LCD_Ctrl_DataWrite_ILI9325C(0x0090,0x0011); //0016=49.2hz,0018=75hz
LCD_Ctrl_DataWrite_ILI9325C(0x0092,0x0600);
LCD_Ctrl_DataWrite_ILI9325C(0x0093,0x0003);
LCD_Ctrl_DataWrite_ILI9325C(0x0095,0x0110);
LCD_Ctrl_DataWrite_ILI9325C(0x0097,0x0000);
LCD_Ctrl_DataWrite_ILI9325C(0x0098,0x0000);
LCD_Ctrl_DataWrite_ILI9325C(0x0007,0x0173); // 262K color and display ON
LCD_blockClear_ILI9325C(0, 0, LCD_WIDTH-1, LCD_HEIGHT-1, 0);
LCD_Delayms(120);
}
void LCD_PWRON_TFT_9325C(kal_bool on)
{
}
void LCD_SetContrast_TFT_9325C(kal_uint8 level)
{
}
void LCD_ON_TFT_9325C(kal_bool on)
{
}
void LCD_BlockWrite_TFT_9325C(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
{
kal_uint16 roi_width;
kal_uint16 x,y;
while (LCD_IS_RUNNING){};
//ASSERT(lcd_assert_fail==KAL_FALSE);
lcd_assert_fail = KAL_TRUE;
SET_LCD_CMD_PARAMETER(0,LCD_CMD,0x0050);
SET_LCD_CMD_PARAMETER(1,LCD_DATA,((startx&0xFF00)>>8));
SET_LCD_CMD_PARAMETER(2,LCD_DATA,(startx&0xFF));
SET_LCD_CMD_PARAMETER(3,LCD_CMD,0x0051);
SET_LCD_CMD_PARAMETER(4,LCD_DATA,((endx&0xFF00)>>8));
SET_LCD_CMD_PARAMETER(5,LCD_DATA,(endx&0xFF));
SET_LCD_CMD_PARAMETER(6,LCD_CMD,0x0052);
SET_LCD_CMD_PARAMETER(7,LCD_DATA,((starty&0xFF00)>>8));
SET_LCD_CMD_PARAMETER(8,LCD_DATA,(starty&0xFF));
SET_LCD_CMD_PARAMETER(9,LCD_CMD,0x0053);
SET_LCD_CMD_PARAMETER(10,LCD_DATA,((endy&0xFF00)>>8));
SET_LCD_CMD_PARAMETER(11,LCD_DATA,(endy&0xFF));
SET_LCD_CMD_PARAMETER(12,LCD_CMD,0x0020);
SET_LCD_CMD_PARAMETER(13,LCD_DATA,((startx&0xFF00)>>8));
SET_LCD_CMD_PARAMETER(14,LCD_DATA,(startx&0xFF));
SET_LCD_CMD_PARAMETER(15,LCD_CMD,0x0021);
SET_LCD_CMD_PARAMETER(16,LCD_DATA,((starty&0xFF00)>>8));
SET_LCD_CMD_PARAMETER(17,LCD_DATA,(starty&0xFF));
SET_LCD_CMD_PARAMETER(18,LCD_CMD,0x0022);
ENABLE_LCD_TRANSFER_COMPLETE_INT;
ENABLE_LCD_ROI_CTRL_CMD_FIRST;
SET_LCD_ROI_CTRL_NUMBER_OF_CMD(19);
START_LCD_TRANSFER;
lcd_assert_fail = KAL_FALSE;
}
void LCD_Size_TFT_9325C(kal_uint16 *out_LCD_width,kal_uint16 *out_LCD_height)
{
}
void LCD_EnterSleep_TFT_9325C(void)
{
LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0000); // display OFF
//************* Power OFF sequence **************//
LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0080); // SAP, BT[3:0], APE, AP, DSTB, SLP
LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0000); // DC1[2:0], DC0[2:0], VC[2:0]
LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x0000); // VREG1OUT voltage
LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
LCD_Delayms(200); // Dis-charge capacitor power voltage
LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0082); // SAP, BT[3:0], APE, AP, DSTB, SLP
}
void LCD_ExitSleep_TFT_9325C(void)
{
//*************Power On sequence ******************//
LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0080); // SAP, BT[3:0], AP, DSTB, SLP
LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0000); // DC1[2:0], DC0[2:0], VC[2:0]
LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x0000); // VREG1OUT voltage
LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0001);
LCD_Delayms(200); // Dis-charge capacitor power voltage
LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x1490); // SAP, BT[3:0], AP, DSTB, SLP, STB
LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0227); // DC1[2:0], DC0[2:0], VC[2:0]
LCD_Delayms(50); // Delay 50ms
LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x008A); //Inernal reference voltage =Vci;
LCD_Delayms(50); // Delay 50ms
LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x1A00); // VDV[4:0] for VCOM amplitude
LCD_Ctrl_DataWrite_ILI9325C(0x0029, 0x002f); // VCM[5:0] for VCOMH
LCD_Delayms(50); // Delay 50ms
LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0133); // 262K color and display ON
}
void LCD_Partial_On_TFT_9325C(kal_uint16 start_page,kal_uint16 end_page)
{
}
void LCD_Partial_Off_TFT_9325C(void)
{
}
kal_uint8 LCD_Partial_line_TFT_9325C(void)
{
return 1;
}
kal_uint8 LCD_GetParm_TFT_9325C(lcd_func_type type)
{
switch(type)
{
case lcd_Bais_func:
return 1;
case lcd_Contrast_func:
return 1;
case lcd_LineRate_func:
return 4;
case lcd_Temperature_Compensation_func:
return 4;
default:
ASSERT(0);
return 100;
}
return 1;
}
void LCD_SetBias_TFT_9325C(kal_uint8 *bias)
{
}
void LCD_Contrast_TFT_9325C(kal_uint8 *contrast)
{
}
void LCD_LineRate_TFT_9325C(kal_uint8 *linerate)
{
}
void LCD_Temp_Compensate_TFT_9325C(kal_uint8 *compensate)
{
}
kal_uint16 LCD_ILI9325C_ID(void)
{
kal_uint16 temp_id=0x0000;
*(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x00;
LCD_Delay(10);
temp_id |= ( ( *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR )<<8);
temp_id |= ( *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR );
return temp_id;
}
LCD_Funcs LCD_func_TFT_9325C= {
LCD_Init_TFT_9325C,
LCD_PWRON_TFT_9325C,
LCD_SetContrast_TFT_9325C,
LCD_ON_TFT_9325C,
LCD_BlockWrite_TFT_9325C,
LCD_Size_TFT_9325C,
LCD_EnterSleep_TFT_9325C,
LCD_ExitSleep_TFT_9325C,
LCD_Partial_On_TFT_9325C,
LCD_Partial_Off_TFT_9325C,
LCD_Partial_line_TFT_9325C,
/*Engineering mode*/
LCD_GetParm_TFT_9325C,
LCD_SetBias_TFT_9325C,
LCD_Contrast_TFT_9325C,
LCD_LineRate_TFT_9325C,
LCD_Temp_Compensate_TFT_9325C
};
#endif
哈哈,资料很详细! 谢谢楼上,
- #if defined(LCD_ILI9325C)
- #define Dummy_Delay_ILI9325C()
- void LCD_CtrlWrite_ILI9325C(kal_uint16 _data)
- {
- SET_LCD_CMD_PARAMETER(0,LCD_CMD,(_data >> 8));
- LCD_SEND_DMA_CMD(1);
- Dummy_Delay_ILI9325C();
- SET_LCD_CMD_PARAMETER(0, LCD_CMD, (_data & 0x00FF));
- LCD_SEND_DMA_CMD(1);
- }
- void LCD_DataWrite_ILI9325C(kal_uint16 _data)
- {
- SET_LCD_CMD_PARAMETER(0,LCD_DATA,(_data >> 8));
- LCD_SEND_DMA_CMD(1);
- Dummy_Delay_ILI9325C();
- SET_LCD_CMD_PARAMETER(0, LCD_DATA, (_data & 0x00FF));
- LCD_SEND_DMA_CMD(1);
- }
- //lcd
- void LCD_Ctrl_DataWrite_ILI9325C(int adr,int val)
- {
- LCD_CtrlWrite_ILI9325C(adr);
- LCD_DataWrite_ILI9325C(val);
- }
- void LCD_blockClear_ILI9325C(kal_uint16 x1,kal_uint16 y1,kal_uint16 x2,kal_uint16 y2,kal_uint16 _data)
- {
- int x,y;
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0050;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x1&0xFF00)>>8);
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x1&0xFF);
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0051;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x2&0xFF00)>>8);
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x2&0xFF);
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0052;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y1&0xFF00)>>8);
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y1&0xFF);
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0053;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y2&0xFF00)>>8);
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y2&0xFF);
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0020;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x1&0xFF00)>>8);
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x1&0xFF);
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0021;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y1&0xFF00)>>8);
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y1&0xFF);
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0022;
- for(y=y1;y<=y2;y++)
- {
- for(x=x1;x<=x2;x++)
- {
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = _data>>8;
- *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = _data&0xff;
- }
- }
- }
- void LCD_Init_TFT_9325C(kal_uint32 background, void **buf_addr)
- {
- SET_LCD_CTRL_RESET_PIN;
- LCD_Delayms(1);
- CLEAR_LCD_CTRL_RESET_PIN;
- LCD_Delayms(10);
- SET_LCD_CTRL_RESET_PIN;
- LCD_Delayms(50);
- //------------* Start Initial Sequence ------//
- LCD_Ctrl_DataWrite_ILI9325C(0x00E3,0x3008); // Set internal timing
- LCD_Ctrl_DataWrite_ILI9325C(0x00E7,0x0012); // Set internal timing
- LCD_Ctrl_DataWrite_ILI9325C(0x00EF,0x1231); // Set internal timing
- LCD_Ctrl_DataWrite_ILI9325C(0x00E5,0x78F0); // Set internal timing
- LCD_Ctrl_DataWrite_ILI9325C(0x0000,0x0001); //start oscillation
- LCD_Ctrl_DataWrite_ILI9325C(0x0001,0x0100); // set SS and SM bit
- LCD_Ctrl_DataWrite_ILI9325C(0x0002,0x0700); // 0700=line inversion,0500=frame inversion
- LCD_Ctrl_DataWrite_ILI9325C(0x0003,0x1030); // set GRAM write direction and BGR=0.
- LCD_Ctrl_DataWrite_ILI9325C(0x0004,0x0000); // Resize register
-
- LCD_Ctrl_DataWrite_ILI9325C(0x0008,0x0207); // set the back porch and front porch
- LCD_Ctrl_DataWrite_ILI9325C(0x0009,0x0000); // set non-display area refresh cycle ISC[3:0]
- LCD_Ctrl_DataWrite_ILI9325C(0x000A,0x0000); // FMARK function
- LCD_Ctrl_DataWrite_ILI9325C(0x000C,0x0000); // RGB interface setting
- LCD_Ctrl_DataWrite_ILI9325C(0x000D,0x0000); // Frame marker Position
- LCD_Ctrl_DataWrite_ILI9325C(0x000F,0x0000); // RGB interface polarity
-
- //------------*Power On sequence ------------//
- LCD_Ctrl_DataWrite_ILI9325C(0x0010,0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB
- LCD_Ctrl_DataWrite_ILI9325C(0x0011,0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
- LCD_Ctrl_DataWrite_ILI9325C(0x0012,0x0000); // VREG1OUT voltage
- LCD_Ctrl_DataWrite_ILI9325C(0x0013,0x0000); // VDV[4:0] for VCOM amplitude
- LCD_Delayms(20);
- LCD_Ctrl_DataWrite_ILI9325C(0x0010,0x1290); // DDVDH=VCI*2,VGH=VCI*6,VGL=VCI*-3
- LCD_Ctrl_DataWrite_ILI9325C(0x0011,0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
- LCD_Delayms(50);
- LCD_Ctrl_DataWrite_ILI9325C(0x0012,0x0019); // VREG1OUT=2.8Vx1.85= 4.625V
- LCD_Delayms(50);
- LCD_Ctrl_DataWrite_ILI9325C(0x0013,0x1900); // VCOM AC=VREG1OUT(4.625)*1.1=5.0875
- LCD_Ctrl_DataWrite_ILI9325C(0x0029,0x0027); // VCM[4:0] for VCOMH org 00x19_20090212
- LCD_Delayms(50);
- LCD_Ctrl_DataWrite_ILI9325C(0x0020,0x0000); // GRAM horizontal Address
- LCD_Ctrl_DataWrite_ILI9325C(0x0021,0x0000); // GRAM Vertical Address
-
- // ----------- Adjust the Gamma Curve -------//
- LCD_Ctrl_DataWrite_ILI9325C(0x0030,0x0000);
- LCD_Ctrl_DataWrite_ILI9325C(0x0031,0x0507);
- LCD_Ctrl_DataWrite_ILI9325C(0x0032,0x0004);
- LCD_Ctrl_DataWrite_ILI9325C(0x0035,0x0205);
- LCD_Ctrl_DataWrite_ILI9325C(0x0036,0x0004);
- LCD_Ctrl_DataWrite_ILI9325C(0x0037,0x0307);
- LCD_Ctrl_DataWrite_ILI9325C(0x0038,0x0002);
- LCD_Ctrl_DataWrite_ILI9325C(0x0039,0x0707);
- LCD_Ctrl_DataWrite_ILI9325C(0x003C,0x0502);
- LCD_Ctrl_DataWrite_ILI9325C(0x003D,0x0004);
- //------------------ Set GRAM area ------------//
- LCD_Ctrl_DataWrite_ILI9325C(0x0050,0x0000); // Horizontal GRAM Start Address
- LCD_Ctrl_DataWrite_ILI9325C(0x0051,0x00EF); // Horizontal GRAM End Address
- LCD_Ctrl_DataWrite_ILI9325C(0x0052,0x0000); // Vertical GRAM Start Address
- LCD_Ctrl_DataWrite_ILI9325C(0x0053,0x013F); // Vertical GRAM Start Address
- LCD_Ctrl_DataWrite_ILI9325C(0x0060,0xA700); // Gate Scan Line
- LCD_Ctrl_DataWrite_ILI9325C(0x0061,0x0001); // NDL,VLE, REV
- LCD_Ctrl_DataWrite_ILI9325C(0x006A,0x0000); // set scrolling line
-
- //-------------- Panel Control ----------------//
- LCD_Ctrl_DataWrite_ILI9325C(0x002B,0x000C); //000b=49.2HZ,000d=75HZ
- LCD_Delayms(50);
- LCD_Ctrl_DataWrite_ILI9325C(0x0090,0x0011); //0016=49.2hz,0018=75hz
- LCD_Ctrl_DataWrite_ILI9325C(0x0092,0x0600);
- LCD_Ctrl_DataWrite_ILI9325C(0x0093,0x0003);
- LCD_Ctrl_DataWrite_ILI9325C(0x0095,0x0110);
- LCD_Ctrl_DataWrite_ILI9325C(0x0097,0x0000);
- LCD_Ctrl_DataWrite_ILI9325C(0x0098,0x0000);
- LCD_Ctrl_DataWrite_ILI9325C(0x0007,0x0173); // 262K color and display ON
- LCD_blockClear_ILI9325C(0, 0, LCD_WIDTH-1, LCD_HEIGHT-1, 0);
- LCD_Delayms(120);
- }
- void LCD_PWRON_TFT_9325C(kal_bool on)
- {
- }
- void LCD_SetContrast_TFT_9325C(kal_uint8 level)
- {
- }
- void LCD_ON_TFT_9325C(kal_bool on)
- {
- }
- void LCD_BlockWrite_TFT_9325C(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
- {
- kal_uint16 roi_width;
- kal_uint16 x,y;
- while (LCD_IS_RUNNING){};
-
- //ASSERT(lcd_assert_fail==KAL_FALSE);
- lcd_assert_fail = KAL_TRUE;
- SET_LCD_CMD_PARAMETER(0,LCD_CMD,0x0050);
- SET_LCD_CMD_PARAMETER(1,LCD_DATA,((startx&0xFF00)>>8));
- SET_LCD_CMD_PARAMETER(2,LCD_DATA,(startx&0xFF));
- SET_LCD_CMD_PARAMETER(3,LCD_CMD,0x0051);
- SET_LCD_CMD_PARAMETER(4,LCD_DATA,((endx&0xFF00)>>8));
- SET_LCD_CMD_PARAMETER(5,LCD_DATA,(endx&0xFF));
- SET_LCD_CMD_PARAMETER(6,LCD_CMD,0x0052);
- SET_LCD_CMD_PARAMETER(7,LCD_DATA,((starty&0xFF00)>>8));
- SET_LCD_CMD_PARAMETER(8,LCD_DATA,(starty&0xFF));
- SET_LCD_CMD_PARAMETER(9,LCD_CMD,0x0053);
- SET_LCD_CMD_PARAMETER(10,LCD_DATA,((endy&0xFF00)>>8));
- SET_LCD_CMD_PARAMETER(11,LCD_DATA,(endy&0xFF));
- SET_LCD_CMD_PARAMETER(12,LCD_CMD,0x0020);
- SET_LCD_CMD_PARAMETER(13,LCD_DATA,((startx&0xFF00)>>8));
- SET_LCD_CMD_PARAMETER(14,LCD_DATA,(startx&0xFF));
- SET_LCD_CMD_PARAMETER(15,LCD_CMD,0x0021);
- SET_LCD_CMD_PARAMETER(16,LCD_DATA,((starty&0xFF00)>>8));
- SET_LCD_CMD_PARAMETER(17,LCD_DATA,(starty&0xFF));
- SET_LCD_CMD_PARAMETER(18,LCD_CMD,0x0022);
- ENABLE_LCD_TRANSFER_COMPLETE_INT;
- ENABLE_LCD_ROI_CTRL_CMD_FIRST;
- SET_LCD_ROI_CTRL_NUMBER_OF_CMD(19);
- START_LCD_TRANSFER;
-
- lcd_assert_fail = KAL_FALSE;
- }
- void LCD_Size_TFT_9325C(kal_uint16 *out_LCD_width,kal_uint16 *out_LCD_height)
- {
- }
- void LCD_EnterSleep_TFT_9325C(void)
- {
- LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0000); // display OFF
- //************* Power OFF sequence **************//
- LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0080); // SAP, BT[3:0], APE, AP, DSTB, SLP
- LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0000); // DC1[2:0], DC0[2:0], VC[2:0]
- LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x0000); // VREG1OUT voltage
- LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
- LCD_Delayms(200); // Dis-charge capacitor power voltage
- LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0082); // SAP, BT[3:0], APE, AP, DSTB, SLP
- }
- void LCD_ExitSleep_TFT_9325C(void)
- {
- //*************Power On sequence ******************//
- LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0080); // SAP, BT[3:0], AP, DSTB, SLP
- LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0000); // DC1[2:0], DC0[2:0], VC[2:0]
- LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x0000); // VREG1OUT voltage
- LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
- LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0001);
- LCD_Delayms(200); // Dis-charge capacitor power voltage
- LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x1490); // SAP, BT[3:0], AP, DSTB, SLP, STB
- LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0227); // DC1[2:0], DC0[2:0], VC[2:0]
- LCD_Delayms(50); // Delay 50ms
- LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x008A); //Inernal reference voltage =Vci;
- LCD_Delayms(50); // Delay 50ms
- LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x1A00); // VDV[4:0] for VCOM amplitude
- LCD_Ctrl_DataWrite_ILI9325C(0x0029, 0x002f); // VCM[5:0] for VCOMH
- LCD_Delayms(50); // Delay 50ms
- LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0133); // 262K color and display ON
- }
- void LCD_Partial_On_TFT_9325C(kal_uint16 start_page,kal_uint16 end_page)
- {
- }
- void LCD_Partial_Off_TFT_9325C(void)
- {
- }
- kal_uint8 LCD_Partial_line_TFT_9325C(void)
- {
- return 1;
- }
- kal_uint8 LCD_GetParm_TFT_9325C(lcd_func_type type)
- {
- switch(type)
- {
- case lcd_Bais_func:
- return 1;
- case lcd_Contrast_func:
- return 1;
- case lcd_LineRate_func:
- return 4;
- case lcd_Temperature_Compensation_func:
- return 4;
- default:
- ASSERT(0);
- return 100;
- }
- return 1;
- }
- void LCD_SetBias_TFT_9325C(kal_uint8 *bias)
- {
- }
- void LCD_Contrast_TFT_9325C(kal_uint8 *contrast)
- {
- }
- void LCD_LineRate_TFT_9325C(kal_uint8 *linerate)
- {
- }
- void LCD_Temp_Compensate_TFT_9325C(kal_uint8 *compensate)
- {
- }
- kal_uint16 LCD_ILI9325C_ID(void)
- {
- kal_uint16 temp_id=0x0000;
-
- *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x00;
- LCD_Delay(10);
- temp_id |= ( ( *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR )<<8);
- temp_id |= ( *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR );
- return temp_id;
- }
- LCD_Funcs LCD_func_TFT_9325C= {
- LCD_Init_TFT_9325C,
- LCD_PWRON_TFT_9325C,
- LCD_SetContrast_TFT_9325C,
- LCD_ON_TFT_9325C,
- LCD_BlockWrite_TFT_9325C,
- LCD_Size_TFT_9325C,
- LCD_EnterSleep_TFT_9325C,
- LCD_ExitSleep_TFT_9325C,
- LCD_Partial_On_TFT_9325C,
- LCD_Partial_Off_TFT_9325C,
- LCD_Partial_line_TFT_9325C,
- /*Engineering mode*/
- LCD_GetParm_TFT_9325C,
- LCD_SetBias_TFT_9325C,
- LCD_Contrast_TFT_9325C,
- LCD_LineRate_TFT_9325C,
- LCD_Temp_Compensate_TFT_9325C
- };
发布的时候可以点一下 <> 这个code图标,
或者如下这样写:
谢谢!你的是在50D上用的吗?是8位屏?我的基线关掉MAIN_LCD_9BIT_MODE后,打开MAIN_LCD_8BIT_MODE,报错