初始代码:
#define UC1697_NOP 0xE3
#define UC1697_RST 0xE2
#define UC1697_PUMP 0x2F // internal volt up
#define UC1697_COL_L 0x0 // & 0xf
#define UC1697_COL_H 0x10 // & 0xf
#define UC1697_ROW_L 0x60 // & 0xf
#define UC1697_ROW_H 0x70 // & 0x7
#define UC1697_STAT 0xA8 // & 0x7 [Green Enhance] [Gray mode] [sleep] => 1 1 1 = 0xAF
#define UC1697_ON 0xAF
#define UC1697_SLEEP 0xAE
#define UC1697_ALLON 0xA5
#define UC1697_NO_ALLON 0xA4
#define UC1697_INV 0xA7
#define UC1697_NO_INV 0xA6
#define UC1697_SCAN 0x88 // & 0x7 [2][1][0] [0]行列到边是否WARP [1]行ROW列COL进位那个优先(0-列,1-行) [2]行ROW进位的方向
#define UC1697_MAPPING 0xC0 // & 0x7 [MY LC2] [MX LC1] [ICON LC0]
#define UC1697_PATTERN 0xD0 // & 0x1 1- RGB 0- BGR
#define UC1697_COLOR_MODE 0xD4 // [H] [L] 00-RGB 332 01- RGB 444 10- RGB 565 0xD6=565
#define UC1697_BIAS 0xE8 // &7 000-6 001-10 010-11 011-12 100-9
#define UC1697_ROWEND 0xF1 // + 1 byte & 0x7F
#define UC1697_COL_START 0xF4 // + 1byte & 0x7f
#define UC1697_COL_END 0xF6 // + 1byte & 0x7f
#define UC1697_ROW_START 0xF5 // + 1byte & 0x7f
#define UC1697_ROW_END 0xF7 // + 1byte & 0x7f
#define UC1697_INSIDE 0xF8 // DRAW WITHIN WINDOW
#define UC1697_VOLT 0x81 // + 1byte & 0xFF
const u16 UC1697_INIT_CODE[] = //LCD的初始化指令,具体含义写在后面 00xx CMD 01XX Dat 02XX delay
{
UC1697_RST,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,UC1697_NOP,
0x02ff,// soft reset
UC1697_PUMP , //2F
UC1697_VOLT,0xAA, //81
UC1697_PATTERN+1, //D0+1 RGB
UC1697_COLOR_MODE+2, //D4+2 565
UC1697_BIAS+1 ,//E8+1
// UC1697_SCAN|01, //88|5
// UC1697_MAPPING|0x6, // C0+6
0x2B, //Set Panel Loading
0x24, //Set Temp. Compensation
0xC0, //SCAN
0xA1, //Set Line Rate A0-A3
// 0x83, 0x27, //set the 4/8 Gray-shade
// 0x84, //Partial Display
// 0xC8,0x10, //Set N-Line Inversion
// 0xDA, //Set COM Scan Function
// 0xF4,0x25, //UC1697_COL_START
// 0xF6,0x5A, //UC1697_ROW_START
// 0xF5,0x0,//UC1697_COL_END
// 0xF7,0x9F, //UC1697_ROW_END
// 0xF8,//UC1697_INSIDE
// UC1697_SCAN+1, // AC =-
// 0x40,0x50, //SCROLL
// 0x90,0x0,//Set Fixed Lines
// 0x84, //Partial Display
// 0xF1,0x9F, //UC1697_ROWEND
// 0xF2,0,//Set Partial Display Start
// 0xF3,159,//Set Partial Display Start
UC1697_NO_ALLON,// 0xA4
UC1697_NO_INV, // 0xA6
UC1697_ON, //AF
};
|