STM32F103硬件SPI控制6针/7针0.96寸OLED显示屏

这篇具有很好参考价值的文章主要介绍了STM32F103硬件SPI控制6针/7针0.96寸OLED显示屏。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

OLED介绍

OLED主要参数
1、高分辨率:12864(和12864LCD相同分辨率,但该OLED屏的单位面积像素点多)。
2、广可视角度:大于160°。
3、低功耗:正常显示时0.04W。
4、宽供电范围:直流3.3V-5V。
5、工业级:工作温度范围-30°℃~70°℃。
6、体积小:28.8mm
28.5mm。
7、通信方式:lIC、SPI。
8、亮度、对比度可以通过程序指令控制。
9、OLED屏幕内部驱动芯片:SSD1306。

6针OLED如下图所示
oled6针显示代码,stm32,单片机,arm
引脚定义分别为

引脚 定义
GND 电源负
VCC 电源正3.3V-5V
SCL 时钟信号线
SDA 双向数据线
RES 复位
D/C 数据或命令切换

7针OLED如下图所示
oled6针显示代码,stm32,单片机,arm
引脚定义分别为

引脚 定义
GND 电源负
VCC 电源正3.3V-5V
D0 SPI接口为SPI时钟线
D1 SPI接口为SPI数据线
RES 复位
DC 数据或命令切换
CS 片选信号

本质上6针与7针都可以使用SPI控制,6针使用SPI通信时,默认片选引脚为选中状态,SCL为SPI时钟线,SDA为SPI数据线。

SPI相对于4针IIC通讯有着无可替代的优势,就是在显示中文字符时不需要通过输入数字的方式引导去查表,先将要显示的中文字符编码存放到一个数组当中,需要显示中文时直接打入要显示的中文即可,省去了IIC查表的麻烦。

取字模

一、使用OLED之前先对所需要显示的内容取字模,取字模使用三贝计算器

选项类型 选择内容
输出格式 C51
数据排列 从左到右从上到下
取模方式 横向8点左高位
黑白取反 正常
字体种类 自选
强制全角 ASCII自动转全角

oled6针显示代码,stm32,单片机,arm
二、PCtoLCD2002
oled6针显示代码,stm32,单片机,arm

程序

main.c



#include	"system.h"
#include	"delay.h"
#include	"oled.h"



int main(void)
{
	delay_init();
	SPI2_Init();
	OLED_Init();//初始化OLED
	OLED_Clear(0);//清屏(全黑)
	
	while(1)
	{
		OLED_Test_MainPage();         //主界面显示测试
		OLED_Clear(0);
		OLED_Test_Color();            //刷屏测试
		OLED_Clear(0);
		OLED_Test_Rectangular();      //矩形绘制测试
		OLED_Clear(0);
		OLED_Test_Circle();           //圆形绘制测试
		OLED_Clear(0);
		OLED_Test_Triangle();         //三角形绘制测试
		OLED_Clear(0);
		
		OLED_TEST_English();          //英文显示测试
		OLED_Clear(0);
		OLED_TEST_Number_Character(); //数字和符号显示测试
		OLED_Clear(0);
		
		OLED_Test_Chinese();          //中文显示测试
		OLED_Clear(0);
		OLED_Test_BMP();              //BMP单色图片显示测试
		OLED_Clear(0);
		OLED_Test_Menu1();            //菜单1显示测试
		OLED_Clear(0);
		OLED_Test_Menu2();            //菜单2显示测试
		OLED_Clear(0);
	}
}


oled.c



#include "oled.h"
#include "oledfont.h"


//OLED显存总共分为8页
//每页8行,一行128个像素点
//OLED的显存
//存放格式如下.
//[0]0 1 2 3 ... 127 (0~7)行
//[1]0 1 2 3 ... 127 (8~15)行
//[2]0 1 2 3 ... 127 (16~23)行
//[3]0 1 2 3 ... 127 (24~31)行
//[4]0 1 2 3 ... 127 (32~39)行
//[5]0 1 2 3 ... 127 (40~47)行
//[6]0 1 2 3 ... 127 (48~55)行
//[7]0 1 2 3 ... 127 (56~63)行


//数组每个bit存储OLED每个像素点的颜色值(1-亮(白色),0-灭(黑色))
//每个数组元素表示1列8个像素点,一共128列
static unsigned char OLED_buffer[1024] = 
{
	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,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,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,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,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,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,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,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,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,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};


/*******************************************************************
 * @name       :void OLED_Write_Byte(unsigned dat,unsigned cmd)
 * @date       :2022-06-22
 * @function   :将一个字节的内容写入OLED屏幕
 * @parameters :dat:要编写的内容
                cmd:0-写入命令
								    1-写入数据
 * @retvalue   :无
********************************************************************/
void OLED_Write_Byte(unsigned dat,unsigned cmd)
{
	if(cmd)
	{
		OLED_DC_PIN_Set();
	}
	else
	{
		OLED_DC_PIN_Clr();
	}
	OLED_CS_PIN_Clr();
	SPI_WriteByte(SPI2, dat);
	OLED_CS_PIN_Set();
}


/*******************************************************************
 * @name       :void OLED_Display_On(void)
 * @date       :2022-06-22
 * @function   :打开OLED显示
 * @parameters :无
 * @retvalue   :无
********************************************************************/ 	  
void OLED_Display_On(void)
{
	OLED_Write_Byte(0X8D,OLED_CMD);		//SET DCDC命令
	OLED_Write_Byte(0X14,OLED_CMD);		//DCDC ON
	OLED_Write_Byte(0XAF,OLED_CMD);		//DISPLAY ON
}


/*******************************************************************
 * @name       :void OLED_Display_Off(void)
 * @date       :2022-06-22
 * @function   :关闭OLED显示
 * @parameters :无
 * @retvalue   :无
********************************************************************/    
void OLED_Display_Off(void)
{
	OLED_Write_Byte(0X8D,OLED_CMD);		//SET DCDC命令
	OLED_Write_Byte(0X10,OLED_CMD);		//DCDC OFF
	OLED_Write_Byte(0XAE,OLED_CMD);		//DISPLAY OFF
}


/*******************************************************************
 * @name       :void OLED_Set_Pos(unsigned char x, unsigned char y)
 * @date       :2022-06-22
 * @function   :在OLED屏幕中设置坐标
 * @parameters :x:x坐标
                y:y坐标
 * @retvalue   :无
********************************************************************/
void OLED_Set_Pos(unsigned char x, unsigned char y)
{
 	OLED_Write_Byte(YLevel+y/PAGE_SIZE,OLED_CMD);
	OLED_Write_Byte((((x+2)&0xf0)>>4)|0x10,OLED_CMD);
	OLED_Write_Byte(((x+2)&0x0f),OLED_CMD);
}


/*******************************************************************
 * @name       :void OLED_Reset(void)
 * @date       :2022-06-22
 * @function   :重置OLED屏幕显示
 * @parameters :dat:0-显示全黑
                    1-显示全白
 * @retvalue   :无
********************************************************************/ 
void OLED_Reset(void)
{
	OLED_RST_PIN_Set();
	delay_ms(100);
	OLED_RST_PIN_Clr();
	delay_ms(100);
	OLED_RST_PIN_Set();
}


/*******************************************************************
 * @name       :void OLED_Set_Pixel(unsigned char x, unsigned char y,unsigned char color)
 * @date       :2022-06-22
 * @function   :将像素值设置为RAM
 * @parameters :x:像素的x坐标
                y:像素的y坐标
								color:像素点的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
********************************************************************/ 
void OLED_Set_Pixel(unsigned char x, unsigned char y,unsigned char color)
{
	if(color)
	{
		OLED_buffer[(y/PAGE_SIZE)*WIDTH+x]|= (1<<(y%PAGE_SIZE))&0xff;
	}
	else
	{
		OLED_buffer[(y/PAGE_SIZE)*WIDTH+x]&= ~((1<<(y%PAGE_SIZE))&0xff);
	}
}


/*******************************************************************
 * @name       :void OLED_Display(void)
 * @date       :2022-06-22
 * @function   :在OLED屏幕中显示
 * @parameters :无
 * @retvalue   :无
********************************************************************/  
void OLED_Display(void)
{
	u8 i,n;
	for(i=0;i<PAGE_SIZE;i++)  
	{  
		OLED_Write_Byte (YLevel+i,OLED_CMD);			//设置页地址(0~7)
		OLED_Write_Byte (XLevelL,OLED_CMD);				//设置显示位置—列低地址
		OLED_Write_Byte (XLevelH,OLED_CMD);				//设置显示位置—列高地址
		for(n=0;n<WIDTH;n++)
		{
			OLED_Write_Byte(OLED_buffer[i*WIDTH+n],OLED_DATA);
		}
	}		//更新显示
}


/*******************************************************************
 * @name       :void OLED_Clear(unsigned dat)
 * @date       :2022-06-22
 * @function   :清除OLED屏幕显示
 * @parameters :dat:0-显示全黑
                    1-显示全白
 * @retvalue   :无
********************************************************************/
void OLED_Clear(unsigned dat)
{
	if(dat)
	{
		memset(OLED_buffer,0xff,sizeof(OLED_buffer));
	}
	else
	{
		memset(OLED_buffer,0,sizeof(OLED_buffer));
	}
	OLED_Display();
}


/*******************************************************************
 * @name       :void OLED_Init_GPIO(void)
 * @date       :2022-06-22
 * @function   :OLED引脚初始化
 * @parameters :无
 * @retvalue   :无
********************************************************************/ 
void OLED_Init_GPIO(void)
{
	GPIO_InitTypeDef  GPIO_InitStructure;
	
	RCC_APB2PeriphClockCmd(OLED_RST_CLK,ENABLE);				//使能端口时钟
	GPIO_InitStructure.GPIO_Pin = OLED_RST_PIN;
 	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;		//推挽输出
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;		//速度50MHz
 	GPIO_Init(OLED_RST_PORT, &GPIO_InitStructure);
 	GPIO_SetBits(OLED_RST_PORT,OLED_RST_PIN);
	
	RCC_APB2PeriphClockCmd(OLED_DC_CLK,ENABLE);					//使能端口时钟
	GPIO_InitStructure.GPIO_Pin = OLED_DC_PIN;
 	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;		//推挽输出
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;		//速度50MHz
 	GPIO_Init(OLED_DC_PORT, &GPIO_InitStructure);
 	GPIO_SetBits(OLED_DC_PORT,OLED_DC_PIN);
	
	RCC_APB2PeriphClockCmd(OLED_CS_CLK,ENABLE);					//使能端口时钟
	GPIO_InitStructure.GPIO_Pin = OLED_CS_PIN;
 	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;		//推挽输出
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;		//速度50MHz
 	GPIO_Init(OLED_CS_PORT, &GPIO_InitStructure);
 	GPIO_SetBits(OLED_CS_PORT,OLED_CS_PIN);
}


/*******************************************************************
 * @name       :void OLED_Init(void)
 * @date       :2022-06-22
 * @function   :初始化OLED SSD1306控制IC
 * @parameters :无
 * @retvalue   :无
********************************************************************/ 				    
void OLED_Init(void)
{
 	OLED_Init_GPIO();		//初始化GPIO
	
 	delay_ms(200);
	OLED_Reset();				//复位OLED
	
	/**************初始化SSD1306*****************/
	OLED_Write_Byte(0xAE,OLED_CMD);	/*display off*/
	OLED_Write_Byte(0x00,OLED_CMD);	/*set lower column address*/
	OLED_Write_Byte(0x10,OLED_CMD);	/*set higher column address*/
	OLED_Write_Byte(0x40,OLED_CMD);	/*set display start line*/
	OLED_Write_Byte(0xB0,OLED_CMD);	/*set page address*/
	OLED_Write_Byte(0x81,OLED_CMD);	/*contract control*/
	OLED_Write_Byte(0xFF,OLED_CMD);	/*128*/
	OLED_Write_Byte(0xA1,OLED_CMD);	/*set segment remap*/
	OLED_Write_Byte(0xA6,OLED_CMD);	/*normal / reverse*/
	OLED_Write_Byte(0xA8,OLED_CMD);	/*multiplex ratio*/
	OLED_Write_Byte(0x3F,OLED_CMD);	/*duty = 1/64*/
	OLED_Write_Byte(0xC8,OLED_CMD);	/*Com scan direction*/
	OLED_Write_Byte(0xD3,OLED_CMD);	/*set display offset*/
	OLED_Write_Byte(0x00,OLED_CMD);
	OLED_Write_Byte(0xD5,OLED_CMD);	/*set osc division*/
	OLED_Write_Byte(0x80,OLED_CMD);
	OLED_Write_Byte(0xD9,OLED_CMD);	/*set pre-charge period*/
	OLED_Write_Byte(0XF1,OLED_CMD);
	OLED_Write_Byte(0xDA,OLED_CMD);	/*set COM pins*/
	OLED_Write_Byte(0x12,OLED_CMD);
	OLED_Write_Byte(0xDB,OLED_CMD);	/*set vcomh*/
	OLED_Write_Byte(0x30,OLED_CMD);
	OLED_Write_Byte(0x8D,OLED_CMD);	/*set charge pump disable*/
	OLED_Write_Byte(0x14,OLED_CMD);
	OLED_Write_Byte(0xAF,OLED_CMD);	/*display ON*/
}


/*******************************************************************
 * @name       :void OLED_DrawPoint(u8 x,u8 y,u8 color)
 * @date       :2022-06-22
 * @function   :在OLED屏幕中绘制点
 * @parameters :x:点的x坐标
                y:点的y坐标
								color:点的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
********************************************************************/
void OLED_DrawPoint(u8 x,u8 y,u8 color)
{
	OLED_Set_Pixel(x,y,color);
	OLED_Display();
}


/*******************************************************************
 * @name       :void OLED_Fill(u8 sx,u8 sy,u8 ex,u8 ey,u8 color)
 * @date       :2022-06-22
 * @function   :填充指定区域
 * @parameters :sx:指定填充区域的起始x坐标
                sy:指定填充区域的起始y坐标
								ex:指定填充区域的结束x坐标
								ey:指定填充区域的结束y坐标
								color:指定区域的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
********************************************************************/
void OLED_Fill(u8 sx,u8 sy,u8 ex,u8 ey,u8 color)
{
	u8 i,j;
	u8 width=ex-sx+1;			//得到填充的宽度
	u8 height=ey-sy+1;		//高度
	for(i=0;i<height;i++)
	{
		for(j=0;j<width;j++)
		{
				OLED_Set_Pixel(sx+j, sy+i,color);
		}
	}
	OLED_Display();
}


/*******************************************************************
 * @name       :void OLED_DrawLine(u8 x1, u8 y1, u8 x2, u8 y2,u8 color)
 * @date       :2022-06-22
 * @function   :在两点之间画一条线
 * @parameters :x1:线的起始x点坐标
                y1:线的起始y点坐标
								x2:线的结束x点坐标
								y2:线的结束y点坐标
								color:线条的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
********************************************************************/
void OLED_DrawLine(u8 x1, u8 y1, u8 x2, u8 y2,u8 color)
{
	u16 t;
	int xerr=0,yerr=0,delta_x,delta_y,distance;
	int incx,incy,uRow,uCol;
	
	delta_x=x2-x1; //计算坐标增量
	delta_y=y2-y1;
	uRow=x1;
	uCol=y1;
	if(delta_x>0)incx=1; //设置单步方向
	else if(delta_x==0)incx=0;//垂直线
	else {incx=-1;delta_x=-delta_x;}
	if(delta_y>0)incy=1;
	else if(delta_y==0)incy=0;//水平线
	else{incy=-1;delta_y=-delta_y;}
	if( delta_x>delta_y)distance=delta_x; //选取基本增量坐标轴
	else distance=delta_y;
	for(t=0;t<=distance+1;t++ )//画线输出
	{
		OLED_Set_Pixel(uRow,uCol,color);
		xerr+=delta_x ;
		yerr+=delta_y ;
		if(xerr>distance)
		{
			xerr-=distance;
			uRow+=incx;
		}
		if(yerr>distance)
		{
			yerr-=distance;
			uCol+=incy;
		}
	}
	OLED_Display();
}


/*****************************************************************************
 * @name       :void OLED_DrawRectangle(u8 x1, u8 y1, u8 x2, u8 y2,u8 color)
 * @date       :2022-06-22
 * @function   :绘制矩形
 * @parameters :x1:矩形的起始x坐标
                y1:矩形的起始y坐标
								x2:矩形的结束x坐标
								y2:矩形的结束y坐标
								color:线条的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/
void OLED_DrawRectangle(u8 x1, u8 y1, u8 x2, u8 y2,u8 color)
{
	OLED_DrawLine(x1,y1,x2,y1,color);
	OLED_DrawLine(x1,y1,x1,y2,color);
	OLED_DrawLine(x1,y2,x2,y2,color);
	OLED_DrawLine(x2,y1,x2,y2,color);
}


/*****************************************************************************
 * @name       :void OLED_FillRectangle(u8 x1, u8 y1, u8 x2, u8 y2,u8 color)
 * @date       :2022-06-22
 * @function   :填充矩形
 * @parameters :x1:填充矩形的起始x坐标
                y1:填充矩形的起始y坐标
								x2:填充矩形的结束x坐标
								y2:填充矩形的结束y坐标
								color:矩形的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/  
void OLED_FillRectangle(u8 x1, u8 y1, u8 x2, u8 y2,u8 color)
{
	OLED_Fill(x1,y1,x2,y2,color);
}

 
/*****************************************************************************
 * @name       :static void _draw_circle_8(u8 xc, u8 yc, u8 x, u8 y, u8 color)
 * @date       :2022-06-22
 * @function   :对称圆绘制算法(内部调用)
 * @parameters :xc:圆心的x坐标
                yc:圆心的y坐标
								x:相对于圆心的x坐标
								y:相对于圆心的y坐标
								color:圆的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/
static void _draw_circle_8(u8 xc, u8 yc, u8 x, u8 y, u8 color)
{
	OLED_Set_Pixel(xc + x, yc + y, color);
	OLED_Set_Pixel(xc - x, yc + y, color);
	OLED_Set_Pixel(xc + x, yc - y, color);
	OLED_Set_Pixel(xc - x, yc - y, color);
	OLED_Set_Pixel(xc + y, yc + x, color);
	OLED_Set_Pixel(xc - y, yc + x, color);
	OLED_Set_Pixel(xc + y, yc - x, color);
	OLED_Set_Pixel(xc - y, yc - x, color);
}


/*****************************************************************************
 * @name       :void OLED_DrawCircle(u8 xc, u8 yc, u8 color, u8 r)
 * @date       :2022-06-22
 * @function   :在指定位置绘制指定大小的圆
 * @parameters :xc:圆心的x坐标
                yc:圆心的y坐标
								r:圆形半径
								color:圆的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/
void OLED_DrawCircle(u8 xc, u8 yc, u8 color, u8 r)
{
	int x = 0, y = r,d;
	d = 3 - 2 * r;
	while (x <= y)
	{
		_draw_circle_8(xc, yc, x, y, color);
		if (d < 0)
		{
				d = d + 4 * x + 6;
		}
		else
		{
				d = d + 4 * (x - y) + 10;
				y--;
		}
		x++;
	}
	OLED_Display();
}


/*****************************************************************************
 * @name       :void OLED_FillCircle(u8 xc, u8 yc, u8 color, u8 r)
 * @date       :2022-06-22
 * @function   :在指定位置填充指定大小的圆
 * @parameters :xc:圆心的x坐标
                yc:圆心的y坐标
								r:圆形半径
								color:圆的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/
void OLED_FillCircle(u8 xc, u8 yc, u8 color, u8 r)
{
	int x = 0, y = r, yi, d;
	d = 3 - 2 * r;
	while (x <= y)
	{
			for (yi = x; yi <= y; yi++)
			{
				_draw_circle_8(xc, yc, x, yi, color);
			}
			if (d < 0)
			{
				d = d + 4 * x + 6;
			}
			else
			{
				d = d + 4 * (x - y) + 10;
				y--;
			}
			x++;
	}
	OLED_Display();
}


/**********************************************************************************
 * @name       :void OLED_DrawTriangel(u8 x0,u8 y0,u8 x1,u8 y1,u8 x2,u8 y2,u8 color)
 * @date       :2022-06-22 
 * @function   :在指定位置绘制三角形
 * @parameters :x0:三角形的第一点x坐标
                y0:三角形的第一点y坐标
								x1:三角形的第二点x坐标
								y1:三角形的第二点y坐标
								x2:三角形的第三点x坐标
								y2:三角形的第三点y坐标
								color:三角形的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
***********************************************************************************/
void OLED_DrawTriangel(u8 x0,u8 y0,u8 x1,u8 y1,u8 x2,u8 y2,u8 color)
{
	OLED_DrawLine(x0,y0,x1,y1,color);
	OLED_DrawLine(x1,y1,x2,y2,color);
	OLED_DrawLine(x2,y2,x0,y0,color);
}



/*****************************************************************************
 * @name       :static void _swap(u8 *a, u8 *b)
 * @date       :2022-06-22
 * @function   :交换两个号码(内部通话)
 * @parameters :a:第一个号码的地址
								b:第二个号码的地址
 * @retvalue   :无
******************************************************************************/
static void _swap(u8 *a, u8 *b)
{
	u16 tmp;
  tmp = *a;
	*a = *b;
	*b = tmp;
}


/*****************************************************************************
 * @name       :static void _draw_h_line(u8 x0,u8 x1,u8 y,u8 color)
 * @date       :2022-06-22
 * @function   :在显示屏中画一条水平线(内部调用)
 * @parameters :x0:水平线的起始x坐标
                x1:水平线的结束x坐标
								y:水平线的y坐标
								color:线的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/
static void _draw_h_line(u8 x0,u8 x1,u8 y,u8 color)
{
	u8 i=0;
	for(i=x0;i<=x1;i++)
	{
		OLED_Set_Pixel(i, y, color);
	}
}


/*****************************************************************************
 * @name       :void OLED_FillTriangel(u8 x0,u8 y0,u8 x1,u8 y1,u8 x2,u8 y2,u8 color)
 * @date       :2022-06-22
 * @function   :在指定位置填充三角形
 * @parameters :x0:三角形的第一点x坐标
                y0:三角形的第一点y坐标
								x1:三角形的第二点x坐标
								y1:三角形的第二点y坐标
								x2:三角形的第三点x坐标
								y2:三角形的第三点y坐标
								color:三角形的颜色值
								      1-白色
											0-黑色
 * @retvalue   :无
******************************************************************************/
void OLED_FillTriangel(u8 x0,u8 y0,u8 x1,u8 y1,u8 x2,u8 y2,u8 color)
{
	u8 a, b, y, last;
	int dx01, dy01, dx02, dy02, dx12, dy12;
	long sa = 0;
	long sb = 0;
 	if (y0 > y1)
	{
    _swap(&y0,&y1);
		_swap(&x0,&x1);
 	}
 	if (y1 > y2)
	{
    _swap(&y2,&y1);
		_swap(&x2,&x1);
 	}
  if (y0 > y1)
	{
    _swap(&y0,&y1);
		_swap(&x0,&x1);
  }
	if(y0 == y2)
	{
		a = b = x0;
		if(x1 < a)
    {
			a = x1;
    }
    else if(x1 > b)
    {
			b = x1;
    }
    if(x2 < a)
    {
			a = x2;
    }
		else if(x2 > b)
    {
			b = x2;
    }
		_draw_h_line(a,b,y0,color);
    return;
	}
	dx01 = x1 - x0;
	dy01 = y1 - y0;
	dx02 = x2 - x0;
	dy02 = y2 - y0;
	dx12 = x2 - x1;
	dy12 = y2 - y1;
	
	if(y1 == y2)
	{
		last = y1;
	}
  else
	{
		last = y1-1;
	}
	for(y=y0; y<=last; y++)
	{
		a = x0 + sa / dy01;
		b = x0 + sb / dy02;
		sa += dx01;
    sb += dx02;
    if(a > b)
    {
			_swap(&a,&b);
		}
		_draw_h_line(a,b,y,color);
	}
	sa = dx12 * (y - y1);
	sb = dx02 * (y - y0);
	for(; y<=y2; y++)
	{
		a = x1 + sa / dy12;
		b = x0 + sb / dy02;
		sa += dx12;
		sb += dx02;
		if(a > b)
		{
			_swap(&a,&b);
		}
		_draw_h_line(a,b,y,color);
	}
	OLED_Display();
}


/*****************************************************************************
 * @name       :void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 Char_Size,u8 mode)
 * @date       :2022-06-22
 * @function   :显示单个英文字符
 * @parameters :x:字符显示位置的起始x坐标
                y:字符显示位置的起始y坐标
								chr:显示字符的ascii码(0~94)
								Char_Size:显示字符的大小(8,16)
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 Char_Size,u8 mode)
{
	unsigned char c=0,i=0,tmp,j=0;
	c=chr-' ';											//得到偏移后的值
	if(x>WIDTH-1){x=0;y=y+2;}
	if(Char_Size ==16)
	{
		for(i=0;i<16;i++)
		{
			if(mode)
			{
				tmp = F8X16[c*16+i];
			}
			else
			{
				tmp = ~(F8X16[c*16+i]);
			}
			for(j=0;j<8;j++)
			{
				if(tmp&(0x80>>j))
				{
					OLED_Set_Pixel(x+j, y+i,1);
				}
				else
				{
					OLED_Set_Pixel(x+j, y+i,0);
				}
			}
		}
	}
	else if(Char_Size==8)
	{
		for(i=0;i<8;i++)
		{
			if(mode)
			{
				tmp = F6x8[c][i];
			}
			else
			{
				tmp = ~(F6x8[c][i]);
			}
			for(j=0;j<8;j++)
			{
				if(tmp&(0x80>>j))
				{
					OLED_Set_Pixel(x+j, y+i,1);
				}
				else
				{
					OLED_Set_Pixel(x+j, y+i,0);
				}
			}
		}
	}
	else
	{
		return;
	}
	OLED_Display();
}


/*****************************************************************************
 * @name       :void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 Char_Size,u8 mode)
 * @date       :2022-06-22 
 * @function   :显示英文字符串
 * @parameters :x:英语字符串的起始x坐标
                y:英语字符串的起始y坐标
								chr:英文字符串的起始地址
								Char_Size:显示字符的大小
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 Char_Size,u8 mode)
{
	unsigned char j=0,csize;
	if(Char_Size == 16)
  {
	  csize = Char_Size/2;
	}
  else if(Char_Size == 8)
  {
	  csize = Char_Size/2+2;
	}
	else
	{
		return;
	}
	while (chr[j]!='\0')
	{
		OLED_ShowChar(x,y,chr[j],Char_Size,mode);
		x+=csize;
		if(x>120)
		{
			x=0;
			y+=Char_Size;
		}
		j++;
	}
}


/*****************************************************************************
 * @name       :u32 mypow(u8 m,u8 n)
 * @date       :2022-06-22 
 * @function   :获取m的n次方(内部调用)
 * @parameters :m:the multiplier
                n:the power
 * @retvalue   :m的n次方
******************************************************************************/
static u32 mypow(u8 m,u8 n)
{
	u32 result=1;
	while(n--)result*=m;
	return result;
}


/*****************************************************************************
 * @name       :void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 Size,u8 mode)
 * @date       :2022-06-22 
 * @function   :显示数字
 * @parameters :x:数字的起始x坐标
                y:数字的起始y坐标
								num:数字(0~4294967295)
								len:显示数字的长度
								Size:显示数字的大小
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 Size,u8 mode)
{
	u8 t,temp;
	u8 enshow=0,csize;
  if(Size == 16)
  {
	  csize = Size/2;
	}
  else if(Size == 8)
  {
	  csize = Size/2+2;
	}
	else
	{
		return;
	}
	for(t=0;t<len;t++)
	{
		temp=(num/mypow(10,len-t-1))%10;
		if(enshow==0&&t<(len-1))
		{
			if(temp==0)
			{
				OLED_ShowChar(x+csize*t,y,' ',Size,mode);
				continue;
			}else enshow=1;
			
		}
	 	OLED_ShowChar(x+csize*t,y,temp+'0',Size,mode);
	}
}


/*****************************************************************************
 * @name       :void OLED_ShowFont16(u8 x,u8 y,u8 *s,u8 mode)
 * @date       :2022-06-22
 * @function   :显示单个16x16汉字
 * @parameters :x:汉字的起始x坐标
                y:汉字的起始y坐标
								s:汉字的起始地址
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/ 
void OLED_ShowFont16(u8 x,u8 y,u8 *s,u8 mode)
{
	u8 i,j,k,tmp;
	u16 num;
	num = sizeof(cfont16)/sizeof(typFNT_GB16);
  for(i=0;i<num;i++)
	{
		if((cfont16[i].Index[0] == *s) && (cfont16[i].Index[1] == *(s+1)))
		{
			for(j=0;j<32;j++)
			{
				if(mode)
				{
					tmp = cfont16[i].Msk[j];
				}
				else
				{
					tmp = ~(cfont16[i].Msk[j]);
				}
				for(k=0;k<8;k++)
				{
					if(tmp&(0x80>>k))
					{
						OLED_Set_Pixel(x+(j%2)*8+k, y+j/2,1);
					}
					else
					{
						OLED_Set_Pixel(x+(j%2)*8+k, y+j/2,0);
					}
				}
			}	
			break;
		}	
	}
	OLED_Display();
}

/*****************************************************************************
 * @name       :void OLED_ShowFont24(u8 x,u8 y,u8 *s,u8 mode)
 * @date       :2022-06-22
 * @function   :显示单个24x24汉字
 * @parameters :x:汉字的起始x坐标
                y:汉字的起始y坐标
								s:汉字的起始地址
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/ 
void OLED_ShowFont24(u8 x,u8 y,u8 *s,u8 mode)
{
	u8 i,j,k,tmp;
	u16 num;
	num = sizeof(cfont24)/sizeof(typFNT_GB24);
  for(i=0;i<num;i++)
	{
		if((cfont24[i].Index[0] == *s) && (cfont24[i].Index[1] == *(s+1)))
		{
			for(j=0;j<72;j++)
			{
				if(mode)
				{
					tmp = cfont24[i].Msk[j];
				}
				else
				{
					tmp = ~(cfont24[i].Msk[j]);
				}
				for(k=0;k<8;k++)
				{
					if(tmp&(0x80>>k))
					{
						OLED_Set_Pixel(x+(j%3)*8+k, y+j/3,1);
					}
					else
					{
						OLED_Set_Pixel(x+(j%3)*8+k, y+j/3,0);
					}
				}
			}	
			break;
		}	
	}
	OLED_Display();
}

/*****************************************************************************
 * @name       :void OLED_ShowFont32(u8 x,u8 y,u8 *s,u8 mode)
 * @date       :2022-06-22
 * @function   :显示单个32x32汉字
 * @parameters :x:汉字的起始x坐标
                y:汉字的起始y坐标
								s:汉字的起始地址
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/
void OLED_ShowFont32(u8 x,u8 y,u8 *s,u8 mode)
{
	u8 i,j,k,tmp;
	u16 num;
	num = sizeof(cfont32)/sizeof(typFNT_GB32);
  for(i=0;i<num;i++)
	{
		if((cfont32[i].Index[0] == *s) && (cfont32[i].Index[1] == *(s+1)))
		{
			for(j=0;j<128;j++)
			{
				if(mode)
				{
					tmp = cfont32[i].Msk[j];
				}
				else
				{
					tmp = ~(cfont32[i].Msk[j]);
				}
				for(k=0;k<8;k++)
				{
					if(tmp&(0x80>>k))
					{
						OLED_Set_Pixel(x+(j%4)*8+k, y+j/4,1);
					}
					else
					{
						OLED_Set_Pixel(x+(j%4)*8+k, y+j/4,0);
					}
				}
			}
			break;
		}
	}
	OLED_Display();
}


/*****************************************************************************
 * @name       :void OLED_ShowCHinese(u8 x,u8 y,u8 hsize,u8 *str,u8 mode)
 * @date       :2022-06-22 
 * @function   :显示中文字符串
 * @parameters :x:汉语字符串的起始x坐标
                y:汉语字符串的起始y坐标
								size:中文字符串的大小
								str:中文字符串的起始地址
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/
void OLED_ShowCHinese(u8 x,u8 y,u8 hsize,u8 *str,u8 mode)
{
	while(*str!='\0')
	{
		if(hsize == 16)
		{
			OLED_ShowFont16(x,y,str,mode);
		}
		else if(hsize == 24)
		{
			OLED_ShowFont24(x,y,str,mode);
		}
		else if(hsize == 32)
		{
			OLED_ShowFont32(x,y,str,mode);
		}
		else
		{
			return;
		}
		x+=hsize;
		if(x>WIDTH-hsize)
		{
			x=0;
			y+=hsize;
		}
		str+=2;
	}
}


/*****************************************************************************
 * @name       :void OLED_DrawBMP(u8 x,u8 y,u8 width, u8 height, u8 BMP[], u8 mode)
 * @date       :2022-06-22
 * @function   :显示BMP单色图片
 * @parameters :x:BMP单色图片的起始x坐标
                y:BMP单色图片的起始y坐标
								width:BMP单色图片的宽度
								height:BMP单色图片的高度
								BMP:BMP单色图像阵列的起始地址
								mode:0-白底黑字
								     1-黑底白字
 * @retvalue   :无
******************************************************************************/
void OLED_DrawBMP(u8 x,u8 y,u8 width, u8 height, u8 BMP[], u8 mode)
{
 u8 i,j,k;
 u8 tmp;
 for(i=0;i<height;i++)
 {
		for(j=0;j<(width+7)/8;j++)
		{
			if(mode)
			{
				tmp = BMP[i*((width+7)/8)+j];
			}
			else
			{
				tmp = ~BMP[i*((width+7)/8)+j];
			}
			for(k=0;k<8;k++)
			{
				if(tmp&(0x80>>k))
				{
					OLED_Set_Pixel(x+j*8+k, y+i,1);
				}
				else
				{
					OLED_Set_Pixel(x+j*8+k, y+i,0);
				}
			}
		}
	}
	OLED_Display();
}


/*****************************************************************************
 * @name       :void OLED_Test_MainPage(void)
 * @date       :2022-06-22
 * @function   :绘制综合测试程序主界面
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_MainPage(void)
{
	OLED_ShowString(28,0,"daichuangkun",16,1);					//显示英文字符串
	OLED_ShowCHinese(28,20,16,"戴创昆",1);			//显示中文汉字
	//OLED_ShowString(40,32,"64X128",16,1);
	OLED_ShowString(4,48,"123456789",16,1);	//显示数字
	//OLED_ShowString(4,48,"www.lcdwiki.com",16,1);
	delay_ms(1500);
	delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_Test_Color(void)
 * @date       :2022-06-22
 * @function   :颜色填充测试(白色、黑色)
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Color(void)
{
	 OLED_Fill(0,0,WIDTH-1,HEIGHT-1,0);
	 OLED_ShowString(10,10,"BLACK",16,1);
	 delay_ms(1000);
	 OLED_Fill(0,0,WIDTH-1,HEIGHT-1,1);
	 delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_Test_Rectangular(void))
 * @date       :2022-06-22
 * @function   :矩形显示和填充测试
								依次显示黑白矩形框,1000毫秒后,依次用黑色和白色填充矩形
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Rectangular(void)
{
	OLED_Fill(0,0,WIDTH/2-1,HEIGHT-1,0);
	OLED_Fill(WIDTH/2,0,WIDTH-1,HEIGHT-1,1);
	OLED_DrawRectangle(5, 5, WIDTH/2-1-5, HEIGHT-1-5,1);
	OLED_DrawRectangle(WIDTH/2-1+5, 5, WIDTH-1-5, HEIGHT-1-5,0);
	delay_ms(1000);
	OLED_FillRectangle(5, 5, WIDTH/2-1-5, HEIGHT-1-5,1);
	OLED_FillRectangle(WIDTH/2-1+5, 5, WIDTH-1-5, HEIGHT-1-5,0);
	delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_Test_Circle(void)
 * @date       :2022-06-22
 * @function   :循环显示和填充测试依次显示黑白圆形框,1000毫秒后,依次用黑色、白色填充圆形
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Circle(void)
{
	OLED_Fill(0,0,WIDTH/2-1,HEIGHT-1,0);
	OLED_Fill(WIDTH/2,0,WIDTH-1,HEIGHT-1,1);
	OLED_DrawCircle(WIDTH/2/2-1, HEIGHT/2-1, 1, 27);
	OLED_DrawCircle(WIDTH/2+WIDTH/2/2-1, HEIGHT/2-1, 0, 27);
	delay_ms(1000);
	OLED_FillCircle(WIDTH/2/2-1, HEIGHT/2-1, 1, 27);
	OLED_FillCircle(WIDTH/2+WIDTH/2/2-1, HEIGHT/2-1, 0, 27);
	delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_Test_Triangle(void)
 * @date       :2022-06-22
 * @function   :三角形显示和填充测试依次显示黑白三角形框,1000毫秒后,依次用黑色和白色填充三角形
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Triangle(void)
{
	OLED_Fill(0,0,WIDTH/2-1,HEIGHT-1,0);
	OLED_Fill(WIDTH/2,0,WIDTH-1,HEIGHT-1,1);
	OLED_DrawTriangel(5,HEIGHT-1-5,WIDTH/2/2-1,5,WIDTH/2-1-5,HEIGHT-1-5,1);
	OLED_DrawTriangel(WIDTH/2-1+5,HEIGHT-1-5,WIDTH/2+WIDTH/2/2-1,5,WIDTH-1-5,HEIGHT-1-5,0);
	delay_ms(1000);
	OLED_FillTriangel(5,HEIGHT-1-5,WIDTH/2/2-1,5,WIDTH/2-1-5,HEIGHT-1-5,1);
	OLED_FillTriangel(WIDTH/2-1+5,HEIGHT-1-5,WIDTH/2+WIDTH/2/2-1,5,WIDTH-1-5,HEIGHT-1-5,0);
	delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_TEST_English(void)
 * @date       :2022-06-22
 * @function   :英文显示测试
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_TEST_English(void)
{
	OLED_ShowString(0,5,"6x8:abcdefghijklmnopqrstuvwxyz",8,1);
	OLED_ShowString(0,25,"8x16:abcdefghijklmnopqrstuvwxyz",16,1);
	delay_ms(1000);
	OLED_ShowString(0,5,"6x8:ABCDEFGHIJKLMNOPQRSTUVWXYZ",8,1);
	OLED_ShowString(0,25,"8x16:ABCDEFGHIJKLMNOPQRSTUVWXYZ",16,1);
	delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_TEST_Number_Character(void) 
 * @date       :2022-06-22
 * @function   :数字和字符显示测试
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_TEST_Number_Character(void)
{
	OLED_Fill(0,0,WIDTH-1,HEIGHT/2-1,0);
	OLED_ShowString(0,0,"6x8:!\"#$%&'()*+,-./:;<=>?@[]\\^_`~{}|",8,1);
	OLED_ShowNum(30,16,1234567890,10,8,1);
	delay_ms(1000);
	OLED_Clear(0);
  OLED_ShowString(0,0,"8x16:!\"#$%&'()*+,-./:;<=>?@[]\\^_`~{}|",16,1);
	OLED_ShowNum(40,32,1234567890,10,16,1);
	delay_ms(1500);
	OLED_Clear(0);
}


/*****************************************************************************
 * @name       :void OLED_Test_Chinese(void)
 * @date       :2022-06-22
 * @function   :中文显示测试
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Chinese(void)
{
	OLED_ShowString(45,0,"16x16",8,1);
	OLED_ShowCHinese(16,20,16,"戴创昆",1);
	delay_ms(1000);
	OLED_Clear(0);
	OLED_ShowString(45,0,"24x24",8,1);
	OLED_ShowCHinese(16,20,24,"戴创昆",1);
	delay_ms(1000);
	OLED_Clear(0);
	OLED_ShowString(45,0,"32x32",8,1);
	OLED_ShowCHinese(0,20,32,"戴创昆",1);
  delay_ms(1000);
	OLED_Clear(0);
}


/*****************************************************************************
 * @name       :void OLED_Test_BMP(void)
 * @date       :2022-06-22
 * @function   :BMP单色图片显示测试
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_BMP(void)
{
	OLED_DrawBMP(0,0,128,64, BMP2, 1);
	delay_ms(1000);
	OLED_DrawBMP(0,0,128,64, BMP3, 1);
	delay_ms(1000);
	OLED_DrawBMP(0,0,128,64, BMP4, 1);
	delay_ms(1000);
}


/*****************************************************************************
 * @name       :void OLED_Test_Menu1(void)
 * @date       :2022-06-22
 * @function   :中文选择菜单显示测试
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Menu1(void)
{
	OLED_Fill(0,0,WIDTH-1,15,1);
	OLED_ShowCHinese(32,0,16,"系统设置",0);
	OLED_DrawCircle(10, 24, 1,6);
	OLED_DrawCircle(10, 24, 1,3);
	OLED_DrawCircle(10, 40, 1,6);
	OLED_DrawCircle(10, 40, 1,3);
	OLED_DrawCircle(10, 56, 1,6);
	OLED_DrawCircle(10, 56, 1,3);
	OLED_ShowString(20,16,"A.",16,1);
	OLED_ShowCHinese(36,16,16,"音量设置",1);
	OLED_ShowString(20,32,"B.",16,1);
	OLED_ShowCHinese(36,32,16,"颜色设置",1);
	OLED_ShowString(20,48,"C.",16,1);
	OLED_ShowCHinese(36,48,16,"网络设置",1);
	OLED_DrawRectangle(0, 0,WIDTH-1,HEIGHT-1,1);
	OLED_DrawLine(WIDTH-1-10, 15, WIDTH-1-10, HEIGHT-1,1);
	OLED_FillTriangel(WIDTH-1-9,20,WIDTH-1-5,16,WIDTH-1-1,20,1);
	OLED_FillTriangel(WIDTH-1-9,HEIGHT-1-5,WIDTH-1-5,HEIGHT-1-1,WIDTH-1-1,HEIGHT-1-5,1);
	OLED_FillCircle(10, 24, 1,3);
	OLED_Fill(20,16,99,31,1);
	OLED_ShowString(20,16,"A.",16,0);
	OLED_ShowCHinese(36,16,16,"音量设置",0);
	OLED_Fill(WIDTH-1-9,23,WIDTH-1-1,28,1);
	delay_ms(1500);
	OLED_FillCircle(10, 24, 0,3);
	OLED_DrawCircle(10, 24, 1,3);
	OLED_Fill(20,16,99,31,0);
	OLED_ShowString(20,16,"A.",16,1);
	OLED_ShowCHinese(36,16,16,"音量设置",1);
	OLED_Fill(WIDTH-1-9,23,WIDTH-1-1,28,0);
	OLED_FillCircle(10, 40, 1,3);
	OLED_Fill(20,32,99,47,1);
	OLED_ShowString(20,32,"B.",16,0);
	OLED_ShowCHinese(36,32,16,"颜色设置",0);
	OLED_Fill(WIDTH-1-9,37,WIDTH-1-1,42,1);
	delay_ms(1500);
	OLED_FillCircle(10, 40, 0,3);
	OLED_DrawCircle(10, 40, 1,3);
	OLED_Fill(20,32,99,47,0);
	OLED_ShowString(20,32,"B.",16,1);
	OLED_ShowCHinese(36,32,16,"颜色设置",1);
	OLED_Fill(WIDTH-1-9,37,WIDTH-1-1,42,0);
	OLED_FillCircle(10, 56, 1,3);
	OLED_Fill(20,48,99,63,1);
	OLED_ShowString(20,48,"C.",16,0);
	OLED_ShowCHinese(36,48,16,"网络设置",0);
	OLED_Fill(WIDTH-1-9,HEIGHT-1-13,WIDTH-1-1,HEIGHT-1-8,1);
	delay_ms(1500);
}


/*****************************************************************************
 * @name       :void OLED_Test_Menu2(void)
 * @date       :2022-06-22
 * @function   :英文天气界面显示测试
 * @parameters :无
 * @retvalue   :无
******************************************************************************/
void OLED_Test_Menu2(void)
{
	u8 i;
	srand(123456);
	OLED_DrawLine(0, 10, WIDTH-1, 10,1);
	OLED_DrawLine(WIDTH/2-1,11,WIDTH/2-1,HEIGHT-1,1);
	OLED_DrawLine(WIDTH/2-1,10+(HEIGHT-10)/2-1,WIDTH-1,10+(HEIGHT-10)/2-1,1);
	OLED_ShowString(0,1,"2019-08-17",8,1);
	OLED_ShowString(78,1,"Saturday",8,1);
	OLED_ShowString(14,HEIGHT-1-10,"Cloudy",8,1);
	OLED_ShowString(WIDTH/2-1+2,13,"TEMP",8,1);
	OLED_DrawCircle(WIDTH-1-19, 25, 1,2);
	OLED_ShowString(WIDTH-1-14,20,"C",16,1);
	OLED_ShowString(WIDTH/2-1+9,20,"32.5",16,1);
	OLED_ShowString(WIDTH/2-1+2,39,"PM2.5",8,1);
	OLED_ShowString(WIDTH/2-1+5,46,"90ug/m3",16,1);
	OLED_DrawBMP(6,16,51,32, BMP5, 1);
	for(i=0;i<15;i++)
	{
		OLED_ShowNum(WIDTH/2-1+9,20,rand()%4,1,16,1);
		OLED_ShowNum(WIDTH/2-1+9+8,20,rand()%10,1,16,1);
		OLED_ShowNum(WIDTH/2-1+9+8+16,20,rand()%10,1,16,1);
		OLED_ShowNum(WIDTH/2-1+5,46,rand()%10,1,16,1);
		OLED_ShowNum(WIDTH/2-1+5+8,46,rand()%10,1,16,1);
    delay_ms(500);
	}
}



oled.h



/****************************************************************************************************
//=========================================电源接线================================================//
// OLED模块               STM32单片机
//   VCC         接       DC 5V/3.3V      //OLED屏电源正
//   GND         接          GND          //OLED屏电源地
//=======================================液晶屏数据线接线==========================================//
//本模块默认数据总线类型为4线制SPI
// OLED模块               STM32单片机
//   D1          接          PB15        //OLED屏SPI写信号
//=======================================液晶屏控制线接线==========================================//
// OLED模块               STM32单片机
//   CS          接          PB11        //OLED屏片选控制信号
//   RES         接          PB12        //OLED屏复位控制信号
//   DC          接          PB10        //OLED屏数据/命令选择控制信号
//   D0          接          PB13        //OLED屏SPI时钟信号
//=========================================触摸屏接线=========================================//
//本模块不带触摸功能,所以不需要触摸屏接线
****************************************************************************************************/	


#ifndef __OLED_H
#define __OLED_H		


#include "sys.h"
#include "stdlib.h"
#include "string.h" 	 
#include "delay.h"
#include "spi2.h"


//--------------OLED参数定义---------------------
#define PAGE_SIZE			8
#define XLevelL				0x00
#define XLevelH				0x10
#define YLevel				0xB0
#define	Brightness		0xFF 
#define WIDTH					128
#define HEIGHT				64	


//-------------写命令和数据定义-------------------
#define OLED_CMD			0		//写命令
#define OLED_DATA			1		//写数据 


//-----------------OLED端口定义----------------

#define OLED_RST_PIN		GPIO_Pin_8							//复位信号
#define OLED_RST_PORT		GPIOA										//复位信号
#define OLED_RST_CLK		RCC_APB2Periph_GPIOA		//复位信号

#define OLED_DC_PIN			GPIO_Pin_11							//数据/命令控制信号
#define OLED_DC_PORT		GPIOA										//数据/命令控制信号
#define OLED_DC_CLK			RCC_APB2Periph_GPIOA		//数据/命令控制信号

#define OLED_CS_PIN			GPIO_Pin_12							//片选信号
#define OLED_CS_PORT		GPIOA										//片选信号
#define OLED_CS_CLK			RCC_APB2Periph_GPIOA		//片选信号


//-----------------OLED端口操作定义----------------
 					   
#define OLED_RST_PIN_Clr()	GPIO_ResetBits(OLED_RST_PORT,OLED_RST_PIN)
#define OLED_RST_PIN_Set()	GPIO_SetBits	(OLED_RST_PORT,OLED_RST_PIN)

#define OLED_DC_PIN_Clr()		GPIO_ResetBits(OLED_DC_PORT,OLED_DC_PIN)
#define OLED_DC_PIN_Set()		GPIO_SetBits	(OLED_DC_PORT,OLED_DC_PIN)

#define OLED_CS_PIN_Clr()		GPIO_ResetBits(OLED_CS_PORT,OLED_CS_PIN)
#define OLED_CS_PIN_Set()		GPIO_SetBits	(OLED_CS_PORT,OLED_CS_PIN)


void OLED_Write_Byte(unsigned dat,unsigned cmd);														//将一个字节的内容写入OLED屏幕
void OLED_Display_On(void);																									//打开OLED显示
void OLED_Display_Off(void);																								//关闭OLED显示
void OLED_Set_Pos(unsigned char x, unsigned char y);												//在OLED屏幕中设置坐标
void OLED_Reset(void);																											//重置OLED屏幕显示
void OLED_Set_Pixel(unsigned char x, unsigned char y,unsigned char color);	//将像素值设置为RAM
void OLED_Display(void);																										//在OLED屏幕中显示
void OLED_Clear(unsigned dat);																							//清除OLED屏幕显示
void OLED_Init_GPIO(void);																									//OLED引脚初始化
void OLED_Init(void);																												//初始化OLED SSD1306控制IC

void OLED_DrawPoint(u8 x, u8 y, u8 color);																	//在OLED屏幕中绘制点
void OLED_Fill(u8 sx,u8 sy,u8 ex,u8 ey,u8 color);														//填充指定区域
void OLED_DrawLine(u8 x1, u8 y1, u8 x2, u8 y2,u8 color);										//在两点之间画一条线
void OLED_DrawRectangle(u8 x1, u8 y1, u8 x2, u8 y2,u8 color);								//绘制矩形
void OLED_FillRectangle(u8 x1, u8 y1, u8 x2, u8 y2,u8 color);								//填充矩形
void OLED_DrawCircle(u8 xc, u8 yc, u8 color, u8 r);													//在指定位置绘制指定大小的圆
void OLED_FillCircle(u8 xc, u8 yc, u8 color, u8 r);													//在指定位置填充指定大小的圆
void OLED_DrawTriangel(u8 x0,u8 y0,u8 x1,u8 y1,u8 x2,u8 y2,u8 color);				//在指定位置绘制三角形
void OLED_FillTriangel(u8 x0,u8 y0,u8 x1,u8 y1,u8 x2,u8 y2,u8 color);				//在指定位置填充三角形
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 Char_Size,u8 mode);									//显示单个英文字符
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 Size,u8 mode);								//显示英文字符串
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 Char_Size,u8 mode);								//显示数字
void OLED_ShowFont16(u8 x,u8 y,u8 *s,u8 mode);															//显示单个16x16汉字
void OLED_ShowFont24(u8 x,u8 y,u8 *s,u8 mode);															//显示单个24x24汉字
void OLED_ShowFont32(u8 x,u8 y,u8 *s,u8 mode);															//显示单个32x32汉字
void OLED_ShowCHinese(u8 x,u8 y,u8 hsize,u8 *str,u8 mode);									//显示中文字符串
void OLED_DrawBMP(u8 x,u8 y,u8 width, u8 height, u8 BMP[], u8 mode);				//显示BMP单色图片

void OLED_Test_MainPage(void);																							//绘制综合测试程序主界面
void OLED_Test_Color(void);																									//颜色填充测试(白色、黑色)
void OLED_Test_Rectangular(void);																						//矩形显示和填充测试
void OLED_Test_Circle(void);																								//循环显示和填充测试依次显示黑白圆形框,1000毫秒后,依次用黑色、白色填充圆形
void OLED_Test_Triangle(void);																							//三角形显示和填充测试依次显示黑白三角形框,1000毫秒后,依次用黑色和白色填充三角形
void OLED_TEST_English(void);																								//英文显示测试
void OLED_TEST_Number_Character(void);																			//数字和字符显示测试
void OLED_Test_Chinese(void);																								//中文显示测试
void OLED_Test_BMP(void);																										//BMP单色图片显示测试
void OLED_Test_Menu1(void);																									//中文选择菜单显示测试
void OLED_Test_Menu2(void);																									//英文天气界面显示测试


#endif


spi2.c



#include "spi2.h"


void SPI2_Init(void)
{
 	GPIO_InitTypeDef GPIO_InitStructure;
  SPI_InitTypeDef  SPI_InitStructure;
	
	RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2,  ENABLE );	//SPI2时钟使能
	
	RCC_APB2PeriphClockCmd(SPI2_SCK_CLK, ENABLE );					//PORTB时钟使能
	GPIO_InitStructure.GPIO_Pin = SPI2_SCK_PIN;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;					//PB13复用推挽输出
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(SPI2_SCK_PORT, &GPIO_InitStructure);					//初始化GPIOB
	
	RCC_APB2PeriphClockCmd(SPI2_MOSI_CLK, ENABLE );					//PORTB时钟使能
	GPIO_InitStructure.GPIO_Pin = SPI2_MOSI_PIN;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;					//PB15复用推挽输出
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(SPI2_MOSI_PORT, &GPIO_InitStructure);					//初始化GPIOB
	
	SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;			//设置SPI单向或者双向的数据模式:SPI设置为双线双向全双工
	SPI_InitStructure.SPI_Mode = SPI_Mode_Master;														//设置SPI工作模式:设置为主SPI
	SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;												//设置SPI的数据大小:SPI发送接收8位帧结构
	SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;															//串行同步时钟的空闲状态为高电平
	SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;														//串行同步时钟的第二个跳变沿(上升或下降)数据被采样
	SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;																//NSS信号由硬件(NSS管脚)还是软件(使用SSI位)管理:内部NSS信号有SSI位控制
	SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;			//定义波特率预分频的值:波特率预分频值为2
	SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;											//指定数据传输从MSB位还是LSB位开始:数据传输从MSB位开始
	SPI_InitStructure.SPI_CRCPolynomial = 7;																//CRC值计算的多项式
	SPI_Init(SPI2, &SPI_InitStructure);																			//根据SPI_InitStruct中指定的参数初始化外设SPIx寄存器
	
	SPI_Cmd(SPI2, ENABLE);		//使能SPI外设
}


//SPI 速度设置函数
//SpeedSet:
//SPI_BaudRatePrescaler_2   2分频
//SPI_BaudRatePrescaler_8   8分频
//SPI_BaudRatePrescaler_16  16分频
//SPI_BaudRatePrescaler_256 256分频
void SPI2_SetSpeed(u8 SPI_BaudRatePrescaler)
{
  assert_param(IS_SPI_BAUDRATE_PRESCALER(SPI_BaudRatePrescaler));
	SPI2->CR1&=0XFFC7;
	SPI2->CR1|=SPI_BaudRatePrescaler;		//设置SPI2速度
	SPI_Cmd(SPI2,ENABLE);
}


//SPIx 读写一个字节
//TxData:要写入的字节
//返回值:读取到的字节
u8 SPI2_ReadWriteByte(u8 TxData)
{
	u8 retry=0;
	while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET)		//检查指定的SPI标志位设置与否:发送缓存空标志位
	{
		retry++;
		if(retry>200)
			return 0;
	}
	SPI_I2S_SendData(SPI2, TxData);		//通过外设SPIx发送一个数据
	retry=0;
	
	while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET)		//检查指定的SPI标志位设置与否:接受缓存非空标志位
	{
		retry++;
		if(retry>200)return 0;
	}
	return SPI_I2S_ReceiveData(SPI2);		//返回通过SPIx最近接收的数据
}


/*****************************************************************************
 * @name       :u8 SPI_WriteByte(SPI_TypeDef* SPIx,u8 Byte)
 * @date       :2022-06-22
 * @function   :使用STM32的硬件SPI写入一个字节的数据
 * @parameters :SPIx:SPI类型,x表示1,2,3
                Byte:要写入的数据
 * @retvalue   :总线接收的数据
******************************************************************************/
u8 SPI_WriteByte(SPI_TypeDef* SPIx,u8 Byte)
{
	/* Loop while DR register in not emplty */
  while (SPI_I2S_GetFlagStatus(SPIx, SPI_I2S_FLAG_TXE) == RESET);

  /* Send byte through the SPI1 peripheral */
  SPI_I2S_SendData(SPIx, Byte);

  /* Wait to receive a byte */
  while (SPI_I2S_GetFlagStatus(SPIx, SPI_I2S_FLAG_RXNE) == RESET);

  /* Return the byte read from the SPI bus */
  return SPI_I2S_ReceiveData(SPIx);
}


spi2.h



#ifndef __SPI2_H
#define __SPI2_H


#include "sys.h"
#include "oled.h"


//--------------SPI端口操作定义---------------------

#define SPI2_SCK_PIN		GPIO_Pin_13							//时钟信号
#define SPI2_SCK_PORT		GPIOB										//时钟信号
#define SPI2_SCK_CLK		RCC_APB2Periph_GPIOB		//时钟信号

#define SPI2_MOSI_PIN		GPIO_Pin_15							//数据发送信号
#define SPI2_MOSI_PORT	GPIOB										//数据发送信号
#define SPI2_MOSI_CLK		RCC_APB2Periph_GPIOB		//数据发送信号

#define	SPI2_SCK_PIN_SET()  	GPIO_SetBits	(SPI2_SCK_PORT,SPI2_SCK_PIN)
#define	SPI2_SCK_PIN_CLR()  	GPIO_ResetBits(SPI2_SCK_PORT,SPI2_SCK_PIN)

#define	SPI2_MOSI_PIN_SET()  	GPIO_SetBits	(SPI2_MOSI_PORT,SPI2_MOSI_PIN)
#define	SPI2_MOSI_PIN_CLR()  	GPIO_ResetBits(SPI2_MOSI_PORT,SPI2_MOSI_PIN)


void SPI2_Init(void);													//初始化SPI口
void SPI2_SetSpeed(u8 SpeedSet);							//设置SPI速度
u8 SPI2_ReadWriteByte(u8 TxData);							//SPI总线读写一个字节
u8 SPI_WriteByte(SPI_TypeDef* SPIx,u8 Byte);	//使用STM32的硬件SPI写入一个字节的数据


#endif


oledfont.h



#ifndef __OLEDFONT_H
#define __OLEDFONT_H


//常用ASCII表
//偏移量32
//ASCII字符集
//偏移量32
//大小:6*8
//逐行式,顺向(高位在前)
/************************************6*8的点阵************************************/
const unsigned char F6x8[][8] =
{
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // sp
	0x10,0x10,0x10,0x10,0x00,0x10,0x00,0x00, // !
	0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00, // "
	0x28,0x28,0x7C,0x28,0x7C,0x28,0x28,0x00, // #
	0x10,0x3C,0x50,0x38,0x14,0x78,0x10,0x00, // $
	0x00,0x4C,0x2C,0x10,0x08,0x60,0x60,0x00, // %
	0x30,0x48,0x50,0x20,0x54,0x48,0x34,0x00, // &
	0x30,0x10,0x20,0x00,0x00,0x00,0x00,0x00, // '
	0x08,0x10,0x20,0x20,0x20,0x10,0x08,0x00, // (
	0x20,0x10,0x08,0x08,0x08,0x10,0x20,0x00, // )
	0x00,0x10,0x54,0x38,0x54,0x10,0x00,0x00, // *
	0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00, // +
	0x00,0x00,0x00,0x00,0x00,0x18,0x08,0x10, // ,
	0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00, // -
	0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00, // .
	0x00,0x04,0x08,0x10,0x20,0x40,0x00,0x00, // /
	0x38,0x44,0x4C,0x54,0x64,0x44,0x38,0x00, // 0
	0x10,0x30,0x10,0x10,0x10,0x10,0x38,0x00, // 1
	0x38,0x44,0x04,0x08,0x10,0x20,0x7C,0x00, // 2
	0x7C,0x08,0x10,0x08,0x04,0x44,0x38,0x00, // 3 
	0x08,0x18,0x28,0x48,0x7C,0x08,0x08,0x00, // 4
	0x7C,0x40,0x78,0x04,0x04,0x44,0x38,0x00, // 5
	0x18,0x20,0x40,0x78,0x44,0x44,0x38,0x00, // 6
	0x7C,0x04,0x08,0x10,0x20,0x20,0x20,0x00, // 7
	0x38,0x44,0x44,0x38,0x44,0x44,0x38,0x00, // 8
	0x38,0x44,0x44,0x3C,0x04,0x08,0x30,0x00, // 9
	0x00,0x30,0x30,0x00,0x30,0x30,0x00,0x00, // :
	0x00,0x30,0x30,0x00,0x30,0x10,0x20,0x00, // ;
	0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x00, // <
	0x00,0x00,0x7C,0x00,0x7C,0x00,0x00,0x00, // =
	0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x00, // >
	0x38,0x44,0x04,0x08,0x10,0x00,0x10,0x00, // ?
	0x38,0x44,0x04,0x34,0x5C,0x44,0x38,0x00, // @
	0x10,0x28,0x44,0x44,0x7C,0x44,0x44,0x00, // A
	0x78,0x44,0x44,0x78,0x44,0x44,0x78,0x00, // B
	0x38,0x44,0x40,0x40,0x40,0x44,0x38,0x00, // C
	0x70,0x48,0x44,0x44,0x44,0x48,0x70,0x00, // D
	0x7C,0x40,0x40,0x78,0x40,0x40,0x7C,0x00, // E
	0x7C,0x40,0x40,0x78,0x40,0x40,0x40,0x00, // F
	0x38,0x44,0x40,0x5C,0x44,0x44,0x3C,0x00, // G
	0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x00, // H
	0x38,0x10,0x10,0x10,0x10,0x10,0x38,0x00, // I
	0x1C,0x08,0x08,0x08,0x08,0x48,0x30,0x00, // J
	0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x00, // K
	0x40,0x40,0x40,0x40,0x40,0x40,0x7C,0x00, // L
	0x44,0x6C,0x54,0x54,0x44,0x44,0x44,0x00, // M
	0x44,0x44,0x64,0x54,0x4C,0x44,0x44,0x00, // N
	0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00, // O
	0x78,0x44,0x44,0x78,0x40,0x40,0x40,0x00, // P
	0x38,0x44,0x44,0x44,0x54,0x48,0x34,0x00, // Q
	0x78,0x44,0x44,0x78,0x50,0x48,0x44,0x00, // R
	0x3C,0x40,0x40,0x38,0x04,0x04,0x78,0x00, // S
	0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x00, // T
	0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00, // U
	0x44,0x44,0x44,0x44,0x44,0x28,0x10,0x00, // V
	0x44,0x44,0x44,0x54,0x54,0x54,0x28,0x00, // W
	0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00, // X
	0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x00, // Y
	0x7C,0x04,0x08,0x10,0x20,0x40,0x7C,0x00, // Z
	0x38,0x20,0x20,0x20,0x20,0x20,0x38,0x00, // [
	0x00,0x40,0x20,0x10,0x08,0x04,0x00,0x00, // '\'
	0x38,0x08,0x08,0x08,0x08,0x08,0x38,0x00, // ]
	0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00, // ^
	0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00, // _
	0x20,0x10,0x08,0x00,0x00,0x00,0x00,0x00, // '
	0x00,0x00,0x38,0x04,0x3C,0x44,0x3C,0x00, // a
	0x40,0x40,0x58,0x64,0x44,0x44,0x78,0x00, // b
	0x00,0x00,0x38,0x40,0x40,0x44,0x38,0x00, // c
	0x04,0x04,0x34,0x4C,0x44,0x44,0x3C,0x00, // d
	0x00,0x00,0x38,0x44,0x7C,0x40,0x38,0x00, // e
	0x38,0x24,0x20,0x70,0x20,0x20,0x20,0x00, // f
	0x00,0x00,0x3C,0x44,0x44,0x3C,0x04,0x38, // g
	0x40,0x40,0x58,0x64,0x44,0x44,0x44,0x00, // h
	0x10,0x00,0x30,0x10,0x10,0x10,0x38,0x00, // i
	0x08,0x00,0x18,0x08,0x08,0x08,0x48,0x30, // j
	0x40,0x40,0x48,0x50,0x60,0x50,0x48,0x00, // k
	0x30,0x10,0x10,0x10,0x10,0x10,0x38,0x00, // l
	0x00,0x00,0x68,0x54,0x54,0x44,0x44,0x00, // m
	0x00,0x00,0x58,0x64,0x44,0x44,0x44,0x00, // n
	0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x00, // o
	0x00,0x00,0x58,0x64,0x64,0x58,0x40,0x40, // p
	0x00,0x00,0x34,0x4C,0x4C,0x34,0x04,0x04, // q
	0x00,0x00,0x58,0x64,0x40,0x40,0x40,0x00, // r
	0x00,0x00,0x3C,0x40,0x38,0x04,0x78,0x00, // s
	0x20,0x20,0x70,0x20,0x20,0x24,0x18,0x00, // t
	0x00,0x00,0x44,0x44,0x44,0x4C,0x34,0x00, // u
	0x00,0x00,0x44,0x44,0x44,0x28,0x10,0x00, // v
	0x00,0x00,0x44,0x44,0x54,0x54,0x28,0x00, // w
	0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x00, // x
	0x00,0x00,0x44,0x44,0x44,0x3C,0x04,0x38, // y
	0x00,0x00,0x7C,0x08,0x10,0x20,0x7C,0x00, // z
	0x10,0x20,0x20,0x40,0x20,0x20,0x10,0x00, // {
	0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00, // |
	0x20,0x10,0x10,0x08,0x10,0x10,0x20,0x00, // }
	0x00,0x00,0x00,0x20,0x54,0x08,0x00,0x00, // ~
};


//常用ASCII表
//偏移量32
//ASCII字符集
//偏移量32
//大小:8*16
//逐行式,顺向(高位在前)
/****************************************8*16的点阵************************************/
const unsigned char F8X16[]=	  
{
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
  0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,//! 1
  0x00,0x12,0x36,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2
  0x00,0x00,0x00,0x24,0x24,0x24,0xFE,0x48,0x48,0x48,0xFE,0x48,0x48,0x48,0x00,0x00,//# 3
  0x00,0x00,0x10,0x38,0x54,0x54,0x50,0x30,0x1C,0x14,0x14,0x54,0x54,0x38,0x10,0x10,//$ 4
  0x00,0x00,0x00,0x44,0xA4,0xA8,0xA8,0xA8,0x54,0x1A,0x2A,0x2A,0x2A,0x44,0x00,0x00,//% 5
  0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x50,0x6E,0xA4,0x94,0x88,0x89,0x76,0x00,0x00,//& 6
  0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7
  0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00,//( 8
  0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00,//) 9
  0x00,0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0x38,0xD6,0x10,0x10,0x00,0x00,0x00,0x00,//* 10
  0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x10,0x00,0x00,0x00,//+ 11
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x20,0xC0,//, 12
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//- 13
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,//. 14
  0x00,0x00,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00,/// 15
  0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,//0 16
  0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,//1 17
  0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,//2 18
  0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,//3 19
  0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,//4 20
  0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,//5 21
  0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,//6 22
  0x00,0x00,0x00,0x7E,0x42,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,//7 23
  0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,//8 24
  0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,//9 25
  0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,//: 26
  0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x08,0x30,0x00,//; 27
  0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,//< 28
  0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,//= 29
  0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00,//> 30
  0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x02,0x04,0x08,0x08,0x00,0x18,0x18,0x00,0x00,//? 31
  0x00,0x00,0x00,0x38,0x44,0x5A,0xAA,0xAA,0xAA,0xAA,0xB4,0x42,0x44,0x38,0x00,0x00,//@ 32
  0x00,0x00,0x00,0x10,0x10,0x18,0x28,0x28,0x24,0x3C,0x44,0x42,0x42,0xE7,0x00,0x00,//A 33
  0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x44,0x42,0x42,0x42,0x44,0xF8,0x00,0x00,//B 34
  0x00,0x00,0x00,0x3E,0x42,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x44,0x38,0x00,0x00,//C 35
  0x00,0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00,//D 36
  0x00,0x00,0x00,0xFE,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x42,0x42,0xFE,0x00,0x00,//E 37
  0x00,0x00,0x00,0xFE,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x40,0x40,0xE0,0x00,0x00,//F 38
  0x00,0x00,0x00,0x3C,0x44,0x44,0x80,0x80,0x80,0x8E,0x84,0x44,0x44,0x38,0x00,0x00,//G 39
  0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,//H 40
  0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,//I 41
  0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0xF0,//J 42
  0x00,0x00,0x00,0xEE,0x44,0x48,0x50,0x70,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00,//K 43
  0x00,0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0xFE,0x00,0x00,//L 44
  0x00,0x00,0x00,0xEE,0x6C,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x54,0x54,0xD6,0x00,0x00,//M 45
  0x00,0x00,0x00,0xC7,0x62,0x62,0x52,0x52,0x4A,0x4A,0x4A,0x46,0x46,0xE2,0x00,0x00,//N 46
  0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00,//O 47
  0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0xE0,0x00,0x00,//P 48
  0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0xB2,0xCA,0x4C,0x38,0x06,0x00,//Q 49
  0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x48,0x48,0x44,0x44,0x42,0xE3,0x00,0x00,//R 50
  0x00,0x00,0x00,0x3E,0x42,0x42,0x40,0x20,0x18,0x04,0x02,0x42,0x42,0x7C,0x00,0x00,//S 51
  0x00,0x00,0x00,0xFE,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,//T 52
  0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,//U 53
  0x00,0x00,0x00,0xE7,0x42,0x42,0x44,0x24,0x24,0x28,0x28,0x18,0x10,0x10,0x00,0x00,//V 54
  0x00,0x00,0x00,0xD6,0x92,0x92,0x92,0x92,0xAA,0xAA,0x6C,0x44,0x44,0x44,0x00,0x00,//W 55
  0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00,//X 56
  0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00,//Y 57
  0x00,0x00,0x00,0x7E,0x84,0x04,0x08,0x08,0x10,0x20,0x20,0x42,0x42,0xFC,0x00,0x00,//Z 58
  0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00,//[ 59
  0x00,0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x04,0x04,0x02,0x02,0x02,0x01,0x01,//\ 60
  0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00,//] 61
  0x00,0x08,0x14,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,//_ 63
  0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x1E,0x22,0x42,0x42,0x3F,0x00,0x00,//a 65
  0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x64,0x58,0x00,0x00,//b 66
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x22,0x1C,0x00,0x00,//c 67
  0x00,0x00,0x00,0x06,0x02,0x02,0x02,0x1E,0x22,0x42,0x42,0x42,0x26,0x1B,0x00,0x00,//d 68
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x40,0x42,0x3C,0x00,0x00,//e 69
  0x00,0x00,0x00,0x0F,0x11,0x10,0x10,0x7E,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,//f 70
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x44,0x44,0x38,0x40,0x3C,0x42,0x42,0x3C,//g 71
  0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,//h 72
  0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,//i 73
  0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x78,//j 74
  0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x4E,0x48,0x50,0x68,0x48,0x44,0xEE,0x00,0x00,//k 75
  0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,//l 76
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6,0x49,0x49,0x49,0x49,0x49,0xED,0x00,0x00,//m 77
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,//n 78
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,//o 79
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x64,0x58,0x40,0xE0,//p 80
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x22,0x42,0x42,0x42,0x26,0x1A,0x02,0x07,//q 81
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x32,0x20,0x20,0x20,0x20,0xF8,0x00,0x00,//r 82
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x40,0x3C,0x02,0x42,0x7C,0x00,0x00,//s 83
  0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x10,0x0C,0x00,0x00,//t 84
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00,//u 85
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x28,0x10,0x10,0x00,0x00,//v 86
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD7,0x92,0x92,0xAA,0xAA,0x44,0x44,0x00,0x00,//w 87
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x24,0x18,0x18,0x18,0x24,0x76,0x00,0x00,//x 88
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x28,0x18,0x10,0x10,0xE0,//y 89
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x08,0x10,0x10,0x22,0x7E,0x00,0x00,//z 90
  0x00,0x03,0x04,0x04,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x04,0x04,0x03,0x00,//{ 91
  0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,//| 92
  0x00,0x60,0x10,0x10,0x10,0x10,0x10,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x60,0x00,//} 93
  0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x52,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
};


typedef struct 
{
	unsigned char Index[2];	
	char Msk[32];
}typFNT_GB16; 

/*
输出格式:C51
数据排列:从左到右从上到下
取模方式:横向8点左高位
黑白取反:正常
字体种类:[HZK1616宋体]
强制转角:ASCII自动转全角
*/
const typFNT_GB16 cfont16[] = 
{
	"系",0x00,0xF8,0x3F,0x00,0x04,0x00,0x08,0x20,0x10,0x40,0x3F,0x80,0x01,0x00,0x06,0x10,
	0x18,0x08,0x7F,0xFC,0x01,0x04,0x09,0x20,0x11,0x10,0x21,0x08,0x45,0x04,0x02,0x00,
	
	"统",0x10,0x40,0x10,0x20,0x20,0x20,0x23,0xFE,0x48,0x40,0xF8,0x88,0x11,0x04,0x23,0xFE,
	0x40,0x92,0xF8,0x90,0x40,0x90,0x00,0x90,0x19,0x12,0xE1,0x12,0x42,0x0E,0x04,0x00,
	
	"设",0x00,0x00,0x21,0xF0,0x11,0x10,0x11,0x10,0x01,0x10,0x02,0x0E,0xF4,0x00,0x13,0xF8,
	0x11,0x08,0x11,0x10,0x10,0x90,0x14,0xA0,0x18,0x40,0x10,0xA0,0x03,0x18,0x0C,0x06,
	
	"置",0x7F,0xFC,0x44,0x44,0x7F,0xFC,0x01,0x00,0x7F,0xFC,0x01,0x00,0x1F,0xF0,0x10,0x10,
	0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0xFF,0xFE,0x00,0x00,
	
	"音",0x02,0x00,0x01,0x00,0x3F,0xF8,0x00,0x00,0x08,0x20,0x04,0x40,0xFF,0xFE,0x00,0x00,
	0x1F,0xF0,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,
	
	"量",0x00,0x00,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0xFF,0xFE,0x00,0x00,0x1F,0xF0,
	0x11,0x10,0x1F,0xF0,0x11,0x10,0x1F,0xF0,0x01,0x00,0x1F,0xF0,0x01,0x00,0x7F,0xFC,
	
	"颜",0x10,0x00,0x08,0xFE,0x7F,0x10,0x22,0x20,0x14,0x7C,0x7F,0x44,0x44,0x54,0x48,0x54,
	0x52,0x54,0x44,0x54,0x48,0x54,0x51,0x54,0x42,0x28,0x44,0x24,0x88,0x42,0x30,0x82,
	
	"色",0x08,0x00,0x08,0x00,0x1F,0xE0,0x20,0x20,0x40,0x40,0xBF,0xF8,0x21,0x08,0x21,0x08,
	0x21,0x08,0x3F,0xF8,0x20,0x00,0x20,0x02,0x20,0x02,0x20,0x02,0x1F,0xFE,0x00,0x00,
	
	"网",0x00,0x00,0x7F,0xFC,0x40,0x04,0x40,0x04,0x42,0x14,0x52,0x94,0x4A,0x54,0x44,0x24,
	0x44,0x24,0x4A,0x54,0x4A,0x54,0x52,0x94,0x61,0x04,0x40,0x04,0x40,0x14,0x40,0x08,
	
	"络",0x10,0x80,0x10,0x80,0x20,0xF8,0x21,0x08,0x4B,0x10,0xFC,0xA0,0x10,0x40,0x20,0xA0,
	0x41,0x18,0xFA,0x06,0x45,0xF8,0x01,0x08,0x19,0x08,0xE1,0x08,0x41,0xF8,0x01,0x08,
	
	"小",0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x40,0x05,0x20,0x09,0x10,
	0x09,0x08,0x11,0x04,0x21,0x04,0x41,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00,
	
	"星",0x00,0x08,0x3F,0xFC,0x20,0x08,0x3F,0xF8,0x20,0x08,0x3F,0xF8,0x01,0x00,0x21,0x08,
	0x3F,0xFC,0x21,0x00,0x41,0x10,0xBF,0xF8,0x01,0x00,0x01,0x04,0xFF,0xFE,0x00,0x00,
	
	"戴",0x08,0x20,0x7F,0x28,0x08,0x24,0xFF,0xFE,0x00,0x20,0x7F,0x20,0x49,0x24,0x7F,0x24,
	0x49,0x24,0x7F,0x28,0x22,0x28,0x7F,0x10,0x22,0x12,0xFF,0xAA,0x22,0x46,0x41,0x82,

	"创",0x08,0x04,0x08,0x04,0x14,0x04,0x12,0x24,0x21,0xA4,0x20,0xA4,0x7E,0x24,0xA2,0x24,
	0x22,0x24,0x2A,0x24,0x24,0x24,0x20,0x04,0x21,0x04,0x21,0x04,0x1F,0x14,0x00,0x08,

	"昆",0x00,0x08,0x3F,0xFC,0x20,0x08,0x20,0x08,0x3F,0xF8,0x20,0x08,0x20,0x08,0x3F,0xF8,
	0x00,0x80,0x20,0x84,0x24,0x98,0x3E,0xE0,0x20,0x80,0x20,0x82,0x2E,0x82,0x70,0x7E,
};
/


typedef struct
{
	unsigned char Index[2];
	char Msk[72];
}typFNT_GB24;

//宋体
//24*24大小
//逐行式,顺向(高位在前)
const typFNT_GB24 cfont24[] = 
{
	"戴",0x01,0x02,0x00,0x01,0xC3,0xA0,0x01,0x9B,0x30,0x1F,0xFB,0x10,0x01,0x83,0x00,0x01,
	0x83,0x0C,0x7F,0xFF,0xFE,0x00,0x01,0x80,0x1F,0xF9,0x80,0x19,0x99,0x90,0x1F,0xF9,
	0x9C,0x19,0x99,0x98,0x1F,0xF9,0xB0,0x06,0x61,0xB0,0x06,0x69,0xB0,0x3F,0xFD,0xE0,
	0x06,0x60,0xE4,0x06,0x68,0xC4,0x7F,0xFC,0xC4,0x04,0x81,0xE4,0x0E,0x63,0x34,0x18,
	0x36,0x1C,0x30,0x04,0x0E,0x40,0x18,0x06,
	
	"创",0x02,0x00,0x00,0x03,0x80,0x08,0x03,0x80,0x0E,0x06,0x60,0x0C,0x06,0x31,0x0C,0x0C,
	0x19,0xCC,0x0C,0x0D,0x8C,0x18,0x0D,0x8C,0x18,0x31,0x8C,0x2F,0xF9,0x8C,0x2C,0x31,
	0x8C,0x4C,0x31,0x8C,0x0C,0x31,0x8C,0x0C,0x31,0x8C,0x0C,0x61,0x8C,0x0F,0xE1,0x0C,
	0x0C,0xC8,0x0C,0x0C,0x08,0x0C,0x0C,0x08,0x0C,0x0C,0x0C,0x0C,0x0F,0xFC,0x0C,0x07,
	0xF8,0xFC,0x00,0x00,0x38,0x00,0x00,0x10,

	"昆",0x00,0x00,0x00,0x08,0x00,0x60,0x0F,0xFF,0xF0,0x0C,0x00,0x60,0x0C,0x00,0x60,0x0C,
	0x00,0x60,0x0F,0xFF,0xE0,0x0C,0x00,0x60,0x0C,0x00,0x60,0x0C,0x00,0x60,0x0F,0xFF,
	0xE0,0x08,0x08,0x40,0x10,0x0E,0x10,0x1C,0x0C,0x38,0x18,0xCC,0x60,0x1F,0xED,0x80,
	0x18,0x0E,0x04,0x18,0x0C,0x04,0x18,0x0C,0x04,0x18,0x0C,0x04,0x1F,0xCC,0x06,0x3E,
	0x0F,0xFE,0x10,0x07,0xFC,0x00,0x00,0x00,
};
/


typedef struct
{
	unsigned char Index[2];
	char Msk[128];
}typFNT_GB32;

//宋体
//32*32大小
//逐行式,顺向(高位在前)
const typFNT_GB32 cfont32[] = 
{
	"戴",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x08,0x00,0x00,0x30,0x0E,0x80,
0x00,0x30,0x8C,0x40,0x0F,0xFF,0xCC,0x70,0x00,0x30,0x0C,0x30,0x00,0x30,0x0C,0x30,
0x00,0x30,0x0C,0x18,0x3F,0xFF,0xFF,0xFC,0x08,0x00,0x4C,0x00,0x0F,0xFF,0xEC,0x00,
0x0C,0x30,0xCC,0x00,0x0C,0x30,0xCC,0x00,0x0F,0xFF,0xC4,0x38,0x0C,0x30,0xC4,0x30,
0x0C,0x30,0xC6,0x30,0x0F,0xFF,0xC6,0x70,0x0C,0x84,0xC6,0x60,0x00,0x87,0x06,0x60,
0x00,0x86,0x03,0xC0,0x0F,0xFF,0xC3,0xC0,0x00,0x86,0x03,0x80,0x00,0x86,0x21,0x82,
0x3F,0xFF,0xF3,0xC4,0x00,0x88,0x0E,0xC4,0x01,0xC6,0x04,0x64,0x03,0x03,0x08,0x3C,
0x06,0x01,0x90,0x1C,0x18,0x01,0x20,0x0C,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,/*"戴",0*/
/* (32 X 32 , 宋体 )*/

"创",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x70,0x00,0x18,
0x00,0xE0,0x00,0x18,0x00,0xD8,0x00,0x18,0x01,0x8E,0x00,0x18,0x01,0x83,0x00,0x18,
0x01,0x01,0x84,0x18,0x03,0x01,0xC6,0x18,0x02,0x00,0x84,0x18,0x04,0x00,0x04,0x18,
0x0C,0x02,0x04,0x18,0x0F,0xFF,0x04,0x18,0x16,0x06,0x04,0x18,0x26,0x06,0x04,0x18,
0x46,0x06,0x04,0x18,0x06,0x06,0x04,0x18,0x06,0x06,0x04,0x18,0x06,0x06,0x04,0x18,
0x06,0x06,0x04,0x18,0x06,0x3C,0x04,0x18,0x06,0x18,0x04,0x18,0x06,0x00,0x40,0x18,
0x06,0x00,0x40,0x18,0x06,0x00,0x40,0x18,0x06,0x00,0x40,0x18,0x02,0x00,0xC0,0x18,
0x03,0xFF,0xE3,0xF8,0x03,0xFF,0xC0,0xF0,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,/*"创",1*/
/* (32 X 32 , 宋体 )*/

"昆",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,
0x01,0xFF,0xFF,0xC0,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0xFF,0xFF,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0xFF,0xFF,0x80,0x01,0x80,0x01,0x80,
0x00,0x00,0x40,0x00,0x03,0x00,0x70,0x00,0x03,0x00,0x60,0x20,0x03,0x00,0x60,0x70,
0x03,0x04,0x61,0xC0,0x03,0xFE,0x63,0x00,0x03,0x00,0x7C,0x00,0x03,0x00,0x60,0x08,
0x03,0x00,0x60,0x08,0x03,0x00,0x60,0x08,0x03,0x01,0x60,0x08,0x03,0x1E,0x60,0x0C,
0x03,0xE0,0x77,0xFC,0x07,0x80,0x7F,0xFC,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"昆",2*/
/* (32 X 32 , 宋体 )*/
};
/


unsigned char BMP2[] =
{
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x7F,0xE0,0x03,0x91,0x1C,0x38,0x18,0x00,0x70,0x00,0xFF,0xFC,0x00,0x07,0xFF,0xFE,
	0x66,0x60,0x04,0x5B,0x22,0x44,0x14,0x01,0x8C,0x01,0x7F,0xFA,0x00,0x04,0x00,0x02,
	0x36,0xC0,0x08,0x15,0x40,0x80,0x52,0x02,0x02,0x01,0xBF,0xF6,0x00,0x3D,0xB6,0xDA,
	0x1F,0x80,0x88,0x11,0x40,0x80,0x34,0x04,0x71,0x01,0xDF,0xEE,0x00,0x25,0xB6,0xDA,
	0x0F,0x02,0x88,0x11,0x40,0x80,0x18,0x00,0x88,0x01,0xE0,0x1E,0x00,0x25,0xB6,0xDA,
	0x06,0x0A,0x88,0x11,0x40,0x80,0x34,0x01,0x04,0x01,0xDF,0xEE,0x00,0x25,0xB6,0xDA,
	0x06,0x2A,0x88,0x11,0x40,0x80,0x52,0x00,0x20,0x01,0xBF,0xF6,0x00,0x3D,0xB6,0xDA,
	0x06,0xAA,0x84,0x51,0x22,0x44,0x14,0x00,0x70,0x01,0x7F,0xFA,0x00,0x04,0x00,0x02,
	0x06,0xAA,0x83,0x91,0x1C,0x38,0x18,0x00,0x20,0x00,0xFF,0xFC,0x00,0x07,0xFF,0xFE,
	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,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x1F,0xFC,0x00,0x3F,0xFC,0x7F,0xF0,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x07,0x3F,0xFE,0x00,0x7F,0xFC,0xFF,0xF8,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x0F,0x30,0x06,0x00,0x60,0x00,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x1B,0x30,0x06,0x00,0x60,0x00,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x33,0x30,0x06,0x00,0x60,0x00,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x63,0x30,0x06,0x18,0x60,0x00,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0xC3,0x30,0x06,0x18,0x7F,0xFC,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x83,0x30,0x06,0x00,0x7F,0xFC,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x3F,0xFE,0x00,0x00,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x3F,0xFE,0x00,0x00,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x30,0x06,0x00,0x00,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x30,0x06,0x18,0x00,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x30,0x06,0x18,0x00,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x30,0x06,0x00,0x00,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x30,0x06,0x00,0x60,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x30,0x06,0x00,0x60,0x0C,0xC0,0x18,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x3F,0xFE,0x00,0x7F,0xFC,0xFF,0xF8,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x1F,0xFC,0x00,0x3F,0xF8,0x7F,0xF0,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,0xF9,0xE3,0x0F,0x00,0xF1,0xE0,0x1E,0x3C,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x01,0x0A,0x15,0x10,0x81,0x0A,0x10,0x21,0x42,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x12,0x11,0x10,0x81,0x0A,0x00,0x21,0x40,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x22,0x11,0x1F,0x81,0x0B,0xE0,0x21,0x7C,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x42,0x11,0x10,0x81,0x0A,0x10,0x21,0x42,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x82,0x11,0x10,0x99,0x0A,0x13,0x21,0x42,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x01,0xF9,0xE7,0xCF,0x18,0xF1,0xE3,0x1E,0x3C,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,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,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x41,0x1C,0x41,0x41,0x00,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x00,0x82,0x7C,0x82,
	0x63,0x22,0x61,0x41,0x00,0x00,0x00,0x00,0xF1,0x00,0x00,0x00,0x00,0xC6,0x82,0xC2,
	0x55,0x41,0x51,0x41,0x00,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x00,0xAA,0x80,0xA2,
	0x49,0x7E,0x49,0x41,0x00,0x00,0x00,0x00,0xFD,0x00,0x00,0x00,0x00,0x92,0x7C,0x92,
	0x41,0x40,0x45,0x41,0x00,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x00,0x82,0x02,0x8A,
	0x41,0x21,0x43,0x22,0x00,0x00,0x00,0x00,0xF1,0x00,0x00,0x00,0x00,0x82,0x82,0x86,
	0x41,0x1E,0x41,0x1C,0x00,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x00,0x82,0x7C,0x82,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};


unsigned char BMP3[] =
{
	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,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,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,0x03,0xF8,0x03,0xFF,0xF8,0x03,0xC0,0xF0,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x0F,0xFE,0x03,0xFF,0xF8,0x07,0xF3,0xFC,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x18,0x03,0x03,0x00,0x00,0x0F,0xFF,0xFE,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x30,0x01,0x83,0x00,0x00,0x1F,0xFF,0xFF,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC3,0x00,0x00,0x1F,0xFF,0xFF,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC3,0x00,0x00,0x1F,0xFF,0xFF,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC3,0x00,0x00,0x0F,0xFF,0xFE,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC3,0x00,0x00,0x0F,0xFF,0xFE,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x30,0x01,0x83,0x7F,0xC0,0x07,0xFF,0xFC,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x30,0x03,0x03,0xFF,0xF0,0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x18,0x06,0x03,0x80,0x38,0x01,0xFF,0xF0,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x0F,0xFC,0x03,0x00,0x18,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x1F,0xFF,0x00,0x00,0x0C,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x30,0x01,0x80,0x00,0x0C,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC0,0x00,0x0C,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC0,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC0,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC0,0x00,0x0C,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC0,0x00,0x0C,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC6,0x00,0x0C,0x1E,0x38,0xCC,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x60,0x00,0xC7,0x00,0x1C,0x11,0x45,0x32,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x30,0x01,0x83,0x80,0x38,0x11,0x45,0x22,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x1F,0xFF,0x01,0xFF,0xF0,0x11,0x45,0x22,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x0F,0xFE,0x00,0x7F,0xC0,0x11,0x45,0x22,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x79,0x22,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,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,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x22,0x00,0x90,0x04,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x42,0x00,0x90,0x04,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x06,0x40,0x41,0x01,0x08,0x08,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x04,0x20,0x81,0x01,0x08,0x08,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x08,0x20,0x81,0x02,0x04,0x10,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x08,0x20,0x80,0x82,0x04,0x10,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x10,0x21,0x00,0x82,0x02,0x10,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x20,0x11,0x00,0x84,0x02,0x10,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x40,0x12,0x00,0x44,0x02,0x20,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x80,0x12,0x00,0x48,0x01,0x20,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x48,0x01,0x20,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x30,0x01,0x20,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x30,0x00,0xC0,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,
};



unsigned char BMP4[] =
{
	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,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x01,0x00,0x0F,0xC0,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x00,0x1F,0xFE,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x00,0x3F,0xFF,0xFF,0x00,0x00,0x10,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x07,0x00,0x7F,0xFF,0xFF,0xFF,0xC0,0x10,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x06,0x00,0xFF,0xFF,0xFF,0xFF,0xE0,0x10,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x06,0x03,0xFF,0xFF,0xFF,0xFF,0xE0,0x20,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x06,0x0F,0xFF,0xFF,0xFF,0xFF,0xE0,0x60,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x06,0x3F,0xFF,0xFF,0xFF,0xFF,0xF0,0xC0,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x07,0x3C,0x3F,0xFF,0xF8,0x7F,0xF1,0x80,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x07,0x3F,0xFF,0xFF,0xFF,0xFF,0xF1,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x3F,0xFF,0xFF,0xFF,0xFF,0xF3,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x20,0x00,0xFF,0x00,0x07,0xF2,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x01,0x0F,0xFF,0x7E,0xFF,0xFB,0xE7,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x01,0x9F,0x7F,0x81,0xFD,0xFC,0x0F,0x80,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x01,0xBE,0x3F,0x9D,0xF8,0xFD,0xFF,0x80,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0xDF,0x7F,0xBC,0xFD,0xFB,0xFF,0x80,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x67,0xFE,0x7E,0x7F,0xE3,0xFF,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x38,0x01,0xFF,0x80,0x0F,0xFE,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x07,0xFE,0x00,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xC7,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xE0,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,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x01,0x83,0x80,0x61,0xC0,0x00,0x00,0x00,
	0x00,0x00,0x00,0x0F,0x80,0xF0,0x00,0x00,0x07,0x82,0xE3,0xE1,0xB0,0x00,0x00,0x00,
	0x00,0x00,0x00,0x0F,0x80,0x1C,0x00,0x00,0x0C,0x6C,0x02,0x3F,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x0E,0x00,0x03,0x00,0x00,0x00,0xFE,0x00,0x3F,0x80,0x00,0x00,0x00,
	0x00,0x00,0x00,0x06,0x00,0xF1,0x80,0x00,0x0F,0x81,0xF7,0xC0,0x7C,0x00,0x00,0x00,
	0x00,0x00,0x00,0x03,0x80,0x18,0x80,0x00,0x03,0xFF,0x80,0xFF,0xE0,0x00,0x00,0x00,
	0x00,0x00,0x00,0x01,0xC0,0x0C,0x40,0x00,0x02,0x18,0x81,0x8C,0x60,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0xE1,0x84,0x40,0x00,0x02,0x18,0x81,0x8C,0x60,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x7F,0xC2,0x40,0x00,0x03,0xFF,0x81,0xFF,0xE0,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x3F,0xE2,0x40,0x00,0x02,0x00,0x31,0x80,0x0C,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x0F,0xC0,0x00,0x00,0x03,0xFF,0xF0,0xFF,0xFC,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xC0,0x7F,0xF0,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,
};


//	 
//
//存储图片数据,图片大小为51*32像素
//逐行式,顺向(高位在前)
//
/
unsigned char BMP5[] =
{
	0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
	0x0E,0x00,0x00,0x00,0x00,0x01,0x80,0x0E,0x00,0x20,0x00,0x00,0x01,0xC0,0x00,0x00,
	0x70,0x00,0x00,0x00,0xC0,0x00,0x00,0xE0,0x00,0x00,0x00,0xE0,0x3F,0x81,0xC0,0x00,
	0x00,0x00,0x61,0xFF,0xF0,0x80,0x00,0x00,0x00,0x03,0xC0,0xF8,0x00,0x00,0x00,0x00,
	0x07,0x00,0x1C,0x00,0x00,0x00,0x00,0x1E,0x00,0x0F,0x00,0x00,0x00,0x7C,0x1C,0x00,
	0x03,0x1F,0x80,0x00,0x7C,0x1C,0x07,0xFF,0x1F,0x80,0x00,0x7C,0x1C,0x1F,0xFF,0x9F,
	0x80,0x00,0x00,0x1C,0x7C,0x03,0xF8,0x00,0x00,0x00,0x0F,0xF0,0x00,0x7C,0x00,0x00,
	0x03,0xFF,0x00,0x00,0x0F,0xE0,0x00,0x0F,0xF2,0x00,0x00,0x07,0xFE,0x00,0x1F,0x80,
	0x00,0x00,0x00,0x7F,0x80,0x3C,0x00,0x00,0x00,0x00,0x03,0x80,0x7C,0x00,0x00,0x00,
	0x00,0x03,0xC0,0x70,0x00,0x00,0x00,0x00,0x01,0xC0,0x70,0x00,0x00,0x00,0x00,0x01,
	0xC0,0x78,0x00,0x00,0x00,0x00,0x01,0xC0,0x7C,0x00,0x00,0x00,0x00,0x03,0xC0,0x3C,
	0x00,0x00,0x00,0x00,0x07,0x80,0x3E,0x00,0x00,0x00,0x00,0x3F,0x80,0x0F,0xE1,0xC0,
	0x00,0x1F,0xFC,0x00,0x03,0xFF,0xFC,0x03,0xFF,0xF0,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
	0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00,0x00,
};



#endif


效果

oled6针显示代码,stm32,单片机,arm
oled6针显示代码,stm32,单片机,arm
oled6针显示代码,stm32,单片机,arm
oled6针显示代码,stm32,单片机,arm
oled6针显示代码,stm32,单片机,arm
oled6针显示代码,stm32,单片机,arm

源码

链接:https://pan.baidu.com/s/1_zuSjLBjeIckoJaUDEGWWg?pwd=1234
提取码:1234

模拟SPI控制方式

模拟SPI通信主要特点是方便移植,任意IO口输出即可。文章来源地址https://www.toymoban.com/news/detail-581649.html

到了这里,关于STM32F103硬件SPI控制6针/7针0.96寸OLED显示屏的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • STM32 F103C8T6学习笔记8:0.96寸单色OLED显示屏显示字符

    使用STM32F103 C8T6 驱动0.96寸单色OLED显示屏: OLED显示屏的驱动,在设计开发中OLED显示屏十分常见,因此今日学习一下。一篇文章从程序到显示都讲通。 文章提供源码、原理解释、测试工程下载,测试效果图展示。   目录 OLED驱动原理—IIC通信: SSD1306 单色 0.96 OLED 显示屏特性

    2024年02月12日
    浏览(56)
  • STM32F103硬件SPI驱动ADS1256

    最近实验室有几个项目都需要用到高分辨率AD转换,于是就开始了ADS1256的开发。 新手,焊得丑,见谅(能用就行) 二: 本以为很容易就能做完,结果被采样速率的问题困扰了很久。 代码如下,使用2.5V基准源进行测试,结果在读ADS时经常出现读出0xFFFFFF的情况,只能忍住悲伤

    2024年02月12日
    浏览(75)
  • STM32 F103C8T6学习笔记9:0.96寸单色OLED显示屏—自由取模显示—显示汉字与图片

    今日学习0.96寸单色OLED显示屏的自由取模显示: 宋体汉字比较复杂,常用字符可以直接复制存下来,毕竟只有那么几十个字母字符,但汉字实在太多了,基本不会全部放在单片机里存着,一般用到多少个字就取几个字的模,因此汉字放在这里与自由取模一起讲。 文章提供源码

    2024年02月11日
    浏览(45)
  • 7针0.96寸OLED的HAL库代码(硬件SPI/全代码/stm32f1/CubeMX配置/包含有正负浮点数/100%一次点亮)

    HC-SR04超声波模块的使用  编码电机以及双电机驱动 4针 0.96\\\'OLED的使用 更多有意思的文章点击“我的主页” --------😐 更多有意思的视频 ----- B站 @想要亿只独角兽 --------😐 之前发布了一篇硬件I2C的0.96\\\' OLED驱动代码,这次就添加一篇硬件SPI的驱动代码。 其实改动的代码不多,

    2024年02月16日
    浏览(47)
  • 0.96OLED STM32 SPI驱动(一)

    闲来无聊,翻出了一个OLED,本来想串流做个小显示器用,感觉难度太大。将就变成了下面这 个样子,姑且叫火柴人大乱斗之OLED。 火柴人之OLED 分两步走,先驱动OLED能显示一副图片,本篇讲述此内容。 第二步显示动画,放在下一篇中讲。 查资料得到此OLED为SPI通信,SCL对应连

    2024年02月06日
    浏览(53)
  • STM32--7针0.96寸OLED屏幕显示(4线SPI)

    本文介绍基于STM32F103C8T6+0.96寸OLED(7针)的显示(完整程序代码见文末链接) 一、简介 OLED,即有机发光二极管( Organic Light Emitting Diode)。 OLED 由于同时具备自发光,不需背光源、对比度高、厚度薄、视角广、反应速度快、可用于挠曲性面板、使用温度范围广、构造及制程较

    2024年01月16日
    浏览(50)
  • 【STM32+HAL库】---- 硬件IIC驱动0.96OLED

    代码借鉴学习于以下文章: STM32 使用硬件IIC驱动0.96寸4针IOLED显示器(HAL库) 略... 点击查看代码 首先在 main.c 中引入头文件 随即根据要求在 main函数 中添加对应功能函数即可 【 注意 】使用时应将编译器编码选项选择为 GBK系列 ,否则编译报错,尤其注意通过keil修改后,再

    2024年02月19日
    浏览(38)
  • STM32F103C8T6—库函数应用I2C/SPI驱动OLED显示中文、字符串

    I2C(Inter-Integrated Circuit) SPI(Serial Peripheral Interface) 传输方式 半双工 全双工 传输速度 低速,100Kbps----4Mbps 高速,30Mbps以上 几线制 4线制:VCC,GND,SCL,SDA 6/7线制:VCC,GND,SCLK(D0),MOSI(D1/SDA),DC,CS/SS 主从模式 多主机总线,通过SDA上的地址信息锁定从机 只有一个主机,主

    2024年02月02日
    浏览(61)
  • 【STM32CubeIDE】STM32F103硬件SPI驱动1.8寸TFT LCD128X160 ST7735S屏幕

    ✨虽然STM32CubeIDE也是基于HAL库,但是还是不能直接转Keil MDK工程,本驱动案例从GitHub下载来的,原始工程使用的是较老版本的STM32CubeIDE配置的,没法在继续在新版本上程序配置,工程只是做了初始化配置。程序并不能直接被点亮,重新配置了lcd初始化函数以及复位函数后,才

    2024年02月12日
    浏览(41)
  • GD32F103 硬件SPI通信

    SPI既可以做主机也可以做从机。 当做主机时。MOSI,SCK,CS都是作为输出。 而作为从机时。MOSI,SCK,CS都是作为输入。  所以SPI的硬件电路应该实现这样的功能。 1. GD32框图 如下图做主机的数据流向:   如下图做从机的数据流向:    2. STM32框图  通过一些寄存器的配置来控制

    2024年02月02日
    浏览(43)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包