【51单片机快速入门指南】5.3:SPI控制晶联讯JLX12864G_08602 LCD屏幕

目录

  • 示例程序
    • JLX12864G_08602.c
    • JLX12864G_08602.h
    • JLX12864G_08602_Font.c
    • JLX12864G_08602_Font.h
    • 测试程序
      • main.c
      • 效果

STC12LE5A60S2 12MHz
Keil uVision V5.29.0.0
PK51 Prof.Developers Kit Version:9.60.0.0


示例程序

       stdint.h见【51单片机快速入门指南】1:基础知识和工程创建
       软件SPI程序见【51单片机快速入门指南】5:软件SPI
       SPI选择模式0。

       本例中所用单片机为STC12LE5A60S2 12MHz,屏幕部分接线如下,为了控制背光,LEDA由IO推挽控制,若要常亮,LEDA则可接到VCC。

1 P0.6 CS
2 P0.7 RST
3 P4.6 RS
4 P4.5 SDA
5 P4.4 SCK
6 3V3
7 GND
8 P2.5 LEDA

       根据接线情况修改Software_SPI.h
【51单片机快速入门指南】5.3:SPI控制晶联讯JLX12864G_08602 LCD屏幕_第1张图片

JLX12864G_08602.c

/*
 * JLX12864G_08602.c
 *
 *  Created on: Apr 26, 2021
 *      Author: Royic
 */

#include "./Software_SPI/Software_SPI.h"
#include "JLX12864G_08602.h"
#include "JLX12864G_08602_Font.h"

/*写指令到 LCD 模块*/
void transfer_command(uint8_t data1)
{
     
	JLX12864_CS_L;
	JLX12864_RS_L;
	SOFT_SPI_RW_MODE0(data1);
	JLX12864_CS_H;
}

/*写数据到 LCD 模块*/
void transfer_data(uint8_t data1)
{
     
	JLX12864_CS_L;
	JLX12864_RS_H;
	SOFT_SPI_RW_MODE0(data1);
	JLX12864_CS_H;
}

void lcd_address(uint8_t page, uint8_t column)
{
     
	column = column - 1; //我们平常所说的第 1 列,在 LCD 驱动 IC 里是第 0 列。所以在这里减去 1.
	page = page - 1;
	transfer_command(0xb0 + page); //设置页地址。每页是 8 行。一个画面的 64 行被分成 8 个页。我们平常所说的第 1 页,在 LCD驱动 IC 里是第 0 页,所以在这里减去 1*/
	transfer_command(((column >> 4) & 0x0f) + 0x10); //设置列地址的高 4 位
	transfer_command(column & 0x0f); //设置列地址的低 4 位
}

/*全屏清屏*/
void clear_screen(void)
{
     
	uint8_t i, j;
	for (i = 0; i < 9; i++)
	{
     
		lcd_address(i + 1, 1);
		for (j = 0; j < 132; j++)
		{
     
			transfer_data(0x00);
		}
	}
}

/*LCD 模块初始化*/
void initial_lcd(void)
{
     
	JLX12864_RST_L; /*低电平复位*/
	JLX12864_Delay_ms(100);
	JLX12864_RST_H; /*复位完毕*/
	JLX12864_Delay_ms(100);
	transfer_command(0xe2); /*软复位*/
	JLX12864_Delay_ms(5);
	transfer_command(0x2c); /*升压步骤 1*/
	JLX12864_Delay_ms(5);
	transfer_command(0x2e); /*升压步骤 2*/
	JLX12864_Delay_ms(5);
	transfer_command(0x2f); /*升压步骤 3*/
	JLX12864_Delay_ms(5);
	transfer_command(0x23); /*粗调对比度,可设置范围 0x20~0x27*/
	transfer_command(0x81); /*微调对比度*/
	transfer_command(0x28); /*0x1a,微调对比度的值,可设置范围 0x00~0x3f*/
	transfer_command(0xa2); /*1/9 偏压比(bias)*/
	transfer_command(0xc8); /*行扫描顺序:从上到下*/
	transfer_command(0xa0); /*列扫描顺序:从左到右*/
	transfer_command(0x40); /*起始行:第一行开始*/
	transfer_command(0xaf); /*开显示*/
	clear_screen();
}

//==================display a piture of 128*64 dots================
void full_display()
{
     
	uint8_t i, j;
	for (i = 0; i < 8; i++)
	{
     
		lcd_address(i + 1, 0);
		for (j = 0; j < 128; j++)
		{
     
			transfer_data(0xff);
		}
	}
}

//显示 128x64 点阵图像
void display_128x64(uint8_t *dp)
{
     
	uint8_t i, j;

	for (j = 0; j < 8; j++)
	{
     
		lcd_address(j + 1, 1);
		for (i = 0; i < 128; i++)
		{
     
			transfer_data(*dp); //写数据到 LCD,每写完一个 8 位的数据后列地址自动加 1
			dp++;
		}
	}
}

/*显示 32x32 点阵图像、汉字、生僻字或 32x32 点阵的其他图标*/
void display_graphic_32x32(uint8_t page, uint8_t column, uint8_t *dp)
{
     
	uint8_t i, j;
	for (j = 0; j < 4; j++)
	{
     
		lcd_address(page + j, column);
		for (i = 0; i < 31; i++)
		{
     
			transfer_data(*dp); /*写数据到 LCD,每写完一个 8 位的数据后列地址自动加 1*/
			dp++;
		}
	}
}

/*显示 16x16 点阵图像、汉字、生僻字或 16x16 点阵的其他图标*/
void display_graphic_16x16(uint8_t page, uint8_t column, uint8_t *dp)
{
     
	uint8_t i, j;
	for (j = 0; j < 2; j++)
	{
     
		lcd_address(page + j, column);
		for (i = 0; i < 16; i++)
		{
     
			transfer_data(*dp); /*写数据到 LCD,每写完一个 8 位的数据后列地址自动加 1*/
			dp++;
		}
	}
}

/*显示 8x16 点阵图像、ASCII, 或 8x16 点阵的自造字符、其他图标*/
void display_graphic_8x16(uint8_t page, uint8_t column, uint8_t *dp)
{
     
	uint8_t i, j;
	for (j = 0; j < 2; j++)
	{
     
		lcd_address(page + j, column);
		for (i = 0; i < 8; i++)
		{
     
			transfer_data(*dp); /*写数据到 LCD,每写完一个 8 位的数据后列地址自动加 1*/
			dp++;
		}
	}
}

void display_string_8x16(uint8_t page, uint8_t column, uint8_t *text)
{
     
	uint8_t i = 0, j, k, n;
	while (text[i] > 0x00)
	{
     
		if ((text[i] >= 0x20) && (text[i] <= 0x7e))
		{
     
			j = text[i] - 0x20;
			for (n = 0; n < 2; n++)
			{
     
				lcd_address(page + n, column);
				for (k = 0; k < 8; k++)
				{
     
					transfer_data(ascii_table_8x16[j][k + 8 * n]);/*显示 5x7 的 ASCII 字到 LCD 上,y 为页地址,x 为列地址,最后为数据*/
				}
			}
			i++;
			column += 8;

		}
		else
			i++;
	}
}

void display_string_5x8(uint8_t page, uint8_t column, uint8_t *text)
{
     
	uint8_t i = 0, j, k;
	while (text[i] > 0x00)
	{
     
		if ((text[i] >= 0x20) && (text[i] < 0x7e))
		{
     
			j = text[i] - 0x20;
			lcd_address(page, column);
			for (k = 0; k < 5; k++)
			{
     
				transfer_data(ascii_table_5x8[j][k]);/*显示 5x8 的 ASCII 字到 LCD 上,y 为页地址,x 为列地址,最后为数据*/
			}
			i++;
			column += 6;
		}
		else
			i++;
	}
}

void JLX12864G_08602_Test(void)
{
     
	clear_screen(); //clear all dots
	display_128x64(bmp1);
	JLX12864_Delay_ms(2000);

	clear_screen(); //clear all dots
	display_graphic_32x32(1, 1, cheng1); /*在第 1 页,第 49 列显示单个汉字"成"*/
	JLX12864_Delay_ms(2000);

	clear_screen(); //clear all dots
	display_graphic_16x16(5, 1, zhuang1); /*在第 5 页,第 1 列显示单个汉字"状"*/
	display_graphic_16x16(5, (1 + 16), tai1); /*在第 5 页,第 17 列显示单个汉字"态"*/
	display_graphic_8x16(5, (1 + 16 * 2), mao_hao); /*在第 5 页,第 25 列显示单个字符":"*/
	display_graphic_16x16(5, (1 + 16 * 2 + 8), shi1); /*在第 5 页,第 41 列显示单个汉字"使"*/
	display_graphic_16x16(5, (1 + 16 * 3 + 8), yong1); /*在第 5 页,第 49 列显示单个汉字"用"*/
	display_graphic_8x16(5, (89), num0); /*在第 5 页,第 89 列显示单个数字"0"*/
	display_graphic_8x16(5, (89 + 8 * 1), num0); /*在第 5 页,第 97 列显示单个数字"0"*/
	display_graphic_8x16(5, (89 + 8 * 2), mao_hao); /*在第 5 页,第 105 列显示单个字符":"*/
	display_graphic_8x16(5, (89 + 8 * 3), num0); /*在第 5 页,第 113 列显示单个数字"0"*/
	display_graphic_8x16(5, (89 + 8 * 4), num0); /*在第 5 页,第 121 列显示单个数字"0"*/
	JLX12864_Delay_ms(2000);

	clear_screen();
	display_string_8x16(1, 1, "0123456789abcdef");/*在第 1 页,第 1 列显示字符串*/
	display_string_8x16(3, 1, "~`!@#$%^&*()_-+=");/*在第*页,第*列显示字符串*/
	display_string_5x8(5, 1, " ! #$%&'()*+,-./01234");
	display_string_5x8(6, 1, "56789:;<=>?@ABCDEFGHI");
	display_string_5x8(7, 1, "JKLMNOPQRSTUVWXYZ[\]^");
	display_string_5x8(8, 1, "_`abcdefghijklmnopqrs");
	JLX12864_Delay_ms(2000);
}

JLX12864G_08602.h

/*
 * JLX12864G_08602.h
 *
 *  Created on: Apr 26, 2021
 *      Author: Royic
 */

#ifndef JLX12864G_08602_JLX12864G_08602_H_
#define JLX12864G_08602_JLX12864G_08602_H_

/* 包含头文件 ----------------------------------------------------------------*/
#include "stdint.h"
#include 

void Delay_ms(int i);

#define JLX12864_Delay_ms(n)   Delay_ms(n)

/* 类型定义 --------------------------------------------------------------*/
#define JLX12864_CS_H          P06=1 // 输出高电平
#define JLX12864_CS_L          P06=0 // 输出低电平
#define JLX12864_RST_H         P07=1 // 输出高电平
#define JLX12864_RST_L         P07=0 // 输出低电平
#define JLX12864_RS_H          P46=1 // 输出高电平
#define JLX12864_RS_L          P46=0 // 输出低电平

/* 宏定义 --------------------------------------------------------------------*/

/* 扩展变量 ------------------------------------------------------------------*/
/* 函数声明 ------------------------------------------------------------------*/
void initial_lcd(void);
void clear_screen(void);
void full_display();
void display_128x64(uint8_t *dp);
void display_graphic_32x32(uint8_t page, uint8_t column, uint8_t *dp);
void display_graphic_16x16(uint8_t page, uint8_t column, uint8_t *dp);
void display_graphic_8x16(uint8_t page, uint8_t column, uint8_t *dp);
void display_string_8x16(uint8_t page, uint8_t column, uint8_t *text);
void display_string_5x8(uint8_t page, uint8_t column, uint8_t *text);

void JLX12864G_08602_Test(void);

#endif /* JLX12864G_08602_JLX12864G_08602_H_ */

JLX12864G_08602_Font.c

/*
 * JLX12864G_08602_Font.c
 *
 *  Created on: Apr 26, 2021
 *      Author: Royic
 */
#include "stdint.h"

int8_t code cheng1[] =
{
     
    /*-- 文字: 成 --*/
    /*-- 宋体 23; 此字体下对应的点阵为:宽 x 高=31x31 --*/
    /*-- 高度不是 8 的倍数,现调整为:宽度 x 高度=32x32 --*/
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x0C, 0xFC, 0xFC, 0x88, 0x00, 0x00, 0x1C, 0x78, 0xF0, 0xE0,
    0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
    0xFF, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0xC3, 0xC3, 0x03, 0x1F, 0xFF,
    0xFF, 0x83, 0x03, 0x03, 0x03, 0xC3, 0xF3, 0xF3, 0x63, 0x03, 0x03, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x3F, 0x00, 0x80, 0x00, 0x00,
    0x80, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x03, 0x9F, 0xFF, 0xF8, 0xF8, 0xBE,
    0x1F, 0x07, 0x01, 0x00, 0x00, 0xE0, 0x20, 0x00, 0x00, 0x20, 0x38, 0x1F,
    0x07, 0x01, 0x00, 0x00, 0x01, 0x01, 0x07, 0x07, 0x23, 0x31, 0x18, 0x0C,
    0x0E, 0x07, 0x03, 0x01, 0x01, 0x01, 0x03, 0x07, 0x0F, 0x0E, 0x1C, 0x1F,
    0x3F, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00
};

int8_t code zhuang1[] =
{
     
    /*-- 文字: 状 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=16x16 --*/
    0x08, 0x30, 0x00, 0xFF, 0x20, 0x20, 0x20, 0x20, 0xFF, 0x20, 0xE1, 0x26, 0x2C,
    0x20, 0x20, 0x00, 0x04, 0x02, 0x01, 0xFF, 0x40, 0x20, 0x18, 0x07, 0x00,
    0x00, 0x03, 0x0C, 0x30, 0x60, 0x20, 0x00
};

int8_t code tai1[] =
{
     
    /*-- 文字: 态 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=16x16 --*/
    0x00, 0x04, 0x04, 0x04, 0x84, 0x44, 0x34, 0x4F, 0x94, 0x24, 0x44, 0x84, 0x84,
    0x04, 0x00, 0x00, 0x00, 0x60, 0x39, 0x01, 0x00, 0x3C, 0x40, 0x42, 0x4C,
    0x40, 0x40, 0x70, 0x04, 0x09, 0x31, 0x00
};

int8_t code shi1[] =
{
     
    /*-- 文字: 使 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=16x16 --*/
    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
};

int8_t code yong1[] =
{
     
    /*-- 文字: 用 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=16x16 --*/
    0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0xFE, 0x22, 0x22, 0x22, 0x22,
    0xFE, 0x00, 0x00, 0x80, 0x40, 0x30, 0x0F, 0x02, 0x02, 0x02, 0x02, 0xFF,
    0x02, 0x02, 0x42, 0x82, 0x7F, 0x00, 0x00
};

int8_t code mao_hao[] =
{
     
    /*-- 文字: : (冒号) --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30,
    0x00, 0x00, 0x00
};

int8_t code num0[]=
{
     
    /*-- 文字: 0 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00
};

int8_t code num1[]=
{
     
    /*-- 文字: 1 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00
};

int8_t code num2[]=
{
     
    /*-- 文字: 2 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00
};

int8_t code num3[]=
{
     
    /*-- 文字: 3 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00
};

int8_t code num4[]=
{
     
    /*-- 文字: 4 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00
};

int8_t code num5[]=
{
     
    /*-- 文字: 5 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00
};

int8_t code num6[]=
{
     
    /*-- 文字: 6 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00
};

int8_t code num7[]=
{
     
    /*-- 文字: 7 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00
};

int8_t code num8[]=
{
     
    /*-- 文字: 8 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00
};

int8_t code num9[]=
{
     
    /*-- 文字: 9 --*/
    /*-- 宋体 12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
    0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00
};

//纵向取模,适合 ST7565P,ST7565R,ST7567,UC1701X,KS0108 等驱动 IC 的液晶模块使用
int8_t code ascii_table_8x16[95][16]= {
     
//粗体 8x16 点阵的 ASCII 码的点阵数据,从"JLX-GB2312"型号的字库 IC 中读出来的国标的。
    0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //- -(即“空格”)ASCII 码:0X20
    0x00,0x00,0x38,0xFC, 0xFC,0x38,0x00,0x00, 0x00,0x00,0x00,0x0D, 0x0D,0x00,0x00,0x00, //-!- ASCII 码:0X21
    0x00,0x0E,0x1E,0x00, 0x00,0x1E,0x0E,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //-"-
    0x20,0xF8,0xF8,0x20, 0xF8,0xF8,0x20,0x00, 0x02,0x0F,0x0F,0x02, 0x0F,0x0F,0x02,0x00, //-#-
    0x38,0x7C,0x44,0x47, 0x47,0xCC,0x98,0x00, 0x06,0x0C,0x08,0x38, 0x38,0x0F,0x07,0x00, //-$-
    0x30,0x30,0x00,0x80, 0xC0,0x60,0x30,0x00, 0x0C,0x06,0x03,0x01, 0x00,0x0C,0x0C,0x00, //-%-
    0x80,0xD8,0x7C,0xE4, 0xBC,0xD8,0x40,0x00, 0x07,0x0F,0x08,0x08, 0x07,0x0F,0x08,0x00, //-&-
    0x00,0x10,0x1E,0x0E, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //-'-
    0x00,0x00,0xF0,0xF8, 0x0C,0x04,0x00,0x00, 0x00,0x00,0x03,0x07, 0x0C,0x08,0x00,0x00, //-(-
    0x00,0x00,0x04,0x0C, 0xF8,0xF0,0x00,0x00, 0x00,0x00,0x08,0x0C, 0x07,0x03,0x00,0x00, //-)-
    0x80,0xA0,0xE0,0xC0, 0xC0,0xE0,0xA0,0x80, 0x00,0x02,0x03,0x01, 0x01,0x03,0x02,0x00, //-*- ASCII 码:0X2A
    0x00,0x80,0x80,0xE0, 0xE0,0x80,0x80,0x00, 0x00,0x00,0x00,0x03, 0x03,0x00,0x00,0x00, //-+-
    0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x10,0x1E, 0x0E,0x00,0x00,0x00, //-,-
    0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //---
    0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0C, 0x0C,0x00,0x00,0x00, //-.-
    0x00,0x00,0x00,0x80, 0xC0,0x60,0x30,0x00, 0x0C,0x06,0x03,0x01, 0x00,0x00,0x00,0x00, //-/-
    0xF8,0xF8,0x0C,0xC4, 0x0C,0xF8,0xF0,0x00, 0x03,0x07,0x0C,0x08, 0x0C,0x07,0x03,0x00, //-0- ASCII 码:0X30
    0x00,0x10,0x18,0xFC, 0xFC,0x00,0x00,0x00, 0x00,0x08,0x08,0x0F, 0x0F,0x08,0x08,0x00, //-1-
    0x08,0x0C,0x84,0xC4, 0x64,0x3C,0x18,0x00, 0x0E,0x0F,0x09,0x08, 0x08,0x0C,0x0C,0x00, //-2-
    0x08,0x0C,0x44,0x44, 0x44,0xFC,0xB8,0x00, 0x04,0x0C,0x08,0x08, 0x08,0x0F,0x07,0x00, //-3-
    0xC0,0xE0,0xB0,0x98, 0xFC,0xFC,0x80,0x00, 0x00,0x00,0x00,0x08, 0x0F,0x0F,0x08,0x00, //-4- ASCII 码:0X34
    0x7C,0x7C,0x44,0x44, 0x44,0xC4,0x84,0x00, 0x04,0x0C,0x08,0x08, 0x08,0x0F,0x07,0x00, //-5-
    0xF0,0xF8,0x4C,0x44, 0x44,0xC0,0x80,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0F,0x07,0x00, //-6-
    0x0C,0x0C,0x04,0x84, 0xC4,0x7C,0x3C,0x00, 0x00,0x00,0x0F,0x0F, 0x00,0x00,0x00,0x00, //-7-
    0xB8,0xFC,0x44,0x44, 0x44,0xFC,0xB8,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0F,0x07,0x00, //-8-
    0x38,0x7C,0x44,0x44, 0x44,0xFC,0xF8,0x00, 0x00,0x08,0x08,0x08, 0x0C,0x07,0x03,0x00, //-9-
    0x00,0x00,0x00,0x30, 0x30,0x00,0x00,0x00, 0x00,0x00,0x00,0x06, 0x06,0x00,0x00,0x00, //-:-
    0x00,0x00,0x00,0x30, 0x30,0x00,0x00,0x00, 0x00,0x00,0x08,0x0E, 0x06,0x00,0x00,0x00, //-;-
    0x00,0x80,0xC0,0x60, 0x30,0x18,0x08,0x00, 0x00,0x00,0x01,0x03, 0x06,0x0C,0x08,0x00, //-<-
    0x00,0x20,0x20,0x20, 0x20,0x20,0x20,0x00, 0x00,0x01,0x01,0x01, 0x01,0x01,0x01,0x00, //-=-
    0x00,0x08,0x18,0x30, 0x60,0xC0,0x80,0x00, 0x00,0x08,0x0C,0x06, 0x03,0x01,0x00,0x00, //->- ASCII 码:0X3E
    0x18,0x1C,0x04,0xC4, 0xE4,0x3C,0x18,0x00, 0x00,0x00,0x00,0x0D, 0x0D,0x00,0x00,0x00, //-?-
    0xF0,0xF0,0x08,0xC8, 0xC8,0xF8,0xF0,0x00, 0x07,0x0F,0x08,0x0B, 0x0B,0x0B,0x01,0x00, //-@-
    0xE0,0xF0,0x98,0x8C, 0x98,0xF0,0xE0,0x00, 0x0F,0x0F,0x00,0x00, 0x00,0x0F,0x0F,0x00, //-A- ASCII 码:0X41
    0x04,0xFC,0xFC,0x44, 0x44,0xFC,0xB8,0x00, 0x08,0x0F,0x0F,0x08, 0x08,0x0F,0x07,0x00, //-B-
    0xF0,0xF8,0x0C,0x04, 0x04,0x0C,0x18,0x00, 0x03,0x07,0x0C,0x08, 0x08,0x0C,0x06,0x00, //-C-
    0x04,0xFC,0xFC,0x04, 0x0C,0xF8,0xF0,0x00, 0x08,0x0F,0x0F,0x08, 0x0C,0x07,0x03,0x00, //-D-
    0x04,0xFC,0xFC,0x44, 0xE4,0x0C,0x1C,0x00, 0x08,0x0F,0x0F,0x08, 0x08,0x0C,0x0E,0x00, //-E-
    0x04,0xFC,0xFC,0x44, 0xE4,0x0C,0x1C,0x00, 0x08,0x0F,0x0F,0x08, 0x00,0x00,0x00,0x00, //-F-
    0xF0,0xF8,0x0C,0x84, 0x84,0x8C,0x98,0x00, 0x03,0x07,0x0C,0x08, 0x08,0x07,0x0F,0x00, //-G-
    0xFC,0xFC,0x40,0x40, 0x40,0xFC,0xFC,0x00, 0x0F,0x0F,0x00,0x00, 0x00,0x0F,0x0F,0x00, //-H- ASCII 码:0X48
    0x00,0x00,0x04,0xFC, 0xFC,0x04,0x00,0x00, 0x00,0x00,0x08,0x0F, 0x0F,0x08,0x00,0x00, //-I-
    0x00,0x00,0x00,0x04, 0xFC,0xFC,0x04,0x00, 0x07,0x0F,0x08,0x08, 0x0F,0x07,0x00,0x00, //-J-
    0x04,0xFC,0xFC,0xC0, 0xE0,0x3C,0x1C,0x00, 0x08,0x0F,0x0F,0x00, 0x01,0x0F,0x0E,0x00, //-K-
    0x04,0xFC,0xFC,0x04, 0x00,0x00,0x00,0x00, 0x08,0x0F,0x0F,0x08, 0x08,0x0C,0x0E,0x00, //-L-
    0xFC,0xFC,0x38,0x70, 0x38,0xFC,0xFC,0x00, 0x0F,0x0F,0x00,0x00, 0x00,0x0F,0x0F,0x00, //-M-
    0xFC,0xFC,0x38,0x70, 0xE0,0xFC,0xFC,0x00, 0x0F,0x0F,0x00,0x00, 0x00,0x0F,0x0F,0x00, //-N-
    0xF8,0xFC,0x04,0x04, 0x04,0xFC,0xF8,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0F,0x07,0x00, //-O-
    0x04,0xFC,0xFC,0x44, 0x44,0x7C,0x38,0x00, 0x08,0x0F,0x0F,0x08, 0x00,0x00,0x00,0x00, //-P-
    0xF8,0xFC,0x04,0x04, 0x04,0xFC,0xF8,0x00, 0x07,0x0F,0x08,0x0E, 0x3C,0x3F,0x27,0x00, //-Q-
    0x04,0xFC,0xFC,0x44, 0xC4,0xFC,0x38,0x00, 0x08,0x0F,0x0F,0x00, 0x00,0x0F,0x0F,0x00, //-R-
    0x18,0x3C,0x64,0x44, 0xC4,0x9C,0x18,0x00, 0x06,0x0E,0x08,0x08, 0x08,0x0F,0x07,0x00, //-S-
    0x00,0x1C,0x0C,0xFC, 0xFC,0x0C,0x1C,0x00, 0x00,0x00,0x08,0x0F, 0x0F,0x08,0x00,0x00, //-T-
    0xFC,0xFC,0x00,0x00, 0x00,0xFC,0xFC,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0F,0x07,0x00, //-U-
    0xFC,0xFC,0x00,0x00, 0x00,0xFC,0xFC,0x00, 0x01,0x03,0x06,0x0C, 0x06,0x03,0x01,0x00, //-V-
    0xFC,0xFC,0x00,0x00, 0x00,0xFC,0xFC,0x00, 0x07,0x0F,0x0E,0x03, 0x0E,0x0F,0x07,0x00, //-W-
    0x0C,0x3C,0xF0,0xE0, 0xF0,0x3C,0x0C,0x00, 0x0C,0x0F,0x03,0x01, 0x03,0x0F,0x0C,0x00, //-X-
    0x00,0x0C,0x7C,0xC0, 0xC0,0x7C,0x3C,0x00, 0x00,0x00,0x08,0x0F, 0x0F,0x08,0x00,0x00, //-Y-
    0x1C,0x0C,0x84,0xC4, 0x64,0x3C,0x1C,0x00, 0x0E,0x0F,0x09,0x08, 0x08,0x0C,0x0E,0x00, //-Z-
    0x00,0x00,0xFC,0xFC, 0x04,0x04,0x00,0x00, 0x00,0x00,0x0F,0x0F, 0x08,0x08,0x00,0x00, //-[-
    0x38,0x70,0xE0,0xC0, 0x80,0x00,0x00,0x00, 0x00,0x00,0x00,0x01, 0x03,0x07,0x0E,0x00, //-\-
    0x00,0x00,0x04,0x04, 0xFC,0xFC,0x00,0x00, 0x00,0x00,0x08,0x08, 0x0F,0x0F,0x00,0x00, //-]-
    0x08,0x0C,0x06,0x03, 0x06,0x0C,0x08,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //-^-
    0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x20, //-_-
    0x00,0x00,0x03,0x07, 0x04,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //-`-
    0x00,0xA0,0xA0,0xA0, 0xE0,0xC0,0x00,0x00, 0x07,0x0F,0x08,0x08, 0x07,0x0F,0x08,0x00, //-a- ASCII 码:0X61
    0x04,0xFC,0xFC,0x20, 0x60,0xC0,0x80,0x00, 0x00,0x0F,0x0F,0x08, 0x08,0x0F,0x07,0x00, //-b-
    0xC0,0xE0,0x20,0x20, 0x20,0x60,0x40,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0C,0x04,0x00, //-c-
    0x80,0xC0,0x60,0x24, 0xFC,0xFC,0x00,0x00, 0x07,0x0F,0x08,0x08, 0x07,0x0F,0x08,0x00, //-d-
    0xC0,0xE0,0xA0,0xA0, 0xA0,0xE0,0xC0,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0C,0x04,0x00, //-e-
    0x40,0xF8,0xFC,0x44, 0x0C,0x18,0x00,0x00, 0x08,0x0F,0x0F,0x08, 0x00,0x00,0x00,0x00, //-f-
    0xC0,0xE0,0x20,0x20, 0xC0,0xE0,0x20,0x00, 0x27,0x6F,0x48,0x48, 0x7F,0x3F,0x00,0x00, //-g-
    0x04,0xFC,0xFC,0x40, 0x20,0xE0,0xC0,0x00, 0x08,0x0F,0x0F,0x00, 0x00,0x0F,0x0F,0x00, //-h-
    0x00,0x00,0x20,0xEC, 0xEC,0x00,0x00,0x00, 0x00,0x00,0x08,0x0F, 0x0F,0x08,0x00,0x00, //-i-
    0x00,0x00,0x00,0x00, 0x20,0xEC,0xEC,0x00, 0x00,0x30,0x70,0x40, 0x40,0x7F,0x3F,0x00, //-j-
    0x04,0xFC,0xFC,0x80, 0xC0,0x60,0x20,0x00, 0x08,0x0F,0x0F,0x01, 0x03,0x0E,0x0C,0x00, //-k-
    0x00,0x00,0x04,0xFC, 0xFC,0x00,0x00,0x00, 0x00,0x00,0x08,0x0F, 0x0F,0x08,0x00,0x00, //-l-
    0xE0,0xE0,0x60,0xC0, 0x60,0xE0,0xC0,0x00, 0x0F,0x0F,0x00,0x07, 0x00,0x0F,0x0F,0x00, //-m-
    0x20,0xE0,0xC0,0x20, 0x20,0xE0,0xC0,0x00, 0x00,0x0F,0x0F,0x00, 0x00,0x0F,0x0F,0x00, //-n-
    0xC0,0xE0,0x20,0x20, 0x20,0xE0,0xC0,0x00, 0x07,0x0F,0x08,0x08, 0x08,0x0F,0x07,0x00, //-o-
    0x20,0xE0,0xC0,0x20, 0x20,0xE0,0xC0,0x00, 0x40,0x7F,0x7F,0x48, 0x08,0x0F,0x07,0x00, //-p-
    0xC0,0xE0,0x20,0x20, 0xC0,0xE0,0x20,0x00, 0x07,0x0F,0x08,0x48, 0x7F,0x7F,0x40,0x00, //-q-
    0x20,0xE0,0xC0,0x60, 0x20,0xE0,0xC0,0x00, 0x08,0x0F,0x0F,0x08, 0x00,0x00,0x00,0x00, //-r-
    0x40,0xE0,0xA0,0x20, 0x20,0x60,0x40,0x00, 0x04,0x0C,0x09,0x09, 0x0B,0x0E,0x04,0x00, //-s-
    0x20,0x20,0xF8,0xFC, 0x20,0x20,0x00,0x00, 0x00,0x00,0x07,0x0F, 0x08,0x0C,0x04,0x00, //-t-
    0xE0,0xE0,0x00,0x00, 0xE0,0xE0,0x00,0x00, 0x07,0x0F,0x08,0x08, 0x07,0x0F,0x08,0x00, //-u-
    0x00,0xE0,0xE0,0x00, 0x00,0xE0,0xE0,0x00, 0x00,0x03,0x07,0x0C, 0x0C,0x07,0x03,0x00, //-v-
    0xE0,0xE0,0x00,0x80, 0x00,0xE0,0xE0,0x00, 0x07,0x0F,0x0C,0x07, 0x0C,0x0F,0x07,0x00, //-w-
    0x20,0x60,0xC0,0x80, 0xC0,0x60,0x20,0x00, 0x08,0x0C,0x07,0x03, 0x07,0x0C,0x08,0x00, //-x-
    0xE0,0xE0,0x00,0x00, 0x00,0xE0,0xE0,0x00, 0x47,0x4F,0x48,0x48, 0x68,0x3F,0x1F,0x00, //-y-
    0x60,0x60,0x20,0xA0, 0xE0,0x60,0x20,0x00, 0x0C,0x0E,0x0B,0x09, 0x08,0x0C,0x0C,0x00, //-z- //
    0x00,0x40,0x40,0xF8, 0xBC,0x04,0x04,0x00, 0x00,0x00,0x00,0x07, 0x0F,0x08,0x08,0x00, //-{-
    0x00,0x00,0x00,0xBC, 0xBC,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F, 0x0F,0x00,0x00,0x00, //-|-
    0x00,0x04,0x04,0xBC, 0xF8,0x40,0x40,0x00, 0x00,0x08,0x08,0x0F, 0x07,0x00,0x00,0x00, //-}-
    0x08,0x0C,0x04,0x0C, 0x08,0x0C,0x04,0x00, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00, //-~- ASCII 码:0X7E
};

int8_t code ascii_table_5x8[95][5]=
{
     
    /*全体 ASCII 列表:5x8 点阵*/
    0x00,0x00,0x00,0x00,0x00,//- - //space
    0x00,0x00,0x4f,0x00,0x00,//-!-
    0x00,0x07,0x00,0x07,0x00,//-"-
    0x14,0x7f,0x14,0x7f,0x14,//-#-
    0x24,0x2a,0x7f,0x2a,0x12,//-$-
    0x23,0x13,0x08,0x64,0x62,//-%-
    0x36,0x49,0x55,0x22,0x50,//-&-
    0x00,0x05,0x07,0x00,0x00,//-'-
    0x00,0x1c,0x22,0x41,0x00,//-(-
    0x00,0x41,0x22,0x1c,0x00,//-)-
    0x14,0x08,0x3e,0x08,0x14,//-*-
    0x08,0x08,0x3e,0x08,0x08,//-+-
    0x00,0x50,0x30,0x00,0x00,//-,-
    0x08,0x08,0x08,0x08,0x08,//---
    0x00,0x60,0x60,0x00,0x00,//-.-
    0x20,0x10,0x08,0x04,0x02,//-/-
    0x3e,0x51,0x49,0x45,0x3e,//-0-
    0x00,0x42,0x7f,0x40,0x00,//-1-
    0x42,0x61,0x51,0x49,0x46,//-2-
    0x21,0x41,0x45,0x4b,0x31,//-3-
    0x18,0x14,0x12,0x7f,0x10,//-4-
    0x27,0x45,0x45,0x45,0x39,//-5-
    0x3c,0x4a,0x49,0x49,0x30,//-6-
    0x01,0x71,0x09,0x05,0x03,//-7-
    0x36,0x49,0x49,0x49,0x36,//-8-
    0x06,0x49,0x49,0x29,0x1e,//-9-
    0x00,0x36,0x36,0x00,0x00,//-:-
    0x00,0x56,0x36,0x00,0x00,//-;-
    0x08,0x14,0x22,0x41,0x00,//-<-
    0x14,0x14,0x14,0x14,0x14,//-=-
    0x00,0x41,0x22,0x14,0x08,//->-
    0x02,0x01,0x51,0x09,0x06,//-?-
    0x32,0x49,0x79,0x41,0x3e,//-@-
    0x7e,0x11,0x11,0x11,0x7e,//-A-
    0x7f,0x49,0x49,0x49,0x36,//-B-
    0x3e,0x41,0x41,0x41,0x22,//-C-
    0x7f,0x41,0x41,0x22,0x1c,//-D-
    0x7f,0x49,0x49,0x49,0x41,//-E-
    0x7f,0x09,0x09,0x09,0x01,//-F-
    0x3e,0x41,0x49,0x49,0x7a,//-G-
    0x7f,0x08,0x08,0x08,0x7f,//-H-
    0x00,0x41,0x7f,0x41,0x00,//-I-
    0x20,0x40,0x41,0x3f,0x01,//-J-
    0x7f,0x08,0x14,0x22,0x41,//-K-
    0x7f,0x40,0x40,0x40,0x40,//-L-
    0x7f,0x02,0x0c,0x02,0x7f,//-M-
    0x7f,0x04,0x08,0x10,0x7f,//-N-
    0x3e,0x41,0x41,0x41,0x3e,//-O-
    0x7f,0x09,0x09,0x09,0x06,//-P-
    0x3e,0x41,0x51,0x21,0x5e,//-Q-
    0x7f,0x09,0x19,0x29,0x46,//-R-
    0x46,0x49,0x49,0x49,0x31,//-S-
    0x01,0x01,0x7f,0x01,0x01,//-T-
    0x3f,0x40,0x40,0x40,0x3f,//-U-
    0x1f,0x20,0x40,0x20,0x1f,//-V-
    0x3f,0x40,0x38,0x40,0x3f,//-W-
    0x63,0x14,0x08,0x14,0x63,//-X-
    0x07,0x08,0x70,0x08,0x07,//-Y-
    0x61,0x51,0x49,0x45,0x43,//-Z-
    0x00,0x7f,0x41,0x41,0x00,//-[-
    0x02,0x04,0x08,0x10,0x20,//-\-
    0x00,0x41,0x41,0x7f,0x00,//-]-
    0x04,0x02,0x01,0x02,0x04,//-^-
    0x40,0x40,0x40,0x40,0x40,//-_-
    0x01,0x02,0x04,0x00,0x00,//-`-
    0x20,0x54,0x54,0x54,0x78,//-a-
    0x7f,0x48,0x48,0x48,0x30,//-b-
    0x38,0x44,0x44,0x44,0x44,//-c-
    0x30,0x48,0x48,0x48,0x7f,//-d-
    0x38,0x54,0x54,0x54,0x58,//-e-
    0x00,0x08,0x7e,0x09,0x02,//-f-
    0x48,0x54,0x54,0x54,0x3c,//-g-
    0x7f,0x08,0x08,0x08,0x70,//-h-
    0x00,0x00,0x7a,0x00,0x00,//-i-
    0x20,0x40,0x40,0x3d,0x00,//-j-
    0x7f,0x20,0x28,0x44,0x00,//-k-
    0x00,0x41,0x7f,0x40,0x00,//-l-
    0x7c,0x04,0x38,0x04,0x7c,//-m-
    0x7c,0x08,0x04,0x04,0x78,//-n-
    0x38,0x44,0x44,0x44,0x38,//-o-
    0x7c,0x14,0x14,0x14,0x08,//-p-
    0x08,0x14,0x14,0x14,0x7c,//-q-
    0x7c,0x08,0x04,0x04,0x08,//-r-
    0x48,0x54,0x54,0x54,0x24,//-s-
    0x04,0x04,0x3f,0x44,0x24,//-t-
    0x3c,0x40,0x40,0x40,0x3c,//-u-
    0x1c,0x20,0x40,0x20,0x1c,//-v-
    0x3c,0x40,0x30,0x40,0x3c,//-w-
    0x44,0x28,0x10,0x28,0x44,//-x-
    0x04,0x48,0x30,0x08,0x04,//-y-
    0x44,0x64,0x54,0x4c,0x44,//-z-
    0x08,0x36,0x41,0x41,0x00,//-{-
    0x00,0x00,0x77,0x00,0x00,//-|-
    0x00,0x41,0x41,0x36,0x08,//-}-
    0x04,0x02,0x02,0x02,0x01,//-~-
};

int8_t code bmp1[]= {
     
//-- 调入了一幅图像:D:\我的文档\My Pictures\12864-555.bmp --
//-- 宽度 x 高度=128x64 --
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0xE0,0x60,0xE0,0xE0,0xE0,0xE0,0x60,
    0x60,0x60,0x60,0x60,0x60,0x60,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0x80,0x80,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0x70,0x38,0x18,0x1C,0x0C,
    0x0E,0x07,0x03,0x03,0x01,0x81,0xE0,0x78,0x1C,0x0E,0x07,0x03,0x01,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0E,0x1C,0x79,0xE1,0x83,
    0x03,0x07,0x0E,0x0C,0x1C,0x18,0x38,0x70,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,
    0xC0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,
    0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,
    0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x80,0xF0,0x78,0x1E,0x07,0x03,0x81,0x80,0xC0,0xC0,0xC0,0xE0,0x60,
    0x60,0x60,0x70,0xF0,0xFE,0x3F,0x19,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
    0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x38,0x31,0x3F,
    0xFE,0xF0,0x60,0x60,0xE0,0xC0,0xC0,0xC0,0x80,0x81,0x03,0x07,0x1E,0x78,0xF0,0x80,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFC,0xFF,0x7F,0x07,0x0F,0x1F,0x3D,
    0x79,0x71,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
    0x80,0xC0,0xE0,0xF0,0x71,0x79,0x3D,0x1F,0x0F,0xFF,0xFE,0xFC,0x00,0x00,0x00,0x00,
    0x00,0x80,0xFE,0xFF,0xF9,0x1C,0x0E,0x07,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,
    0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x07,0x0E,0x1C,0xF9,0xFF,
    0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x0E,0x9E,0xFC,0xF8,0xF0,0xE0,0xC0,0xC0,0x80,
    0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xE0,0xF0,0xF8,0xF8,0xFC,0x9E,0x0F,0x07,
    0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
    0x00,0x00,0x3F,0xFF,0xDF,0x38,0x70,0xE0,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,
    0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xE0,0x70,0x38,0xDF,0xFF,
    0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
    0x80,0xC0,0xE0,0xF0,0x78,0x3C,0x1E,0x0F,0x07,0x03,0x01,0x00,0x01,0x01,0x03,0x07,
    0x0F,0x1E,0x1E,0x0E,0x0F,0x07,0x03,0x01,0x01,0x00,0x01,0x01,0x03,0x07,0x0F,0x1E,
    0x3C,0x78,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x07,0x0F,0x3C,0x70,0xE0,0xC1,0x81,0x03,0x03,0x03,0x07,0x06,
    0x06,0x06,0x0E,0x0F,0x7F,0xFC,0x98,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
    0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0C,0x8C,0xFC,
    0x7F,0x0F,0x06,0x06,0x07,0x03,0x03,0x03,0x81,0xC1,0xE0,0x70,0x3C,0x0F,0x07,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,0x3F,0x7C,0xFC,0xFE,0xEF,
    0xE7,0xE3,0xE1,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,
    0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,
    0xE0,0xE0,0xE0,0xE1,0xE3,0xE7,0xEF,0xFE,0x7C,0x3F,0x1F,0x0F,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0E,0x0C,0x1C,0x18,
    0x38,0x70,0x60,0xE0,0xC0,0xC1,0x87,0x9E,0xB8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xB8,0xDE,0xC7,0xE1,
    0x60,0x70,0x38,0x18,0x1C,0x0C,0x0E,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x03,0x03,0x03,0x07,0x07,
    0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x01,0x01,0x01,0x01,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};

JLX12864G_08602_Font.h

/*
 * JLX12864G_08602_Font.h
 *
 *  Created on: Apr 26, 2021
 *      Author: Royic
 */

#ifndef JLX12864G_08602_JLX12864G_08602_Font_H_
#define JLX12864G_08602_JLX12864G_08602_Font_H_

extern int8_t code cheng1[];
extern int8_t code zhuang1[];
extern int8_t code tai1[];
extern int8_t code shi1[];
extern int8_t code yong1[];
extern int8_t code mao_hao[];
extern int8_t code num0[];
extern int8_t code num1[];
extern int8_t code num2[];
extern int8_t code num3[];
extern int8_t code num4[];
extern int8_t code num5[];
extern int8_t code num6[];
extern int8_t code num7[];
extern int8_t code num8[];
extern int8_t code num9[];
extern int8_t code bmp1[];

extern int8_t code ascii_table_8x16[95][16];
extern int8_t code ascii_table_5x8[95][5];

#endif

测试程序

main.c

#include 
#include "./JLX12864G_08602/JLX12864G_08602.h"
#include "intrins.h"
#include "stdint.h"

void Delay1ms()		//@12.000MHz
{
     
	unsigned char i, j;

	_nop_();
	_nop_();
	i = 12;
	j = 168;
	do
	{
     
		while (--j);
	} while (--i);
}


void Delay_ms(int i)
{
     
	while(i--)
		Delay1ms();
}

sbit LEDA=P2^5;

void main(void)
{
     
	LEDA=1;
	P4SW=0x70;			 //允许P4 IO
	P2M0=0x20;			 //推挽点亮背光

	initial_lcd();
	JLX12864G_08602_Test();

	while(1)
	{
     	
	}
}

效果

【51单片机快速入门指南】5.3:SPI控制晶联讯JLX12864G_08602 LCD屏幕_第2张图片

你可能感兴趣的:(51单片机,51单片机,单片机,嵌入式硬件,12864,spi)