⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcddrv.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 4 页
字号:
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 0 */ 

/* ----------------------------------------------------------------------------
   Function   :  void LCDrINIT(void)
   Description:  This function Initilizes LCD parameters.
   Input      :  NULL
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrINIT
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrINIT(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    *(volatile uint16*)0x8001000c = 0x6106; /* This is needed by PLUTO Engineers to resolve timing issues */
    // If we use Preprosser -DUT_ON_TARGET in build enviornment, we have
    // execute above instruction. 
    // IMPORTANT : For other cases this instruction is not needed.                
    LCDrDISCONTROL();                       /* display settings */
    LCDrSETCOMSCAN();                       /* scanning flow */
    LCDrCTRLOSCON();                        /* oscillator ON */
    LCDrGENSLPOUT();                        /* Sleep Out */
    LCDrVOLTLEVEL(0x28);                    /* Voltage Set     2a to 16 */
    LCDrTEMPERATUREGRAD();                  /* Set Temperature Gradiants */
    LCDrPOWERCNTL(0x0f);                    /* ON all refrence voltages to LCD */
    LCDrSetDATANORCTL();                    /* Column direction, RGB pattern */
    LCDrINVERSE()                           /* ? Inverse LCD RAM Contents before displaying */
        LCDrblockClear(0, 0, LCDrWIDTH - 1, LCDrHEIGHT - 1);    /* Clear LCD RAM fill 000H */
    LCDrDISPON();                           /* LCD Display ON */
}

/* ----------------------------------------------------------------------------
   Function   :  void LCDrDISCONTROL(void)
   Description:  This function Initilizes LCD Display parameters.
   Input      :  NULL
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrDISCONTROL
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrDISCONTROL(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    LCDrCtrlWrite(LCDrDISCTL);

    LCDrDataWrite(0xF); /* ONLY FLICKER NO MOTION // Clock Dividing 2 div, 8 drive pattern */
    //      LCDrDataWrite(0xE);                             // ONLY FLICKER NO MOTION
    //      LCDrDataWrite(0xA);                             // VERY BAD
    //      LCDrDataWrite(0xD);                             // SAME AS E F
    //      LCDrDataWrite(0x3);                             // fllicker and motion
    //      LCDrDataWrite(0x0);                             // fllicker and motion

    LCDrDataWrite(LCDrDISCTL_160DUTY);  /* Duty / module on block basis 160/4-1 = 39 */
    LCDrDataWrite(LCDrDISCTL_11H);      /* 10 lines to be inversely highlited */
    /* LCDrDataWrite(0xf);                          // flickering increases */

}

/* ----------------------------------------------------------------------------
   Function   :  void LCDrSETCOMSCAN(void)
   Description:  This function Initilizes LCD Display Scan parameter.
   Input      :  NULL
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrSETCOMSCAN
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrSETCOMSCAN(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    LCDrCtrlWrite(LCDrCOMSCN);
    LCDrDataWrite(0x2); /* scan direction 1 -> 80, 81 -> 160 */

}

/* ----------------------------------------------------------------------------
   Function   :  void LCDrVOLTLEVEL(uint8 voltage)
   Description:  This function Initilizes LCD voltage parameters.
   Input      :  NULL
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrVOLTLEVEL
 * DESCRIPTION
 *  
 * PARAMETERS
 *  voltage     [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrVOLTLEVEL(uint8 voltage)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    LCDrCtrlWrite(LCDrVOLCTR);  /* 0x2a-0x16 */
    LCDrDataWrite(voltage);     /* set voltage */
    LCDrDataWrite(0x02);        /* resistance ratio */
    //      LCDrDataWrite(0x30);
    //      LCDrDataWrite(0x7);
}

/* ----------------------------------------------------------------------------
   Function   :  void LCDrTEMPERATUREGRAD(void)
   Description:  This function Initilizes LCD temperature parameters.
   Input      :  NULL
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrTEMPERATUREGRAD
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrTEMPERATUREGRAD(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    LCDrCtrlWrite(LCDrTMPGRD);  /* temperature Gradient */
    LCDrDataWrite(0x00);
    LCDrDataWrite(0x32);
    LCDrDataWrite(0x10);
    LCDrDataWrite(0xfe);
    LCDrDataWrite(0xdc);
}

/* ----------------------------------------------------------------------------
   Function   :  void LCDrPOWERCNTL(uint8 data)
   Description:  This function controls LCD power parameters.
   Input      :  0xF -> All power ON
   0x0 -> All refrence voltage OFF
   Other depending upon requirement 
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrPOWERCNTL
 * DESCRIPTION
 *  
 * PARAMETERS
 *  data        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrPOWERCNTL(uint8 data)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    LCDrCtrlWrite(LCDrPWRCTR);  /* Power Control */
    LCDrDataWrite(data);        /* All Ckts ON -> F, OFF -> 00 */
}

/* ----------------------------------------------------------------------------
   Function   :  void LCDrSetDATANORCTL(void)
   Description:  This function Initilizes LCD Display Data parameters.
   Input      :  NULL
   Output     :  None
   ------------------------------------------------------------------------------- */


/*****************************************************************************
 * FUNCTION
 *  LCDrSetDATANORCTL
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void LCDrSetDATANORCTL(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -