📄 lcm_vp_s6b33b2.c.svn-base
字号:
#include "../../INCLUDE/API.h"
#include "lcm.h"
#include "mp321app.h"
//#include "../LCD/Include/utillcd.h"
//=================================================
//This file is for VP_S6B33B2 PANEL MODULE
//
//=================================================
#if (defined(_PRIMARY_LCM_VP_S6B33B2) || defined(_SECONDARY_LCM_VP_S6B33B2))
void S6B33B2_LCM_Init(U8 bTargetLCM)
{
MP321_Release(bTargetLCM);
S6B33B2_LCM_PowerOn();
S6B33B2_LCM_AddressRefresh();
S6B33B2_LCM_DisplayOn();
}
void S6B33B2_LCM_PowerOn(void)
{
unsigned short i ;
// Reset
MC_LCM_RESET_H;
__TIMER_DELAY(100);
MC_LCM_RESET_L;
__TIMER_DELAY(500);
MC_LCM_RESET_H;
__TIMER_DELAY(100);
/////////////////////////////////////////////
LCM_WRITE_ADR = 0x2c; //standby mode off
LCM_WRITE_ADR = 0x02;
LCM_WRITE_ADR = 0x01;
LCM_WRITE_ADR = 0x26;
LCM_WRITE_ADR = 0x01;
__TIMER_DELAY(50);
LCM_WRITE_ADR = 0x26;
LCM_WRITE_ADR = 0x09;
__TIMER_DELAY(50);
LCM_WRITE_ADR = 0x26;
LCM_WRITE_ADR = 0xb;
__TIMER_DELAY(50);
LCM_WRITE_ADR = 0x26;
LCM_WRITE_ADR = 0xf;
__TIMER_DELAY(50);
LCM_WRITE_ADR = 0x28; //Temperature compensation set -0.1%
LCM_WRITE_ADR = 0x01;
LCM_WRITE_ADR = 0x2e;
LCM_WRITE_ADR = 0x45; //set Ram skip area No skip
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x53; //Normal display
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x10; //Driver output mode set
LCM_WRITE_ADR = 0x22;
LCM_WRITE_ADR = 0x24; // fpck = fosc / 16 DCDC clock division set
LCM_WRITE_ADR = 0x22;
LCM_WRITE_ADR = 0x20; // DC-DC setX1.0
LCM_WRITE_ADR = 0x01;
LCM_WRITE_ADR = 0x22; //Bias set 1/4Bias 2nd boosting X3
LCM_WRITE_ADR = 0x02;
LCM_WRITE_ADR = 0x30; //Addressing mode set 65536color different pase by 1pixel-unit,1d,1c
LCM_WRITE_ADR = 0x1c;
LCM_WRITE_ADR = 0x32; //Row vector mode set
LCM_WRITE_ADR = 0x0e;
LCM_WRITE_ADR = 0x40; //Entry mode set Y address conter mode
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x34; //N-block inversion set//by z ,0x0d
LCM_WRITE_ADR = 0x08;
LCM_WRITE_ADR = 0x43; //set Y address start
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x7f; //set Y address stop
LCM_WRITE_ADR = 0x42; //set X address start
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x9f; //set X address stop
LCM_WRITE_ADR = 0x2a; //comtrast //set contrast display mode 0
LCM_WRITE_ADR = 0x9b;
LCM_WRITE_ADR = 0x36; //Frame frequency control low frequency set off
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x55; //set Partial display
LCM_WRITE_ADR = 0x00;
LCM_WRITE_ADR = 0x51;
}
void S6B33B2_LCM_DisplayOn(void)
{
//LCM_WRITE_ADR = 0x29; // DISPLAY ON
}
void S6B33B2_LCM_DisplayOff(void)
{
//LCM_WRITE_ADR = 0x28; // DISPLAY OFF
}
void S6B33B2_LCM_StandbyOn(void)
{
//LCM_WRITE_ADR = 0x10; //set sleep in mode
}
void S6B33B2_LCM_StandbyOff(void)
{
//LCM_WRITE_ADR = 0x11; //Sleep out
//__TIMER_DELAY(10);
//LCM_WRITE_ADR = 0x29; //display on
}
void S6B33B2_LCM_Update(U8 bTargetLCM, U16 *pu16Buffer)
{
unsigned short i,j;
MP321_Release(bTargetLCM);
S6B33B2_LCM_AddressRefresh();
for(i=0;i<160;i++)
{
for(j=0;j<128;j++)
{
LCM_WRITE_DAT= *(pu16Buffer + i * 128 + j);
}
}
//iMagic_DisableBypass();
}
void S6B33B2_LCM_AddressRefresh(void)
{
U8 vl_Left, vl_Right, vl_Top, vl_Bottom;
int vl_Row;
int vl_Col;
//U16* vp_Color;
vl_Top=0;
vl_Bottom=90;
vl_Left=0;
vl_Right=90;
LCM_WRITE_ADR = 0x43;
LCM_WRITE_ADR = vl_Left;
LCM_WRITE_ADR = vl_Right;
LCM_WRITE_ADR = 0x42;
LCM_WRITE_ADR = vl_Top;
LCM_WRITE_ADR = vl_Bottom;
for (vl_Row = vl_Top; vl_Row <= vl_Bottom; vl_Row++)
{
for(vl_Col = vl_Left; vl_Col <= vl_Right; vl_Col++)
{
LCM_WRITE_DAT = 0xF8;
}
}
}
#endif // #ifdef LCM_VP_S6B33B2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -