📄 lcm_epson_l5f30363.c.svn-base
字号:
#include "iMagicApi.h"
#include "lcm.h"
#include "UtilLcd.h"
//=================================================
//This file is for EPSON --L5F30363 PANEL MODULE
//
//=================================================
#if (defined(_PRIMARY_LCM_EPSON_L5F30363) || defined(_SECONDARY_LCM_EPSON_L5F30363))
const unsigned short gray_650[] = {
0x0000,0x0002,0x0004,0x0006,0x0800,0x000a,0x000c,0x000e,0x0010,0x0012,0x0014,0x0016,0x0018,0x001a,0x001c,0x001e,
0x0021,0x0023,0x0025,0x0027,0x0029,0x002b,0x002d,0x002f,0x0031,0x0033,0x0035,0x0037,0x0039,0x003b,0x003d,0x003f,
0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f,
0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f,
0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f,
0x0000,0x0002,0x0004,0x0006,0x0008,0x000a,0x000c,0x000e,0x0010,0x0012,0x0014,0x0016,0x0018,0x001a,0x001c,0x001e,
0x0021,0x0023,0x0025,0x0027,0x0029,0x002b,0x002d,0x002f,0x0031,0x0033,0x0035,0x0037,0x0039,0x003b,0x003d,0x003f
};
void EPSON_L5F30363_LCM_PowerOn(void)
{
unsigned short i ;
/*
MC_LCM_RESET_H;
__TIMER_DELAY(50);
MC_LCM_RESET_L;
__TIMER_DELAY(80);
MC_LCM_RESET_H;
__TIMER_DELAY(50);
*/
LCM_WRITE_ADR = 0x20; // set display normal
LCM_WriteCmd(0x26, 0x0001); // Gamset
LCM_WRITE_ADR = 0x38; //exit 8 color mode
LCM_WriteCmd(0x36, 0x0000); // set madctl, Case 1
LCM_WriteCmd(0x3A, 0x0005); // set colmod, RGB565 (65K color)
LCM_WriteCmd(0xC2, 0x0000); // set ifmod, 666 mode 2/3 (also RGB565)
LCM_WRITE_ADR = 0x11; //set sleep out
__TIMER_DELAY(30);
LCM_WriteCmd(0x2B, 0x0000); // set page address
LCM_WriteMemory(0x0000);
LCM_WriteMemory(0x0001); // 320 - 1
LCM_WriteMemory(0x003F);
LCM_WriteCmd(0x2A, 0x0000); // set col address
LCM_WriteMemory(0x0000);
LCM_WriteMemory(0x0000); // 240 - 1
LCM_WriteMemory(0x00EF);
LCM_WRITE_ADR = 0x2D; // set 65k look up table
for (i=0;i < 128; i++)
{
LCM_WriteMemory(gray_650[i]);
}
__TIMER_DELAY(20);
//LCM_WRITE_ADR = 0x29; // display on
}
void EPSON_L5F30363_LCM_Init(U08 bTargetLCM)
{
iMagic_Release(bTargetLCM);
EPSON_L5F30363_LCM_PowerOn();
EPSON_L5F30363_LCM_DisplayOn();
}
void EPSON_L5F30363_LCM_DisplayOn(void)
{
LCM_WRITE_ADR = 0x29; // DISPLAY ON
}
void EPSON_L5F30363_LCM_DisplayOff(void)
{
LCM_WRITE_ADR = 0x28; // DISPLAY OFF
}
void EPSON_L5F30363_LCM_StandbyOn(void)
{
LCM_WRITE_ADR = 0x10; //set sleep in mode
}
void EPSON_L5F30363_LCM_StandbyOff(void)
{
LCM_WRITE_ADR = 0x11; //Sleep out
__TIMER_DELAY(10);
LCM_WRITE_ADR = 0x29; //display on
}
void EPSON_L5F30363_LCM_Update(U8 bTargetLCM, U16 *pu16Buffer)
{
unsigned short i,j;
iMagic_Release(bTargetLCM);
EPSON_L5F30363_LCM_AddressRefresh();
for(i=0;i<320;i++)
{
for(j=0;j<240;j++)
{
LCM_WRITE_DAT = *(pu16Buffer + i * 240 + j);
BBP_ShortDelay(_LCM_RW_DELAY_TIME);
}
}
//iMagic_DisableBypass();
}
void EPSON_L5F30363_LCM_AddressRefresh(void)
{
LCM_WriteCmd(0x2C, 0x0000); // Set to the start address
BBP_ShortDelay(_LCM_RW_DELAY_TIME);
}
#endif // #ifdef _LCM_EPSON_L5F30363
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -