📄 lcd_reg.h
字号:
//LCD_REG.H
#ifndef LCD_REG_H
#define LCD_REG_H
#include <absacc.h>
#include <reg52.h>
//#include "at89x52.h"
//------------comand-----------------------------
//command Register Set : code D1 D2; function: Cursor pointerset
unsigned char data cmdRegSet = 0;
unsigned char data cmdCtrlWordSet = 0;
unsigned char data cmdModeSet = 0;
unsigned char data cmdDisplayMode = 0;
unsigned char data cmdCPSelect = 0;
unsigned char data cmdDataAutoRW = 0;
unsigned char data cmdDataRW = 0;
unsigned char data cmdScreenPeek = 0;
unsigned char data cmdScreenCopy = 0;
unsigned char data cmdBitSetRst = 0;
//-----------------------------------------
//-----------------code--------------------
//0. Pipe address:
unsigned int code C_ADD = 0x8100;//Code pipe address
unsigned int code D_ADD = 0x8000;//Data pipe address
//1.for command: Register Set
unsigned char code codCPSet = 0x21;//cursor pointer set: [code] [D1:X address] [D2:Y address]
unsigned char code codOffReg = 0x22;//off register: [code] [D1:Data] [D2:00H]
unsigned char code codAddPSet = 0x24;//address pointer set: [code] [D1:Low address] [D2:High address]
//2.for command: Control Word Set
unsigned char code codTxtHAddSet = 0x40;//Text home address set: [code] [D1:Low address] [D2:High address]
unsigned char code codTxtAreaSet = 0x41;//Text area set: [code] [D1:Columns] [D2:00H]
unsigned char code codGraHAddSet = 0x42;//Graphic home address set: [code] [D1:Low address] [D2:High address]
unsigned char code codGraAreaSet = 0x43;//Text area set: [code] [D1:Columns] [D2:00H]
//3.for command: Mode Set
unsigned char code codORMode = 0x80;
unsigned char code codEXORMode = 0x81;
unsigned char code codANDMode = 0x83;
unsigned char code codTxtAMode = 0x84;
unsigned char code codInCGROMMode = 0x87;
unsigned char code codExCGRAMMode = 0x8f;
//4.for command: Display Mode
unsigned char code codDispOff = 0x90;//Display off
unsigned char code codCOnBOff = 0x92;//Cursor on, blink off
unsigned char code codCOnBOn = 0x93;//Cursor on, blink on
unsigned char code codTxtOnGraOff = 0x94;//Text on, graphic off
unsigned char code codTxtOffGraOn = 0x98;//Text off, graphic on
unsigned char code codTxtOnGraOn = 0x9c;//Text on, graphic on
//5.for command: Cursor Pattern Select
unsigned char code cod1LineCursor = 0xa0;//1 line cursor
unsigned char code cod2LineCursor = 0xa1;//2 line cursor
unsigned char code cod3LineCursor = 0xa2;//3 line cursor
unsigned char code cod4LineCursor = 0xa3;//4 line cursor
unsigned char code cod5LineCursor = 0xa4;//5 line cursor
unsigned char code cod6LineCursor = 0xa5;//6 line cursor
unsigned char code cod7LineCursor = 0xa6;//7 line cursor
unsigned char code cod8LineCursor = 0xa7;//8 line cursor
//6.for command: Data Auto Read/Write
unsigned char code codAutoWrite = 0xb0;//data auto write set
unsigned char code codAutoRead = 0xb1;//data auto read set
unsigned char code codAutoReset = 0xb2;//data auto reset
//7.for command: Data Read Write
unsigned char code codDataWnADPI = 0xc0;//Data write and ADP increment
unsigned char code codDataRnADPI = 0xc1;//Data read and ADP increment
unsigned char code codDataWnADPD = 0xc2;//Data write and ADP decrement
unsigned char code codDataRnADPD = 0xc3;//Data read and ADP decrement
unsigned char code codDataWnADPNo = 0xc4;//Data Write and ADP no variable
unsigned char code codDataRnADPNo = 0xc5;//Data read and ADP no variable
//8.for command: Screen peek
unsigned char code codScreenPeek = 0xe0;//Screen peek
//9.for command: Screen copy
unsigned char code codScreenCopy = 0xe8;//Screen copy
//10.for command: Bit Set/Reset
unsigned char code codBitReset = 0xf0;
unsigned char code codBitSet = 0xf8;
unsigned char code codBit0 = 0xf0;//LSB
unsigned char code codBit1 = 0xf1;
unsigned char code codBit2 = 0xf2;
unsigned char code codBit3 = 0xf3;
unsigned char code codBit4 = 0xf4;
unsigned char code codBit5 = 0xf5;
unsigned char code codBit6 = 0xf6;
unsigned char code codBit7 = 0xf7;//MSB
//-----------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -