📄 lcd.h
字号:
/*******************************
???? : T6963INIT.H
??? : ???
???? : 2004-11-1
*******************************/
//-----------------------------------------------------------------------------
// LCD?????
#define LCD_CHARACTER_WIDTH 0x08 /* Is character 8x8 or 6x8 (0x08 / 0x06) */
#define LCD_TEXT_HOME 0x0000 /* Graphics Area + Text Attribute Size (same size as text size) */
#define LCD_TEXT_AREA 0x1E /* Text line is 30 chars wide */
#define LCD_TEXT_SIZE 0x01E0 /* Size of text RAM */ /* into 2 screens */
/* Define the Memory Map */
#define LCD_GRAPHICS_HOME 0x01E0 /* This will usually be at the start of RAM */
#define LCD_GRAPHICS_AREA 0x1E //MODIFY
#define LCD_GRAPHICS_SIZE 0x0F00
/* Memory Map for 240x128 pixel display */
/* This display is made up of two screens */
/* Both 240x64 pixels */
/* Screen 1 */
/* 0x0000 ----------------------------- */
/* | Graphic RAM Area | */
/* | 0x0000 to 0x07FF | */
/* | (256x64 pixels) | */
/* 0x0800 ----------------------------- */
/* | Text Attribute Area | */
/* 0x0A00 ----------------------------- */
/* | Text RAM Area | */
/* | 512 Bytes | */
/* | (256x64 pixels) | */
/* 0x0C00 ----------------------------- */
/* Screen 2 (Automatically derived from Screen 1) */
/* 0x8000 ----------------------------- */
/* | Graphic RAM Area | */
/* | 0x0000 to 0x07FF | */
/* | (256x64 pixels) | */
/* 0x8800 ----------------------------- */
/* | Text Attribute Area | */
/* 0x8A00 ----------------------------- */
/* | Text RAM Area | */
/* | 512 Bytes | */
/* | (256x64 pixels) | */
/* 0x8C00 ----------------------------- */
/* LCD Data Bus Pins */
#define LCD_DATA_BUS P7
#define LCD_DATA_BUS_TRIS P7MDOUT
/* LCD Control Pins */
//#define LCD_CONTROL P2
#define LCD_CONTROL P4
//#define LCD_CONTROL_TRIS P2MDOUT
#define LCD_CONTROL_TRIS P4MDOUT
#define LCD_WR_BIT 0x07
#define LCD_RD_BIT 0x06
#define LCD_CE_BIT 0x02
#define LCD_CD_BIT 0x03
#define LCD_RST_BIT 0x04
//#define LCD_RST P1
//#define LCD_RST_BIT P1MDOUT
#define LCD_WR 0x80
#define LCD_RD 0x40
#define LCD_CE 0x04
#define LCD_CD 0x08
#define LCD_RST 0x10
/* Control Word Definitions */
#define LCD_CURSOR_POINTER_SET 0x21
#define LCD_OFFSET_REGISTER_SET 0x22
#define LCD_ADDRESS_POINTER_SET 0x24
#define LCD_TEXT_HOME_ADDRESS_SET 0x40
#define LCD_TEXT_AREA_SET 0x41
#define LCD_GRAPHIC_HOME_ADDRESS_SET 0x42
#define LCD_GRAPHIC_AREA_SET 0x43
#define LCD_CG_ROM_MODE_OR 0x80
#define LCD_CG_ROM_MODE_EXOR 0x81
#define LCD_CG_ROM_MODE_AND 0x83
#define LCD_CG_ROM_MODE_TEXT 0x84
#define LCD_CG_RAM_MODE_OR 0x88
#define LCD_CG_RAM_MODE_EXOR 0x89
#define LCD_CG_RAM_MODE_AND 0x8B
#define LCD_CG_RAM_MODE_TEXT 0x8C
/* 1001 0000 is all off, OR together for ON modes */
#define LCD_DISPLAY_MODES_ALL_OFF 0x90
#define LCD_DISPLAY_MODES_GRAPHICS_ON 0x98
#define LCD_DISPLAY_MODES_TEXT_ON 0x94
#define LCD_DISPLAY_MODES_CURSOR_ON 0x92
#define LCD_DISPLAY_MODES_CURSOR_BLINK 0x91
/* Cursor Pattern Select */
#define LCD_CURSOR_PATTERN_UNDERLINE 0xA0
#define LCD_CURSOR_PATTERN_BLOCK 0xA7
/* Send Auto_XX Command, then block of data, then Auto_reset */
#define LCD_DATA_AUTO_WRITE_SET 0xB0
#define LCD_DATA_AUTO_READ_SET 0xB1
#define LCD_DATA_AUTO_RESET 0xB2
/* Send R/W Then one byte Data */
#define LCD_DATA_WRITE_AUTO_INCREMENT 0xC0
#define LCD_DATA_READ_AUTO_INCREMENT 0xC1
#define LCD_DATA_WRITE_NO_INCREMENT 0xC4
#define LCD_DATA_READ_NO_INCREMENT 0xC5
/* Status Register Bits */
#define LCD_STATUS_BUSY1 0x01
#define LCD_STATUS_BUSY2 0x02
#define LCD_STATUS_DARRDY 0x04
#define LCD_STATUS_DAWRDY 0x08
#define LCD_STATUS_CLR 0x20
#define LCD_STATUS_ERR 0x40
#define LCD_STATUS_BLINK 0x80
/* Definitions */
//#define ALL_INPUTS 0x3F
//#define ALL_OUTPUTS 0xC0
#define ALL_INPUTS 0x0
#define ALL_OUTPUTS 0xFF
#define size sizeof(HANZIKU)/sizeof(HANZIKU[0])
//void STA_RST(void);
//unsigned char LCD_Read_Status(void);
struct CNode{ //???????????
char ch[2];//??????
unsigned char dat[32];//????????
};
struct CNode code HANZIKU[]=
{
{"欢",
0x00,0x80,0x00,0x80,0xFC,0x80,0x05,0xFE,0x85,0x04,0x4A,0x48,0x28,0x40,0x10,0x40,
0x18,0x40,0x18,0x60,0x24,0xA0,0x24,0x90,0x41,0x18,0x86,0x0E,0x38,0x04,0x00,0x00,
},
{"迎",
0x40,0x00,0x21,0x80,0x36,0x7C,0x24,0x44,0x04,0x44,0x04,0x44,0xE4,0x44,0x24,0x44,
0x25,0x44,0x26,0x54,0x24,0x48,0x20,0x40,0x20,0x40,0x50,0x00,0x8F,0xFE,0x00,0x00,
},
{"进",
0x01,0x10,0x41,0x10,0x21,0x10,0x37,0xFC,0x21,0x10,0x01,0x10,0x01,0x10,0xF7,0xFE,
0x11,0x10,0x11,0x10,0x12,0x10,0x12,0x10,0x14,0x10,0x28,0x00,0x47,0xFE,0x00,0x00,
},
{"入",
0x0C,0x00,0x06,0x00,0x02,0x00,0x01,0x00,0x03,0x00,0x02,0x80,0x02,0x80,0x04,0x40,
0x04,0x20,0x08,0x20,0x08,0x10,0x10,0x08,0x20,0x0E,0x40,0x04,0x80,0x00,0x00,0x00,
},
{"片",
0x00,0x40,0x10,0x40,0x10,0x40,0x10,0x44,0x1F,0xFE,0x10,0x00,0x10,0x00,0x10,0x00,
0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x20,0x10,0x40,0x10,0x80,0x10,
},
{"上",
0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0xF8,0x01,0x00,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x04,0x7F,0xFE,0x00,0x00,
},
{"采",
0x00,0x00,0x01,0xF8,0x7E,0x00,0x00,0x10,0x11,0x10,0x08,0xA0,0x01,0x00,0x7F,0xFE,
0x01,0x80,0x03,0x40,0x05,0x20,0x09,0x18,0x31,0x0E,0xC1,0x04,0x01,0x00,0x01,0x00,
},
{"集",
0x08,0x80,0x08,0x40,0x1F,0xF8,0x30,0x80,0x5F,0xF8,0x10,0x80,0x1F,0xF8,0x10,0x80,
0x1F,0xFC,0x01,0x00,0x7F,0xFE,0x03,0x40,0x05,0x20,0x19,0x1C,0x61,0x08,0x01,0x00,
},
{"系",
0x00,0x7C,0x3F,0x80,0x02,0x20,0x04,0x20,0x08,0x40,0x1F,0x80,0x03,0x20,0x0C,0x10,
0x3F,0xF8,0x10,0x8C,0x04,0xA0,0x08,0x90,0x10,0x88,0x20,0x84,0x42,0x84,0x01,0x00,
},
{"统",
0x10,0x40,0x10,0x20,0x23,0xFE,0x20,0x40,0x44,0x40,0xF8,0x88,0x09,0x04,0x13,0xFE,
0x20,0x94,0x7C,0x90,0x00,0x90,0x00,0x90,0x1D,0x12,0xE1,0x12,0x02,0x0E,0x04,0x00,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -