微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > 50D有没人用过9325C这颗屏?

50D有没人用过9325C这颗屏?

时间:10-02 整理:3721RD 点击:
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

哈哈,资料很详细! 谢谢楼上,

  1. #if defined(LCD_ILI9325C)

  2. #define Dummy_Delay_ILI9325C()

  3. void LCD_CtrlWrite_ILI9325C(kal_uint16 _data)
  4. {
  5.         SET_LCD_CMD_PARAMETER(0,LCD_CMD,(_data >> 8));
  6.         LCD_SEND_DMA_CMD(1);
  7.         Dummy_Delay_ILI9325C();
  8.         SET_LCD_CMD_PARAMETER(0, LCD_CMD, (_data & 0x00FF));
  9.         LCD_SEND_DMA_CMD(1);
  10. }


  11. void LCD_DataWrite_ILI9325C(kal_uint16 _data)
  12. {
  13.         SET_LCD_CMD_PARAMETER(0,LCD_DATA,(_data >> 8));
  14.         LCD_SEND_DMA_CMD(1);
  15.         Dummy_Delay_ILI9325C();
  16.         SET_LCD_CMD_PARAMETER(0, LCD_DATA, (_data & 0x00FF));
  17.         LCD_SEND_DMA_CMD(1);
  18. }


  19. //lcd
  20. void LCD_Ctrl_DataWrite_ILI9325C(int adr,int val)
  21. {
  22.         LCD_CtrlWrite_ILI9325C(adr);
  23.         LCD_DataWrite_ILI9325C(val);
  24. }


  25. void LCD_blockClear_ILI9325C(kal_uint16 x1,kal_uint16 y1,kal_uint16 x2,kal_uint16 y2,kal_uint16 _data)
  26. {
  27.     int x,y;

  28.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0050;
  29.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x1&0xFF00)>>8);
  30.            *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x1&0xFF);
  31.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0051;
  32.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x2&0xFF00)>>8);
  33.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x2&0xFF);
  34.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0052;
  35.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y1&0xFF00)>>8);
  36.            *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y1&0xFF);
  37.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0053;
  38.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y2&0xFF00)>>8);
  39.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y2&0xFF);
  40.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0020;
  41.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((x1&0xFF00)>>8);
  42.            *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (x1&0xFF);        
  43.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0021;
  44.         *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = ((y1&0xFF00)>>8);
  45.            *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = (y1&0xFF);        
  46.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x0022;

  47.     for(y=y1;y<=y2;y++)
  48.     {
  49.         for(x=x1;x<=x2;x++)
  50.         {
  51.                    *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = _data>>8;
  52.                    *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR = _data&0xff;
  53.         }
  54.     }
  55. }

  56. void LCD_Init_TFT_9325C(kal_uint32 background, void **buf_addr)
  57. {
  58.                 SET_LCD_CTRL_RESET_PIN;
  59.                 LCD_Delayms(1);
  60.                 CLEAR_LCD_CTRL_RESET_PIN;
  61.                 LCD_Delayms(10);
  62.                 SET_LCD_CTRL_RESET_PIN;
  63.                 LCD_Delayms(50);
  64.         //------------* Start Initial Sequence ------//
  65.         LCD_Ctrl_DataWrite_ILI9325C(0x00E3,0x3008);          // Set internal timing
  66.         LCD_Ctrl_DataWrite_ILI9325C(0x00E7,0x0012);          // Set internal timing
  67.         LCD_Ctrl_DataWrite_ILI9325C(0x00EF,0x1231);          // Set internal timing
  68.         LCD_Ctrl_DataWrite_ILI9325C(0x00E5,0x78F0);          // Set internal timing
  69.         LCD_Ctrl_DataWrite_ILI9325C(0x0000,0x0001);           //start oscillation
  70.         LCD_Ctrl_DataWrite_ILI9325C(0x0001,0x0100);           // set SS and SM bit
  71.         LCD_Ctrl_DataWrite_ILI9325C(0x0002,0x0700);           // 0700=line inversion,0500=frame inversion
  72.         LCD_Ctrl_DataWrite_ILI9325C(0x0003,0x1030);           // set GRAM write direction and BGR=0.
  73.         LCD_Ctrl_DataWrite_ILI9325C(0x0004,0x0000);           // Resize register
  74.       
  75.         LCD_Ctrl_DataWrite_ILI9325C(0x0008,0x0207);           // set the back porch and front porch
  76.         LCD_Ctrl_DataWrite_ILI9325C(0x0009,0x0000);           // set non-display area refresh cycle ISC[3:0]
  77.         LCD_Ctrl_DataWrite_ILI9325C(0x000A,0x0000);           // FMARK function
  78.         LCD_Ctrl_DataWrite_ILI9325C(0x000C,0x0000);      // RGB interface setting
  79.         LCD_Ctrl_DataWrite_ILI9325C(0x000D,0x0000);           // Frame marker Position
  80.         LCD_Ctrl_DataWrite_ILI9325C(0x000F,0x0000);      // RGB interface polarity
  81.       
  82.    //------------*Power On sequence ------------//
  83.         LCD_Ctrl_DataWrite_ILI9325C(0x0010,0x0000);      // SAP, BT[3:0], AP, DSTB, SLP, STB
  84.         LCD_Ctrl_DataWrite_ILI9325C(0x0011,0x0007);      // DC1[2:0], DC0[2:0], VC[2:0]
  85.         LCD_Ctrl_DataWrite_ILI9325C(0x0012,0x0000);      // VREG1OUT voltage
  86.         LCD_Ctrl_DataWrite_ILI9325C(0x0013,0x0000);      // VDV[4:0] for VCOM amplitude
  87.         LCD_Delayms(20);
  88.         LCD_Ctrl_DataWrite_ILI9325C(0x0010,0x1290);      // DDVDH=VCI*2,VGH=VCI*6,VGL=VCI*-3
  89.         LCD_Ctrl_DataWrite_ILI9325C(0x0011,0x0007);      // DC1[2:0], DC0[2:0], VC[2:0]
  90.         LCD_Delayms(50);
  91.         LCD_Ctrl_DataWrite_ILI9325C(0x0012,0x0019);      // VREG1OUT=2.8Vx1.85= 4.625V
  92.         LCD_Delayms(50);
  93.         LCD_Ctrl_DataWrite_ILI9325C(0x0013,0x1900);      // VCOM AC=VREG1OUT(4.625)*1.1=5.0875
  94.         LCD_Ctrl_DataWrite_ILI9325C(0x0029,0x0027);      // VCM[4:0] for VCOMH  org 00x19_20090212
  95.         LCD_Delayms(50);   
  96.         LCD_Ctrl_DataWrite_ILI9325C(0x0020,0x0000);      // GRAM horizontal Address
  97.         LCD_Ctrl_DataWrite_ILI9325C(0x0021,0x0000);      // GRAM Vertical Address
  98.    
  99.     // ----------- Adjust the Gamma  Curve -------//
  100.         LCD_Ctrl_DataWrite_ILI9325C(0x0030,0x0000);               
  101.         LCD_Ctrl_DataWrite_ILI9325C(0x0031,0x0507);               
  102.         LCD_Ctrl_DataWrite_ILI9325C(0x0032,0x0004);                           
  103.         LCD_Ctrl_DataWrite_ILI9325C(0x0035,0x0205);               
  104.         LCD_Ctrl_DataWrite_ILI9325C(0x0036,0x0004);               
  105.         LCD_Ctrl_DataWrite_ILI9325C(0x0037,0x0307);               
  106.         LCD_Ctrl_DataWrite_ILI9325C(0x0038,0x0002);               
  107.         LCD_Ctrl_DataWrite_ILI9325C(0x0039,0x0707);      
  108.         LCD_Ctrl_DataWrite_ILI9325C(0x003C,0x0502);               
  109.         LCD_Ctrl_DataWrite_ILI9325C(0x003D,0x0004);        


  110.      //------------------ Set GRAM area ------------//
  111.         LCD_Ctrl_DataWrite_ILI9325C(0x0050,0x0000);            // Horizontal GRAM Start Address
  112.         LCD_Ctrl_DataWrite_ILI9325C(0x0051,0x00EF);            // Horizontal GRAM End Address
  113.         LCD_Ctrl_DataWrite_ILI9325C(0x0052,0x0000);            // Vertical GRAM Start Address
  114.         LCD_Ctrl_DataWrite_ILI9325C(0x0053,0x013F);            // Vertical GRAM Start Address
  115.         LCD_Ctrl_DataWrite_ILI9325C(0x0060,0xA700);            // Gate Scan Line
  116.         LCD_Ctrl_DataWrite_ILI9325C(0x0061,0x0001);            // NDL,VLE, REV
  117.         LCD_Ctrl_DataWrite_ILI9325C(0x006A,0x0000);            // set scrolling line
  118.      

  119.      //-------------- Panel Control ----------------//
  120.         LCD_Ctrl_DataWrite_ILI9325C(0x002B,0x000C);  //000b=49.2HZ,000d=75HZ
  121.         LCD_Delayms(50);
  122.         LCD_Ctrl_DataWrite_ILI9325C(0x0090,0x0011);  //0016=49.2hz,0018=75hz
  123.         LCD_Ctrl_DataWrite_ILI9325C(0x0092,0x0600);
  124.         LCD_Ctrl_DataWrite_ILI9325C(0x0093,0x0003);
  125.         LCD_Ctrl_DataWrite_ILI9325C(0x0095,0x0110);
  126.         LCD_Ctrl_DataWrite_ILI9325C(0x0097,0x0000);
  127.         LCD_Ctrl_DataWrite_ILI9325C(0x0098,0x0000);
  128.         LCD_Ctrl_DataWrite_ILI9325C(0x0007,0x0173);            // 262K color and display ON


  129.                 LCD_blockClear_ILI9325C(0, 0, LCD_WIDTH-1, LCD_HEIGHT-1, 0);
  130.                 LCD_Delayms(120);
  131. }


  132. void LCD_PWRON_TFT_9325C(kal_bool on)
  133. {

  134. }


  135. void LCD_SetContrast_TFT_9325C(kal_uint8 level)
  136. {

  137. }


  138. void LCD_ON_TFT_9325C(kal_bool on)
  139. {

  140. }


  141. void LCD_BlockWrite_TFT_9325C(kal_uint16 startx,kal_uint16 starty,kal_uint16 endx,kal_uint16 endy)
  142. {
  143.         kal_uint16 roi_width;
  144.         kal_uint16 x,y;
  145.         while (LCD_IS_RUNNING){};
  146.         
  147.         //ASSERT(lcd_assert_fail==KAL_FALSE);
  148.         lcd_assert_fail = KAL_TRUE;

  149.         SET_LCD_CMD_PARAMETER(0,LCD_CMD,0x0050);
  150.         SET_LCD_CMD_PARAMETER(1,LCD_DATA,((startx&0xFF00)>>8));
  151.            SET_LCD_CMD_PARAMETER(2,LCD_DATA,(startx&0xFF));
  152.         SET_LCD_CMD_PARAMETER(3,LCD_CMD,0x0051);
  153.         SET_LCD_CMD_PARAMETER(4,LCD_DATA,((endx&0xFF00)>>8));
  154.         SET_LCD_CMD_PARAMETER(5,LCD_DATA,(endx&0xFF));
  155.         SET_LCD_CMD_PARAMETER(6,LCD_CMD,0x0052);
  156.         SET_LCD_CMD_PARAMETER(7,LCD_DATA,((starty&0xFF00)>>8));
  157.            SET_LCD_CMD_PARAMETER(8,LCD_DATA,(starty&0xFF));
  158.         SET_LCD_CMD_PARAMETER(9,LCD_CMD,0x0053);
  159.         SET_LCD_CMD_PARAMETER(10,LCD_DATA,((endy&0xFF00)>>8));
  160.         SET_LCD_CMD_PARAMETER(11,LCD_DATA,(endy&0xFF));
  161.         SET_LCD_CMD_PARAMETER(12,LCD_CMD,0x0020);
  162.         SET_LCD_CMD_PARAMETER(13,LCD_DATA,((startx&0xFF00)>>8));
  163.            SET_LCD_CMD_PARAMETER(14,LCD_DATA,(startx&0xFF));        
  164.         SET_LCD_CMD_PARAMETER(15,LCD_CMD,0x0021);
  165.         SET_LCD_CMD_PARAMETER(16,LCD_DATA,((starty&0xFF00)>>8));
  166.            SET_LCD_CMD_PARAMETER(17,LCD_DATA,(starty&0xFF));        
  167.         SET_LCD_CMD_PARAMETER(18,LCD_CMD,0x0022);
  168.         ENABLE_LCD_TRANSFER_COMPLETE_INT;
  169.         ENABLE_LCD_ROI_CTRL_CMD_FIRST;
  170.         SET_LCD_ROI_CTRL_NUMBER_OF_CMD(19);
  171.         START_LCD_TRANSFER;
  172.         
  173.         lcd_assert_fail = KAL_FALSE;
  174. }


  175. void LCD_Size_TFT_9325C(kal_uint16 *out_LCD_width,kal_uint16 *out_LCD_height)
  176. {
  177. }


  178. void LCD_EnterSleep_TFT_9325C(void)
  179. {
  180.         LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0000);    // display OFF
  181.         //************* Power OFF sequence **************//
  182.         LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0080);        // SAP, BT[3:0], APE, AP, DSTB, SLP
  183.         LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0000);        // DC1[2:0], DC0[2:0], VC[2:0]
  184.         LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x0000);        // VREG1OUT voltage
  185.         LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x0000);        // VDV[4:0] for VCOM amplitude
  186.         LCD_Delayms(200);                               // Dis-charge capacitor power voltage
  187.         LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0082);       // SAP, BT[3:0], APE, AP, DSTB, SLP
  188. }


  189. void LCD_ExitSleep_TFT_9325C(void)
  190. {
  191.         //*************Power On sequence ******************//
  192.         LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x0080);      // SAP, BT[3:0], AP, DSTB, SLP
  193.         LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0000);      // DC1[2:0], DC0[2:0], VC[2:0]
  194.         LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x0000);      // VREG1OUT voltage
  195.         LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x0000);      // VDV[4:0] for VCOM amplitude
  196.         LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0001);  
  197.         LCD_Delayms(200);                             // Dis-charge capacitor power voltage
  198.         LCD_Ctrl_DataWrite_ILI9325C(0x0010, 0x1490);      // SAP, BT[3:0], AP, DSTB, SLP, STB
  199.         LCD_Ctrl_DataWrite_ILI9325C(0x0011, 0x0227);      // DC1[2:0], DC0[2:0], VC[2:0]
  200.         LCD_Delayms(50);                   // Delay 50ms   
  201.         LCD_Ctrl_DataWrite_ILI9325C(0x0012, 0x008A);      //Inernal reference voltage =Vci;  
  202.         LCD_Delayms(50);                   // Delay 50ms
  203.         LCD_Ctrl_DataWrite_ILI9325C(0x0013, 0x1A00);      // VDV[4:0] for VCOM amplitude
  204.         LCD_Ctrl_DataWrite_ILI9325C(0x0029, 0x002f);      // VCM[5:0] for VCOMH
  205.         LCD_Delayms(50);                               // Delay 50ms     
  206.         LCD_Ctrl_DataWrite_ILI9325C(0x0007, 0x0133);      // 262K color and display ON
  207. }


  208. void LCD_Partial_On_TFT_9325C(kal_uint16 start_page,kal_uint16 end_page)
  209. {
  210. }


  211. void LCD_Partial_Off_TFT_9325C(void)
  212. {
  213. }


  214. kal_uint8 LCD_Partial_line_TFT_9325C(void)
  215. {
  216.         return 1;
  217. }        


  218. kal_uint8        LCD_GetParm_TFT_9325C(lcd_func_type type)
  219. {
  220.         switch(type)
  221.         {
  222.                 case lcd_Bais_func:
  223.                         return 1;
  224.                 case lcd_Contrast_func:
  225.                         return 1;
  226.                 case lcd_LineRate_func:
  227.                         return 4;
  228.                 case lcd_Temperature_Compensation_func:
  229.                         return 4;
  230.                 default:
  231.                         ASSERT(0);
  232.                         return 100;
  233.         }

  234.         return 1;
  235. }


  236. void LCD_SetBias_TFT_9325C(kal_uint8 *bias)
  237. {
  238. }


  239. void LCD_Contrast_TFT_9325C(kal_uint8 *contrast)
  240. {
  241. }


  242. void LCD_LineRate_TFT_9325C(kal_uint8 *linerate)
  243. {
  244. }


  245. void LCD_Temp_Compensate_TFT_9325C(kal_uint8 *compensate)
  246. {
  247. }


  248. kal_uint16 LCD_ILI9325C_ID(void)
  249. {
  250.         kal_uint16 temp_id=0x0000;
  251.         
  252.         *(volatile kal_uint8 *)MAIN_LCD_CMD_ADDR = 0x00;
  253.         LCD_Delay(10);
  254.         temp_id |= ( ( *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR )<<8);
  255.         temp_id |= ( *(volatile kal_uint8 *)MAIN_LCD_DATA_ADDR );
  256.         return temp_id;
  257. }


  258. LCD_Funcs LCD_func_TFT_9325C= {
  259.         LCD_Init_TFT_9325C,
  260.         LCD_PWRON_TFT_9325C,
  261.         LCD_SetContrast_TFT_9325C,
  262.         LCD_ON_TFT_9325C,
  263.         LCD_BlockWrite_TFT_9325C,
  264.         LCD_Size_TFT_9325C,
  265.         LCD_EnterSleep_TFT_9325C,
  266.         LCD_ExitSleep_TFT_9325C,
  267.         LCD_Partial_On_TFT_9325C,
  268.         LCD_Partial_Off_TFT_9325C,
  269.         LCD_Partial_line_TFT_9325C,
  270.         /*Engineering mode*/
  271.         LCD_GetParm_TFT_9325C,
  272.         LCD_SetBias_TFT_9325C,
  273.         LCD_Contrast_TFT_9325C,
  274.         LCD_LineRate_TFT_9325C,
  275.         LCD_Temp_Compensate_TFT_9325C
  276. };        

复制代码

我这样是不是好看一些

发布的时候可以点一下 <> 这个code图标,
或者如下这样写:

谢谢!你的是在50D上用的吗?是8位屏?我的基线关掉MAIN_LCD_9BIT_MODE后,打开MAIN_LCD_8BIT_MODE,报错

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top