lcm_unitone18.c.svn-base

来自「多个厂家的LCD 驱动程序」· SVN-BASE 代码 · 共 99 行

SVN-BASE
99
字号
#include "../../INCLUDE/API.h"
#include "lcm.h"
#include "mp321app.h"
//#include "../LCD/Include/utillcd.h"

//=================================================
//=================================================

#if (defined(_PRIMARY_LCM_UNITONE18) || defined(_SECONDARY_LCM_UNITONE18))

void UNITONE18_LCM_Init(U8 bTargetLCM)
{
    // Reset LCM
#if 0
    rPDATD|=LCM_UNITONE_RST;
    __TIMER_DELAY(50);
    rPDATD&=(~LCM_UNITONE_RST);
    __TIMER_DELAY(50);
    rPDATD|=LCM_UNITONE_RST;
#endif

    MP321_Release(bTargetLCM);
    __TIMER_DELAY(50);
    UNITONE18_LCM_PowerOn();
    UNITONE18_LCM_DisplayOn();

}

void UNITONE18_LCM_PowerOn(void)
{
    LCM_WriteCmd(0x01,0x0000);
    __TIMER_DELAY(40);
    LCM_WriteCmd(0x02,0x0076);
    LCM_WriteCmd(0x06,0x0008);//
    LCM_WriteCmd(0x3F,0x0008);
    LCM_WriteCmd(0x4A,0x0070);
    LCM_WriteCmd(0x3F,0x0000);

    LCM_WriteCmd(0x14,0x0000);//
    LCM_WriteCmd(0x15,0x007F);//
    LCM_WriteCmd(0x16,0x009F);//
}

void UNITONE18_LCM_DisplayOn(void)
{


}

void UNITONE18_LCM_DisplayOff(void)
{
    LCM_WriteCmd(0x01,0x0002);

    __TIMER_DELAY(100);

    LCM_WriteCmd(0x3F,0x0008);

    __TIMER_DELAY(32);

    LCM_WriteCmd(0x4A,0x00DC);
}

void UNITONE18_LCM_StandbyOn(void)
{
}

void UNITONE18_LCM_StandbyOff(void)
{
}

void UNITONE18_LCM_Update(U8 bTargetLCM, U16 *pu16Buffer)
{
    unsigned short i,j;

    MP321_Release(bTargetLCM);
    UNITONE18_LCM_AddressRefresh();

    for(i=0;i<160;i++)
    {
        for(j=0;j<128;j++)
        {
            LCM_WRITE_DAT= *(pu16Buffer + i * 128 + j);
        }
    }

    //iMagic_DisableBypass();
}

void UNITONE18_LCM_AddressRefresh(void)
{
    LCM_WriteCmd(0x10,0x0000);
    LCM_WriteCmd(0x11,0x0000);

}

#endif                // #ifdef _LCM_UNITONE18


⌨️ 快捷键说明

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