📄 12232drivers.c
字号:
#include "mylib.h"
uchar dot_buffer[32]; //点阵缓存区
uchar disp_buffer[4]; //ram数据显示缓存区
uchar xdata buf[3];
uchar xdata buf1[3];
//uchar xdata buf2[5];
struct data_gb16 code hz16[] =
{
"拉", 0x10,0x10,0x10,0xFF,0x90,0x50,0x00,0x48,
0x89,0x0A,0x0E,0x08,0xE8,0x48,0x08,0x00,
0x02,0x42,0x81,0x7F,0x00,0x20,0x20,0x20,
0x21,0x3E,0x20,0x3C,0x23,0x20,0x20,0x00,
"标", 0x10,0x10,0xD0,0xFF,0x50,0x90,0x20,0x22,
0x22,0x22,0xE2,0x22,0x22,0x22,0x20,0x00,
0x04,0x03,0x00,0xFF,0x00,0x09,0x04,0x03,
0x40,0x80,0x7F,0x00,0x01,0x06,0x1C,0x00,
"定", 0x00,0x10,0x0C,0xA4,0x24,0x24,0x25,0xE6,
0x24,0x24,0x24,0x24,0x14,0x0C,0x04,0x00,
0x40,0x20,0x18,0x07,0x08,0x10,0x20,0x7F,
0x42,0x42,0x42,0x42,0x40,0x40,0x00,0x00,
"取", 0x02,0x02,0xFE,0x92,0x92,0x92,0xFE,0x02,
0x02,0x7C,0x84,0x04,0x84,0x7C,0x04,0x00,
0x10,0x10,0x0F,0x08,0x08,0x04,0xFF,0x04,
0x22,0x10,0x09,0x06,0x09,0x30,0x10,0x00,
"数", 0x10,0x92,0x54,0x38,0xFF,0x38,0x54,0x52,
0x80,0xF0,0x1F,0x12,0x10,0xF0,0x10,0x00,
0x42,0x42,0x2A,0x2E,0x13,0x1A,0x26,0x02,
0x40,0x20,0x13,0x0C,0x33,0x60,0x20,0x00,
"中", 0x00,0x00,0xFC,0x08,0x08,0x08,0x08,0xFF,
0x08,0x08,0x08,0x08,0xFC,0x08,0x00,0x00,
0x00,0x00,0x07,0x02,0x02,0x02,0x02,0xFF,
0x02,0x02,0x02,0x02,0x07,0x00,0x00,0x00,
"正", 0x00,0x02,0x02,0xC2,0x02,0x02,0x02,0x02,
0xFE,0x82,0x82,0x82,0x82,0x82,0x02,0x00,
0x20,0x20,0x20,0x3F,0x20,0x20,0x20,0x20,
0x3F,0x20,0x20,0x20,0x20,0x20,0x20,0x00,
"在", 0x00,0x04,0x04,0xC4,0x64,0x9C,0x87,0x84,
0x84,0xE4,0x84,0x84,0x84,0x84,0x04,0x00,
0x04,0x02,0x01,0x7F,0x00,0x20,0x20,0x20,
0x20,0x3F,0x20,0x20,0x20,0x20,0x20,0x00,
"请", 0x40,0x42,0x4C,0xC4,0x00,0x22,0xAA,0xAA,
0xAA,0xBF,0xAA,0xAA,0xAA,0x22,0x20,0x00,
0x00,0x00,0x00,0x7F,0x20,0x10,0xFF,0x0A,
0x0A,0x0A,0x4A,0x8A,0x7F,0x00,0x00,0x00,
"稍", 0x00,0x12,0x92,0x72,0xFF,0x51,0x81,0xF2,
0x9C,0x90,0x9F,0x90,0x98,0xF4,0x02,0x00,
0x08,0x06,0x01,0x00,0xFF,0x00,0x00,0xFF,
0x04,0x04,0x04,0x44,0x84,0x7F,0x00,0x00,
"候", 0x40,0x20,0xF8,0x07,0xF2,0x08,0x0A,0xFA,
0x4A,0xCA,0x4A,0x4E,0x4A,0x48,0x08,0x00,
0x00,0x00,0x7F,0x00,0x0F,0x42,0x23,0x12,
0x0E,0x03,0x06,0x1A,0x32,0x62,0x22,0x00,
"汽", 0x10,0x61,0x06,0xF0,0x20,0x58,0x57,0x54,
0x54,0x54,0x54,0xD4,0x14,0x04,0x00,0x00,
0x04,0x04,0xFE,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0x30,0x40,0xF0,0x00,
"车", 0x00,0x04,0x84,0xC4,0xA4,0x9C,0x87,0x84,
0xF4,0x84,0x84,0x84,0x84,0x84,0x00,0x00,
0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
0xFF,0x04,0x04,0x04,0x04,0x04,0x04,0x00,
"制", 0x00,0x50,0x4F,0x4A,0x48,0xFF,0x48,0x48,
0x48,0x00,0xFC,0x00,0x00,0xFF,0x00,0x00,
0x00,0x00,0x3F,0x01,0x01,0xFF,0x21,0x61,
0x3F,0x00,0x0F,0x40,0x80,0x7F,0x00,0x00,
"动", 0x20,0x24,0x24,0xE4,0x24,0x24,0x24,0x20,
0x10,0x10,0xFF,0x10,0x10,0xF0,0x00,0x00,
0x08,0x1C,0x0B,0x08,0x0C,0x05,0x4E,0x24,
0x10,0x0C,0x03,0x20,0x40,0x3F,0x00,0x00,
"踏", 0x00,0x3E,0x22,0xE2,0x22,0x3E,0x84,0x44,
0x34,0x8C,0xFF,0x10,0x28,0xC6,0x44,0x00,
0x20,0x3F,0x20,0x3F,0x11,0x11,0x00,0x7F,
0x49,0x49,0x49,0x49,0x49,0x7F,0x00,0x00,
"板", 0x10,0x10,0xD0,0xFF,0x50,0x90,0x00,0xFE,
0x62,0xA2,0x22,0x21,0xA1,0x61,0x00,0x00,
0x04,0x03,0x00,0x7F,0x00,0x11,0x0E,0x41,
0x20,0x11,0x0A,0x0E,0x31,0x60,0x20,0x00,
"力", 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,
0x10,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,
0x00,0x00,0x80,0x40,0x20,0x18,0x06,0x01,
0x00,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,
"计", 0x20,0x21,0x2E,0xE4,0x00,0x00,0x20,0x20,
0x20,0x20,0xFF,0x20,0x20,0x20,0x20,0x00,
0x00,0x00,0x00,0x7F,0x20,0x10,0x08,0x00,
0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
"系", 0x00,0x00,0x02,0x22,0xB2,0xAA,0x66,0x62,
0x22,0x11,0x4D,0x81,0x01,0x01,0x00,0x00,
0x00,0x40,0x21,0x13,0x09,0x05,0x41,0x81,
0x7F,0x01,0x05,0x09,0x13,0x62,0x00,0x00,
"统", 0x20,0x30,0x2C,0xA3,0x60,0x10,0x84,0xC4,
0xA4,0x9D,0x86,0x84,0xA4,0xC4,0x84,0x00,
0x20,0x22,0x23,0x12,0x12,0x92,0x40,0x30,
0x0F,0x00,0x00,0x3F,0x40,0x41,0x70,0x00,
"初", 0x00,0x08,0x88,0xC9,0x2E,0x98,0x48,0x00,
0x08,0x08,0xF8,0x08,0x08,0xFC,0x08,0x00,
0x02,0x01,0x00,0x7F,0x01,0x02,0x44,0x20,
0x10,0x0C,0x03,0x20,0x40,0x3F,0x00,0x00,
"使", 0x40,0x20,0xF0,0x1C,0x07,0xF2,0x94,0x94,
0x94,0xFF,0x94,0x94,0x94,0xF4,0x04,0x00,
0x00,0x00,0x7F,0x00,0x40,0x41,0x22,0x14,
0x0C,0x13,0x10,0x30,0x20,0x61,0x20,0x00,
"化", 0x80,0x40,0x20,0xF8,0x07,0x02,0x00,0x00,
0xFF,0xC0,0x60,0x30,0x1C,0x08,0x00,0x00,
0x00,0x00,0x00,0x7F,0x00,0x04,0x02,0x01,
0x3F,0x40,0x40,0x40,0x40,0x78,0x00,0x00,
"电", 0x00,0x00,0xF8,0x48,0x48,0x48,0x48,0xFF,
0x48,0x48,0x48,0x48,0xF8,0x00,0x00,0x00,
0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x3F,
0x44,0x44,0x44,0x44,0x4F,0x40,0x70,0x00,
"压", 0x00,0x00,0xFE,0x02,0x42,0x42,0x42,0x42,
0xFA,0x42,0x42,0x42,0x62,0x42,0x02,0x00,
0x20,0x18,0x27,0x20,0x20,0x20,0x20,0x20,
0x3F,0x20,0x21,0x2E,0x24,0x20,0x20,0x00,
"值", 0x80,0x40,0xF0,0x2F,0x02,0x04,0xE4,0xA4,
0xB4,0xAF,0xA6,0xA4,0xE4,0x04,0x00,0x00,
0x00,0x00,0xFF,0x00,0x40,0x40,0x7F,0x4A,
0x4A,0x4A,0x4A,0x4A,0x7F,0x40,0x40,0x00,
"牵", 0x00,0xC0,0x44,0x64,0xE4,0x54,0x4C,0x47,
0xC4,0x4C,0x54,0x64,0x44,0x44,0xC0,0x00,
0x01,0x10,0x14,0x12,0x13,0x12,0x12,0x12,
0xFF,0x12,0x12,0x12,0x12,0x11,0x10,0x00,
"引", 0x00,0x02,0xF2,0x12,0x12,0x12,0x12,0x9E,
0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
0x00,0x01,0x03,0x01,0x01,0x41,0x81,0x7F,
0x01,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,
"力", 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0xFF,
0x10,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,
0x00,0x00,0x80,0x40,0x20,0x18,0x06,0x01,
0x00,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,
"广", 0x00,0x00,0xFC,0x04,0x04,0x04,0x04,0x05,
0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x00,
0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
"州", 0x00,0xE0,0x00,0x00,0xFF,0x20,0xC0,0x00,
0xFE,0x10,0x60,0x80,0x00,0xFF,0x00,0x00,
0x01,0x80,0x60,0x18,0x07,0x00,0x00,0x00,
0x7F,0x00,0x00,0x01,0x00,0xFF,0x00,0x00,
"市", 0x04,0x04,0x04,0xE4,0x24,0x24,0x25,0xFE,
0x24,0x24,0x24,0x24,0xE4,0x04,0x04,0x00,
0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0xFF,
0x00,0x00,0x10,0x20,0x1F,0x00,0x00,0x00,
"福", 0x08,0x08,0x89,0xCE,0x28,0x18,0x02,0x7A,
0x4A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x00,
0x02,0x01,0x00,0xFF,0x01,0x02,0xFF,0x49,
0x49,0x49,0x7F,0x49,0x49,0x49,0xFF,0x00,
"立", 0x00,0x10,0x10,0x90,0x10,0x10,0x11,0x16,
0x10,0x10,0xF0,0x50,0x10,0x10,0x00,0x00,
0x40,0x40,0x40,0x40,0x43,0x4E,0x40,0x60,
0x58,0x47,0x40,0x40,0x40,0x60,0x40,0x00,
"分", 0x80,0x40,0x20,0x98,0x87,0x82,0x80,0x80,
0x83,0x84,0x98,0x30,0x60,0xC0,0x40,0x00,
0x00,0x80,0x40,0x20,0x10,0x0F,0x00,0x00,
0x20,0x40,0x3F,0x00,0x00,0x00,0x00,0x00,
"析", 0x08,0x88,0x68,0xFF,0x48,0x88,0x00,0xFC,
0x24,0x24,0x22,0xE2,0x22,0x22,0x20,0x00,
0x02,0x01,0x00,0xFF,0x00,0x41,0x30,0x0F,
0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
"仪", 0x40,0x20,0xF0,0x0C,0x03,0x00,0x38,0xC0,
0x01,0x0E,0x04,0xE0,0x1C,0x00,0x00,0x00,
0x00,0x00,0xFF,0x00,0x40,0x40,0x20,0x10,
0x0B,0x04,0x0B,0x10,0x20,0x60,0x20,0x00,
"器", 0x40,0x40,0x4F,0x49,0x49,0xC9,0xCF,0x70,
0xC0,0xCF,0x49,0x59,0x69,0x4F,0x00,0x00,
0x02,0x02,0x7E,0x45,0x45,0x44,0x7C,0x00,
0x7C,0x44,0x45,0x45,0x7E,0x06,0x02,0x00,
"有", 0x00,0x04,0x84,0x44,0xE4,0x34,0x2C,0x27,
0x24,0x24,0x24,0xE4,0x04,0x04,0x04,0x00,
0x02,0x01,0x00,0x00,0xFF,0x09,0x09,0x09,
0x29,0x49,0xC9,0x7F,0x00,0x00,0x00,0x00,
"限", 0xFE,0x02,0x32,0x4E,0x82,0x00,0xFE,0x4A,
0xCA,0x4A,0x4A,0x4A,0x7E,0x00,0x00,0x00,
0xFF,0x00,0x02,0x04,0x03,0x00,0xFF,0x40,
0x20,0x03,0x0C,0x12,0x21,0x60,0x20,0x00,
"公", 0x00,0x00,0x80,0x40,0x30,0x0E,0x84,0x00,
0x00,0x0E,0x10,0x60,0xC0,0x80,0x80,0x00,
0x00,0x01,0x20,0x70,0x28,0x24,0x23,0x31,
0x10,0x10,0x14,0x78,0x30,0x01,0x00,0x00,
"司", 0x00,0x10,0x92,0x92,0x92,0x92,0x92,0x92,
0x92,0x92,0x12,0x02,0x02,0xFE,0x00,0x00,
0x00,0x00,0x1F,0x04,0x04,0x04,0x04,0x04,
0x04,0x0F,0x00,0x20,0x40,0x3F,0x00,0x00
};
void send_mi(uchar instruction)
{
clr_E2(); //关S
set_E1(); //开M
wait_ready();
clr_A0(); //指令
clr_WR(); //写触发
NOP();
lcd_data = instruction; //指令码
NOP();
clr_E1(); //关M
}
void send_md(uchar c)
{
clr_E2(); //关S
set_E1(); //开M
wait_ready();
set_A0(); //数据
clr_WR(); //写触发
NOP();
lcd_data = c; //数据
NOP();
clr_E1(); //关M
}
void send_si(uchar instruction)
{
clr_E1(); //关M
set_E2(); //开S
wait_ready();
clr_A0(); //指令
clr_WR(); //写触发
NOP();
lcd_data=instruction; //指令码
NOP();
clr_E2(); //关S
}
void send_sd(uchar c)
{
clr_E1();
set_E2();
wait_ready();
set_A0(); //数据
clr_WR(); //写触发
lcd_data = c;
NOP();
clr_E2();
}
//等待ready:等待LCD内部操作完成
void wait_ready(void)
{
// DDRA = 0x00; //PA口输入
clr_A0(); //指令
set_WR(); //读
NOP();
while(lcd_data & status_busy); //读入LCD状态,1=忙,一直等待LCD内部操作完成
// DDRA = 0xff; //重新置PA口输出
}
//122x32LCD初始化,开机后仅调用一次
void lcd_init(void)
{
send_mi(reset); //复位m-left,s-right
send_si(reset);
send_mi(disp_off); //关闭显示
send_si(disp_off);
send_mi(dynamic_driver); //动态驱动
send_si(dynamic_driver);
send_mi(clk32); //1/32占空比
send_si(clk32);
send_mi(adc_select); //clockwise
send_si(adc_select);
send_mi(mode_write); //写模式
send_si(mode_write);
send_mi(col_addr_set);
send_mi(disp_start_line); //归回零列,设定显示起始行首
send_si(col_addr_set);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -