📄 st7626_inintal.c
字号:
void Init()
{
//-----------------------------------------------------------------------------------//
//---------------------------------ST7626 Initial Code-------------------------------//
//--------------------------------Date/Time : 2008-2-20 -----------------------------//
//---------------------------------Interface : 80-8bit-------------------------------//
//-----------------------------------------------------------------------------------//
RST=0; // Hardware Reset
delay(10); // Delay 50mS
RST=1;
delay(20);
LCD_Cm_Write(0x31); // Ext = 1
LCD_Cm_Write(0xF4); // Internal Initialize Preparation
LCD_Da_Write(0x58); // Internal Initialize Sequencing
LCD_Cm_Write(0x30); // Ext = 0
LCD_Cm_Write(0x04); // Sleep In/Out Preparation
LCD_Da_Write(0x3E); // 3E--Ready for sleep out 3F--sleep in
LCD_Cm_Write(0x31); // Ext = 1
LCD_Cm_Write(0xF4); // Internal Initialize Preparation
LCD_Da_Write(0x58); // Internal Initialize Sequencing
LCD_Cm_Write(0x30); // Ext = 0
LCD_Cm_Write(0x94); // Sleep Out
LCD_Cm_Write(0xd1); // Internal OSC on
LCD_Cm_Write(0xca); // Display control
LCD_Da_Write(0x00); // CL dividing ratio (00--no divide)
LCD_Da_Write(0x10); // Drive duty (= 68)
LCD_Da_Write(0x00); // FR inverse-set value ( N-line ) ( 00 10 2f 33)
LCD_Cm_Write(0x31); // Ext = 1
LCD_Cm_Write(0x32); // Analog Setting
LCD_Da_Write(0x00); // OSC Freqency adjustment (00--5.39 07--10.02)
LCD_Da_Write(0x01); // Booster Efficiency Setting is level3
LCD_Da_Write(0x01); // Bias Setting (03-1/9 00-1/12 01--11 07--1/5)
LCD_Da_Write(0x04); // Booster is X5 (00--X1 04--X5) VDD-3.0V
LCD_Cm_Write(0x30); // Ext = 0
LCD_Cm_Write(0x81); // Electronic Volume Control (VDD=3.0V)
LCD_Da_Write(0x3b); // EV:Vop[5:0]_6bit (02+3b=bb ==>11.08V)
LCD_Da_Write(0x02); // EV:Vop[8:6]_3bit (02+37=b7 ==>10.92V)
LCD_Cm_Write(0x20); // Power Control
LCD_Da_Write(0x0b); // B/F/R = On/On/On
delay(20);
//-----------------------------------load EEPROM--------------------------------//
// LCD_Cm_Write(0x07); // EEPROM Function Start
// LCD_Da_Write(0x19); //
LCD_Cm_Write(0x31); // Ext = 1
LCD_Cm_Write(0xcd); // Enable EEPROM
LCD_Da_Write(0x00); // 00--The Read Enable of EEPROM will be opened.
// 20--The Write Enable of EEPROM will be opened
delay(20);
LCD_Cm_Write(0xfd); // Load EEPROM Read data from EEPROM (FC--WRITE DATA)
delay(20);
LCD_Cm_Write(0xcc); // Disable EEPROM
LCD_Cm_Write(0x30); // Ext = 0
//------------------------------//---------------------------//
LCD_Cm_Write(0x30); // Ext = 0
LCD_Cm_Write(0xa7); // a6--Normal display a7--Inverse Display
LCD_Cm_Write(0xbb); // Com Scan Direction
LCD_Da_Write(0x00); // 0~33 / 34~67
LCD_Cm_Write(0xbc); // Data Scan Direction
LCD_Da_Write(0x02); // Page / Column Address Setting(Normal/inverse/Address-scan direction)
LCD_Da_Write(0x01); // RGB arrangement (00:RGB 01:BGR)
LCD_Da_Write(0x01); // Gray-scale setup ( 64-gray 65K)
LCD_Cm_Write(0x75); // Page address set
LCD_Da_Write(0x00); // From page address 0
LCD_Da_Write(0x42); // to page address 66
LCD_Cm_Write(0x15); // Column address set
LCD_Da_Write(0x00); // From column address 0
LCD_Da_Write(0x61); // to column address 97
LCD_Cm_Write(0xaf); // Display On
LCD_Cm_Write(0x30); // Ext = 0
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -