📄 lcm_unitone22.c.svn-base
字号:
#include "../../INCLUDE/API.h"
#include "lcm.h"
#include "mp321app.h"
//#include "../LCD/Include/utillcd.h"
#if (defined(_PRIMARY_LCM_UNITONE22) || defined(_SECONDARY_LCM_UNITONE22))
//=================================================
//
//
//=================================================
void LCM_SerialCommand(U16 wData1,U16 wData2)
{
U32 count=0x10000;
LCM_WRITE_ADR=0x0111;
LCM_WRITE_DAT=wData1;
LCM_WRITE_ADR=0x110;
while((LCM_WRITE_DAT&0x8000)&&count)
{
count--;
}
LCM_WRITE_DAT=wData2;
}
void UNITONE22_LCM_Init(U8 bTargetLCM)
{
MP321_Release(bTargetLCM);
UNITONE22_LCM_PowerOn();
UNITONE22_LCM_DisplayOn();
}
void UNITONE22_LCM_PowerOn(void)
{
LCM_WriteCmd(0x00,0x01);
#if 0
mov r5,#001h
mov r6,#001h
mov r0,#004h
mov r1,#074h
lcall serial_cmd
#endif
LCM_SerialCommand(0x0474,0x0101);
#if 0
mov r5,#001h
mov r6,#002h
mov r0,#002h
mov r1,#0deh
lcall serial_cmd
#endif
LCM_SerialCommand(0x02DE,0x0102);
#if 0
mov r5,#001h
mov r6,#001h
mov r0,#00ch
mov r1,#074h
lcall serial_cmd
#endif
LCM_SerialCommand(0x0C74,0x0101);
#if 0
;-----------------------
mov r3,#001h
mov r4,#000h
lcall control_cmd
mov r3,#000h
mov r4,#050h
lcall control_data
;-----------------------
#endif
LCM_WriteCmd(0x0100,0x0050);
#if 0
mov r5,#001h
mov r6,#000h
mov r0,#008h
mov r1,#00ch
lcall serial_cmd
#endif
LCM_SerialCommand(0x080C,0x0100);
#if 0
mov r5,#001h
mov r6,#002h
mov r0,#001h
mov r1,#02eh
lcall serial_cmd
#endif
LCM_SerialCommand(0x012E,0x0102);
#if 0
mov r5,#001h
mov r6,#001h
mov r0,#004h
mov r1,#0b2h
lcall serial_cmd
lcall wait
#endif
LCM_SerialCommand(0x04B2,0x0101);
__TIMER_DELAY(50);
#if 0
mov r5,#001h
mov r6,#001h
mov r0,#004h
mov r1,#0f0h
lcall serial_cmd
lcall wait
#endif
LCM_SerialCommand(0x04F0,0x0101);
__TIMER_DELAY(50);
#if 0
mov r5,#001h
mov r6,#003h
mov r0,#000h
mov r1,#008h
lcall serial_cmd
#endif
LCM_SerialCommand(0x0008,0x0103);
#if 0
mov r5,#001h
mov r6,#006h
mov r0,#009h
mov r1,#0c0h
lcall serial_cmd
lcall wait
lcall wait
#endif
LCM_SerialCommand(0x09c0,0x0106);
__TIMER_DELAY(50);
}
void UNITONE22_LCM_DisplayOn(void)
{
#if 0
mov r5,#001h
mov r6,#000h
mov r0,#00ch
mov r1,#00ah
lcall serial_cmd
#endif
LCM_SerialCommand(0x0c0a,0x0100);
#if 0
mov r3,#001h
mov r4,#000h
lcall control_cmd
mov r3,#001h
mov r4,#010h
lcall control_data
#endif
LCM_WriteCmd(0x0100,0x0110);
#if 0
mov r3,#000h
mov r4,#007h
lcall control_cmd
mov r3,#000h
mov r4,#001h
lcall control_data
lcall wait
#endif
LCM_WriteCmd(0x0007,0x0001);
#if 0
mov r3,#000h
mov r4,#007h
lcall control_cmd
mov r3,#000h
mov r4,#012h
lcall control_data
#endif
LCM_WriteCmd(0x0007,0x0012);
#if 0
mov r5,#001h
mov r6,#000h
mov r0,#00ch
mov r1,#008h
lcall serial_cmd
#endif
LCM_SerialCommand(0x0C08,0x0100);
#if 0
mov r3,#000h
mov r4,#007h
lcall control_cmd
mov r3,#000h
mov r4,#003h
lcall control_data
#endif
LCM_WriteCmd(0x0007,0x0003);
#if 0
mov r3,#000h
mov r4,#007h
lcall control_cmd
mov r3,#000h
mov r4,#013h
lcall control_data
#endif
LCM_WriteCmd(0x0007,0x0013);
#if 0
mov r3,#000h
mov r4,#007h
lcall control_cmd
mov r3,#001h
mov r4,#013h
lcall control_data
#endif
LCM_WriteCmd(0x0007,0x0113);
//=================other setting==============
#if 0
mov r3,#000h
mov r4,#001h
lcall control_cmd
mov r3,#001h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0001,0x0100);
#if 0
mov r3,#000h
mov r4,#002h
lcall control_cmd
mov r3,#007h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0002,0x0700);
#if 0
mov r3,#000h
mov r4,#003h
lcall control_cmd
mov r3,#011h
mov r4,#030h
lcall control_data
#endif
LCM_WriteCmd(0x0003,0x1130);
#if 0
mov r3,#000h
mov r4,#004h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0004,0x0000);
#if 0
mov r3,#000h
mov r4,#005h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0005,0x0000);
#if 0
mov r3,#000h
mov r4,#008h
lcall control_cmd
mov r3,#003h
mov r4,#003h
lcall control_data
#endif
LCM_WriteCmd(0x0008,0x0303);
#if 0
mov r3,#000h
mov r4,#009h
lcall control_cmd
mov r3,#014h
mov r4,#02ch
lcall control_data
#endif
LCM_WriteCmd(0x0009,0x142C);
#if 0
mov r3,#000h
mov r4,#00bh
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x000b,0x0000);
#if 0
mov r3,#000h
mov r4,#00ch
lcall control_cmd
mov r3,#000h
mov r4,#001h
lcall control_data
#endif
LCM_WriteCmd(0x000c,0x0001);
#if 0
mov r3,#000h
mov r4,#00dh
lcall control_cmd
mov r3,#000h
mov r4,#010h
lcall control_data
#endif
LCM_WriteCmd(0x000d,0x0010);
#if 0
mov r3,#000h
mov r4,#00eh
lcall control_cmd
mov r3,#002h
mov r4,#010h
lcall control_data
#endif
LCM_WriteCmd(0x000E,0x0210);
#if 0
mov r3,#000h
mov r4,#00fh
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x000f,0x0000);
#if 0
mov r3,#000h
mov r4,#010h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0010,0x0000);
#if 0
mov r3,#000h
mov r4,#011h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0011,0x0000);
#if 0
mov r3,#000h
mov r4,#012h
lcall control_cmd
mov r3,#000h
mov r4,#002h
lcall control_data
#endif
LCM_WriteCmd(0x0012,0x002);
#if 0
mov r3,#000h
mov r4,#013h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0013,0x0000);
#if 0
mov r3,#000h
mov r4,#015h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0015,0x0000);
#if 0
mov r3,#000h
mov r4,#016h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0016,0x0000);
#if 0
mov r3,#000h
mov r4,#017h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0017,0x0000);
#if 0
mov r3,#000h
mov r4,#018h
lcall control_cmd
mov r3,#000h
mov r4,#005h
lcall control_data
#endif
LCM_WriteCmd(0x0018,0x0005);
#if 0
mov r3,#000h
mov r4,#019h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0019,0x0000);
#if 0
mov r3,#000h
mov r4,#01bh
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x001b,0x0000);
#if 0
mov r3,#002h
mov r4,#000h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0200,0x0000);
#if 0
mov r3,#002h
mov r4,#001h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0201,0x0000);
#if 0
mov r3,#002h
mov r4,#010h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0210,0x0000);
#if 0
mov r3,#002h
mov r4,#011h
lcall control_cmd
mov r3,#000h
mov r4,#0efh
lcall control_data
#endif
LCM_WriteCmd(0x0211,0x00EF);
#if 0
mov r3,#002h
mov r4,#012h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0212,0x0000);
#if 0
mov r3,#002h
mov r4,#013h
lcall control_cmd
mov r3,#001h
mov r4,#03fh
lcall control_data
#endif
LCM_WriteCmd(0x0213,0x013F);
#if 0
mov r3,#004h
mov r4,#000h
lcall control_cmd
mov r3,#000h
mov r4,#027h
lcall control_data
#endif
LCM_WriteCmd(0x0400,0x0027);
#if 0
mov r3,#004h
mov r4,#001h
lcall control_cmd
mov r3,#000h
mov r4,#001h
lcall control_data
#endif
LCM_WriteCmd(0x0401,0x0001);
#if 0
mov r3,#004h
mov r4,#002h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0402,0x0000);
#if 0
mov r3,#004h
mov r4,#003h
lcall control_cmd
mov r3,#001h
mov r4,#03fh
lcall control_data
#endif
LCM_WriteCmd(0x0403,0x013F);
#if 0
mov r3,#004h
mov r4,#004h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0404,0x0000);
#if 0
mov r3,#004h
mov r4,#005h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
#endif
LCM_WriteCmd(0x0405,0x0000);
#if 0
mov r3,#004h
mov r4,#006h
lcall control_cmd
mov r3,#000h
mov r4,#000h
lcall control_data
lcall wait
#endif
LCM_WriteCmd(0x0406,0x0000);
__TIMER_DELAY(50);
}
void UNITONE22_LCM_DisplayOff(void)
{
}
void UNITONE22_LCM_StandbyOn(void)
{
}
void UNITONE22_LCM_StandbyOff(void)
{
}
void UNITONE22_LCM_Update(U8 bTargetLCM, U16 *pu16Buffer)
{
unsigned short i,j;
MP321_Release(bTargetLCM);
UNITONE22_LCM_AddressRefresh();
LCM_WRITE_ADR=0x0202;
for(i=0;i<320;i++)
{
for(j=0;j<240;j++)
{
LCM_WRITE_DAT= *(pu16Buffer + i * 240 + j);
}
}
//iMagic_DisableBypass();
}
void UNITONE22_LCM_AddressRefresh(void)
{
}
#endif // #ifdef _LCM_UNITONE22
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -