您的当前位置:首页OLED(SSD1306)基于STM32寄存器版驱动

OLED(SSD1306)基于STM32寄存器版驱动

2021-10-29 来源:爱问旅游网
OLED(SSD1306)基于STM32寄存器版驱动

基于STM32的OLED(SSD1306)寄存器版编译即可⽤!OLED的头⽂件#ifndef _OLED_H#define _OLED_H#include \"sys.h\"

/*//////////////////////////////////////////////////////////////////////////////////////////////////// //SSD1306,当接⼝为SPI的驱动//功能简介:显⽰字符,字符串,数字,和⼩区域屏幕填充//作者:范桢⼲//时间:2016.1.6

*/////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////接⼝定义///////////#define OLED_SCLK P Cout(10)#define OLED_SDA PBout(15)#define OLED_RST PBout(13)#define OLED_DC PBout(11)//#define OLED_CS PAout(4)

//////////////////////////////////////////////////////////////////////////////////////////////////////

void OLED_Init(void); //OLED初始化void OLED_Clear(u8 Fill); //OLED清屏/清屏void OLED_ShowChar(u8 uPage_sta,u8uColumn_sta,u8 uSize,u8 uChar); //在指定Page_sta,Column_sta和Size输⼊字符Char

void OLED_ShowString(u8 uPage_sta,u8 uColumn_sta,u8 uSize,u8 *p); //在指定Page_sta,Column_sta处输⼊⼤⼩为Size的字符串*p

void OLED_ShowNum(u8 uPage,u8 uColumn_sta,u8 uSize,u32 uNum); //在指定Page_sta,Column_sta处输⼊⼤⼩为Size的数字uNum,范围:(0~4294967295)

void OLED_Fill(u8 uPage_sta,u8 uColumn_sta,u8 uColumn_end,u8 Fill); //在Page_sta,从uColumn_sta到uColumn_end填充或清屏#endifOLED的C⽂件#include \"oled.h\"#include \"delay.h\"#include \"ASCII.h\"

//函数名称:void OLED_WriteCmd(u8 uCmd) //函数功能:OLED写⼀个指令//函数参数:uCmd:写⼊的指令void OLED_WriteCmd(u8 uCmd){

u8 i;

OLED_DC=0; //写指令for(i=0;i<8;i++){

OLED_SCLK=0;

if(uCmd&0x80) //先发送⾼位{ OLED_SDA=1;}else

{ OLED_SDA=0;}

OLED_SCLK=1;uCmd<<=1; //左移⼀位}OLED_SCLK=0;}

//函数名称:void OLED_WriteDat(u8 uDat) //函数功能:OLED写⼀个数据//函数参数:uDat:写⼊的数据void OLED_WriteDat(u8 uDat){u8 i;

OLED_DC=1; //写数据for(i=0;i<8;i++){

OLED_SCLK=0;

if(uDat&0x80) //先发送⾼位{ OLED_SDA=1;}else

{ OLED_SDA=0;}

OLED_SCLK=1;uDat<<=1; //左移⼀位}

OLED_SCLK=0;}

//函数名称:void OLED_Init(void)//函数功能:OLED初始化void OLED_Init(void){

RCC->APB2ENR|=1<<3; //使能PORTB时钟RCC->APB2ENR|=1<<4; //使能PORTC时钟GPIOB->CRH&=0X0F0F0FFF;

GPIOB->CRH|=0X30303000; //PB11,13,15推挽输出GPIOC->CRH&=0XFFFFF0FF;

GPIOC->CRH|=0X00000300; //PC10推挽输出OLED_RST=0; //低电平复位delay_ms(10);

OLED_RST=1; //复位完毕delay_ms(20);

OLED_WriteCmd(0xAE); //关OLED显⽰OLED_WriteCmd(0xD5); //设置时钟OLED_WriteCmd(0x80);

OLED_WriteCmd(0x20); //RAM Addressing ModeOLED_WriteCmd(0x01); //Vertical Addressing Mode

OLED_WriteCmd(0xA8); //设置驱动路数(set Multiplex Ratio) OLED_WriteCmd(0x3F);OLED_WriteCmd(0xD3); //set offsetOLED_WriteCmd(0x00);

OLED_WriteCmd(0x40); //Set Start LineOLED_WriteCmd(0xA1); //Set Remap

OLED_WriteCmd(0xC8); //Output Scan DirectionOLED_WriteCmd(0xDA); //Pins ConfigurationOLED_WriteCmd(0x12);

OLED_WriteCmd(0x81); //设置对⽐度(Set Contrast Ratio)OLED_WriteCmd(0xCF); //128(0-255)OLED_WriteCmd(0xD9); //Set Pre-ChagreOLED_WriteCmd(0xF1);

OLED_WriteCmd(0xD8); //Set VcomhOLED_WriteCmd(0x30);

OLED_WriteCmd(0xA4); //Display Accordding to GDDRAM OLED_WriteCmd(0xA6); //Set Normal DisplayOLED_WriteCmd(0x8D); //Set Charge Pump

OLED_WriteCmd(0x14);OLED_WriteCmd(0xAF); //开显⽰delay_ms(100); //等待开启显⽰OLED_Clear(0); //清屏}

//函数名称:void OLED_Clear(u8 Fill)//函数功能:OLED填充/清屏//函数参数:Fill,填充或者清除void OLED_Clear(u8 Fill){u8 i,j;

OLED_WriteCmd(0x22); //Page AddressOLED_WriteCmd(0x00); //Page Start AddressOLED_WriteCmd(0x07); //Page End AddressOLED_WriteCmd(0x21); //Column AddressOLED_WriteCmd(0x00); //Column Start AddressOLED_WriteCmd(0x7F); //Column Start Addressfor(i=0;i<128;i++)for(j=0;j<8;j++){

{ OLED_WriteDat(0xFF);}else

{ OLED_WriteDat(0x00);}}}

//函数名称:void OLED_ShowChar(u8 uPage_sta,u8 uColumn_sta,u8 uSize,u8 uChar)//函数功能:在指定Page_sta,Column_sta处输⼊⼤⼩为Size的字符Char

//函数参数:uPage_sta:页数,uColumn_sta:列数,uSize:字体⼤⼩,uChar:输⼊的字符//注意:本字符输⼊函数增加了⾃动换⾏换页功能!!!!!void OLED_ShowChar(u8 uPage_sta,u8 uColumn_sta,u8 uSize,u8 uChar){

#define MAX_CHAR_X 127 //Column限制#define MAX_CHAR_Y 7 //Page限制

u8 uChar_Buf;u8 uCount;

u8 uPage_end,uColumn_end;u8 i;

if(uSize==6) //如果是8x6字体

{ uPage_end=uPage_sta; //赋值Page_end

uColumn_end=uColumn_sta+uSize; //赋值Cloumn_enduCount=6; //赋值uCount}

else if(uSize==8) //如果是16x8字体

{ uPage_end=uPage_sta+1; //赋值Page_end

uColumn_end=uColumn_sta+uSize; //赋值Cloumn_enduCount=16; //赋值uCount}else

{ return; //uSize错误}

/////////////////////////////////⾃动换⾏换页////////////////////////////////////////////////////////////////////////////////////////////////////// if(uColumn_end>MAX_CHAR_X)//如果Cloumn>127{

uColumn_sta=0; //Column_sta=0uColumn_end=uColumn_sta+uSize;{ uPage_sta=uPage_sta+1; //Page_sta+1uPage_end=uPage_sta;}else

{ uPage_sta=uPage_sta+2; //Page_sta+2uPage_end=uPage_sta+1;}}

if(uPage_end>MAX_CHAR_Y) //如果Page>7{

uPage_sta=0; //Page_sta=0if(uSize==6)

{ uPage_end=uPage_sta;}

else

{ uPage_end=uPage_sta+1;}}

/////////////////////////////////⾃动换⾏换页////////////////////////////////////////////////////////////////////////////////////////////////////// OLED_WriteCmd(0x22); //PageAddress

OLED_WriteCmd(0x00+uPage_sta); //Start Page AddressOLED_WriteCmd(0x00+uPage_end); //End Page AddressOLED_WriteCmd(0x21); //Column Address

OLED_WriteCmd(0x00+uColumn_sta); //Start Column AddressOLED_WriteCmd(0x00+uColumn_end); //End Column AddressuChar=uChar-' '; //获得偏移量for(i=0;i{

if(uSize==8)

{ uChar_Buf=ASCII_1608[uChar][i];}else

{ uChar_Buf=ASCII_0806[uChar][i];}

OLED_WriteDat(uChar_Buf);}}

//函数名称:void OLED_ShowString(u8 uPage_sta,u8 uColumn,u8 uSize,u8 *p)//函数功能:在指定Page_sta,Column_sta处输⼊⼤⼩为Size的字符串*p

//函数参数:uPage_sta:页数,uColumn_sta:列数,uSize:字体⼤⼩,*p:输⼊的字符串指针//注意:本字符串输⼊函数增加了⾃动换⾏换页功能

void OLED_ShowString(u8 uPage_sta,u8 uColumn_sta,u8 uSize,u8 *p){

while(*p!='\\0'){

/////////////////////////////////⾃动换⾏换页//////////////////////////////////////////////////////////////////////////////////////////////////////if((uColumn_sta+uSize)>MAX_CHAR_X){ uColumn_sta=0;if(uSize==6)

{ uPage_sta=uPage_sta+1; //Page_sta+1}

else

{ uPage_sta=uPage_sta+2; //Page_sta+2}}

if(uSize==6)

{ if(uPage_sta>MAX_CHAR_Y){ uPage_sta=0;}}else

{ if((uPage_sta+1)>MAX_CHAR_Y){ uPage_sta=0;}}

/////////////////////////////////⾃动换⾏换页//////////////////////////////////////////////////////////////////////////////////////////////////////OLED_ShowChar(uPage_sta,uColumn_sta,uSize,*p);uColumn_sta+=uSize;p++;}}

//m^n函数

u32 mypow(u8 m,u8 n){

u32 result=1;while(n--)result*=m;return result;}

//功能:计算整数长度数字0长度为1u8 LongCheck(u32 num){u8 len=0;

if(num==0) //数字0长度也为1{ return 1;}

while(num)

{ num/=10;len++;}

return len;}

//函数名称:void OLED_ShowNum(u8 uPage_sta,u8 uColumn_sta,u8 uSize,u32 uNum)//函数功能:在指定Page_sta,Column_sta处输⼊⼤⼩为Size的数字uNum,范围:(0~4294967295)

//函数参数:uPage_sta:页数,uColumn_sta:列数,uSize:字体⼤⼩,uNum:输⼊的数字void OLED_ShowNum(u8uPage_sta,u8 uColumn_sta,u8 uSize,u32 uNum){

u8 i,temp;u8 len;

len=LongCheck(uNum); //算出长度for(i=0;i{

temp=(uNum/mypow(10,len-i-1))%10;

OLED_ShowChar(uPage_sta,uColumn_sta,uSize,temp+'0');uColumn_sta+=uSize;}}

//函数名称:void OLED_Fill(u8 uPage_sta,u8 uColumn_sta,u8 uColumn_end,u8 Fill)//函数功能:在Page_sta,从uColumn_sta到uColumn_end填充或清屏

//函数参数:uPage_sta:页数,uColumn_sta:列开始,uColumn_end:列结束,Fill:填充/清除void OLED_Fill(u8 uPage_sta,u8 uColumn_sta,u8 uColumn_end,u8 Fill){u8 i;u8 ulen;

OLED_WriteCmd(0x22); //Page Address

OLED_WriteCmd(0x00+uPage_sta); //Start Page AddressOLED_WriteCmd(0x00+uPage_sta); //End Page Address

OLED_WriteCmd(0x21); //Column Address OLED_WriteCmd(0x00+uColumn_sta); //Start Column AddressOLED_WriteCmd(0x00+uColumn_end); //End Column Addressulen=uColumn_end-uColumn_sta+1;for(i=0;i<=ulen;i++){if(Fill)

{ OLED_WriteDat(0xff); //填充}else

{ OLED_WriteDat(0x00); //清除}}}

ASCII码字库#ifndef _ASCII_H#define _ASCII_H//常⽤ASCII表//纵向取模//偏移量:32//⼤⼩:16*8

const unsigned char ASCII_1608[95][16]={

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\" \{0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x33,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00},//\"!\{0x00,0x00,0x10,0x00,0x0C,0x00,0x06,0x00,0x10,0x00,0x0C,0x00,0x06,0x00,0x00,0x00},//\"\"\{0x40,0x04,0xC0,0x3F,0x78,0x04,0x40,0x04,0xC0,0x3F,0x78,0x04,0x40,0x04,0x00,0x00},//\"#\{0x00,0x00,0x70,0x18,0x88,0x20,0xFC,0xFF,0x08,0x21,0x30,0x1E,0x00,0x00,0x00,0x00},//\"$\{0xF0,0x00,0x08,0x21,0xF0,0x1C,0x00,0x03,0xE0,0x1E,0x18,0x21,0x00,0x1E,0x00,0x00},//\"%\{0x00,0x1E,0xF0,0x21,0x08,0x23,0x88,0x24,0x70,0x19,0x00,0x27,0x00,0x21,0x00,0x10},//\"&\{0x10,0x00,0x16,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\"'\{0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x07,0x18,0x18,0x04,0x20,0x02,0x40,0x00,0x00},//\"(\{0x00,0x00,0x02,0x40,0x04,0x20,0x18,0x18,0xE0,0x07,0x00,0x00,0x00,0x00,0x00,0x00},//\")\{0x40,0x02,0x40,0x02,0x80,0x01,0xF0,0x0F,0x80,0x01,0x40,0x02,0x40,0x02,0x00,0x00},//\"*\{0x00,0x01,0x00,0x01,0x00,0x01,0xF0,0x1F,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x00},//\"+\{0x00,0x80,0x00,0xB0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\{0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},//\"-\{0x00,0x00,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\".\{0x00,0x00,0x00,0x60,0x00,0x18,0x00,0x06,0x80,0x01,0x60,0x00,0x18,0x00,0x04,0x00},//\"/\{0x00,0x00,0xE0,0x0F,0x10,0x10,0x08,0x20,0x08,0x20,0x10,0x10,0xE0,0x0F,0x00,0x00},//\"0\{0x00,0x00,0x10,0x20,0x10,0x20,0xF8,0x3F,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00},//\"1\{0x00,0x00,0x70,0x30,0x08,0x28,0x08,0x24,0x08,0x22,0x88,0x21,0x70,0x30,0x00,0x00},//\"2\{0x00,0x00,0x30,0x18,0x08,0x20,0x88,0x20,0x88,0x20,0x48,0x11,0x30,0x0E,0x00,0x00},//\"3\{0x00,0x00,0x00,0x07,0xC0,0x04,0x20,0x24,0x10,0x24,0xF8,0x3F,0x00,0x24,0x00,0x00},//\"4\{0x00,0x00,0xF8,0x19,0x08,0x21,0x88,0x20,0x88,0x20,0x08,0x11,0x08,0x0E,0x00,0x00},//\"5\{0x00,0x00,0xE0,0x0F,0x10,0x11,0x88,0x20,0x88,0x20,0x18,0x11,0x00,0x0E,0x00,0x00},//\"6\{0x00,0x00,0x38,0x00,0x08,0x00,0x08,0x3F,0xC8,0x00,0x38,0x00,0x08,0x00,0x00,0x00},//\"7\{0x00,0x00,0x70,0x1C,0x88,0x22,0x08,0x21,0x08,0x21,0x88,0x22,0x70,0x1C,0x00,0x00},//\"8\{0x00,0x00,0xE0,0x00,0x10,0x31,0x08,0x22,0x08,0x22,0x10,0x11,0xE0,0x0F,0x00,0x00},//\"9\{0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x30,0xC0,0x30,0x00,0x00,0x00,0x00,0x00,0x00},//\":\{0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\";\{0x00,0x00,0x00,0x01,0x80,0x02,0x40,0x04,0x20,0x08,0x10,0x10,0x08,0x20,0x00,0x00},//\"<\{0x40,0x04,0x40,0x04,0x40,0x04,0x40,0x04,0x40,0x04,0x40,0x04,0x40,0x04,0x00,0x00},//\"=\{0x00,0x00,0x08,0x20,0x10,0x10,0x20,0x08,0x40,0x04,0x80,0x02,0x00,0x01,0x00,0x00},//\">\{0x00,0x00,0x70,0x00,0x48,0x00,0x08,0x30,0x08,0x36,0x08,0x01,0xF0,0x00,0x00,0x00},//\"?\{0xC0,0x07,0x30,0x18,0xC8,0x27,0x28,0x24,0xE8,0x23,0x10,0x14,0xE0,0x0B,0x00,0x00},//\"@\{0x00,0x20,0x00,0x3C,0xC0,0x23,0x38,0x02,0xE0,0x02,0x00,0x27,0x00,0x38,0x00,0x20},//\"A\{0x08,0x20,0xF8,0x3F,0x88,0x20,0x88,0x20,0x88,0x20,0x70,0x11,0x00,0x0E,0x00,0x00},//\"B\

{0xC0,0x07,0x30,0x18,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x10,0x38,0x08,0x00,0x00},//\"C\{0x08,0x20,0xF8,0x3F,0x08,0x20,0x08,0x20,0x08,0x20,0x10,0x10,0xE0,0x0F,0x00,0x00},//\"D\{0x08,0x20,0xF8,0x3F,0x88,0x20,0x88,0x20,0xE8,0x23,0x08,0x20,0x10,0x18,0x00,0x00},//\"E\{0x08,0x20,0xF8,0x3F,0x88,0x20,0x88,0x00,0xE8,0x03,0x08,0x00,0x10,0x00,0x00,0x00},//\"F\{0xC0,0x07,0x30,0x18,0x08,0x20,0x08,0x20,0x08,0x22,0x38,0x1E,0x00,0x02,0x00,0x00},//\"G\{0x08,0x20,0xF8,0x3F,0x08,0x21,0x00,0x01,0x00,0x01,0x08,0x21,0xF8,0x3F,0x08,0x20},//\"H\{0x00,0x00,0x08,0x20,0x08,0x20,0xF8,0x3F,0x08,0x20,0x08,0x20,0x00,0x00,0x00,0x00},//\"I\{0x00,0xC0,0x00,0x80,0x08,0x80,0x08,0x80,0xF8,0x7F,0x08,0x00,0x08,0x00,0x00,0x00},//\"J\{0x08,0x20,0xF8,0x3F,0x88,0x20,0xC0,0x01,0x28,0x26,0x18,0x38,0x08,0x20,0x00,0x00},//\"K\{0x08,0x20,0xF8,0x3F,0x08,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x30,0x00,0x00},//\"L\{0x08,0x20,0xF8,0x3F,0xF8,0x00,0x00,0x3F,0xF8,0x00,0xF8,0x3F,0x08,0x20,0x00,0x00},//\"M\{0x08,0x20,0xF8,0x3F,0x30,0x20,0xC0,0x00,0x00,0x07,0x08,0x18,0xF8,0x3F,0x08,0x00},//\"N\{0xE0,0x0F,0x10,0x10,0x08,0x20,0x08,0x20,0x08,0x20,0x10,0x10,0xE0,0x0F,0x00,0x00},//\"O\{0x08,0x20,0xF8,0x3F,0x08,0x21,0x08,0x01,0x08,0x01,0x08,0x01,0xF0,0x00,0x00,0x00},//\"P\{0xE0,0x0F,0x10,0x18,0x08,0x24,0x08,0x24,0x08,0x38,0x10,0x50,0xE0,0x4F,0x00,0x00},//\"Q\{0x08,0x20,0xF8,0x3F,0x88,0x20,0x88,0x00,0x88,0x03,0x88,0x0C,0x70,0x30,0x00,0x20},//\"R\{0x00,0x00,0x70,0x38,0x88,0x20,0x08,0x21,0x08,0x21,0x08,0x22,0x38,0x1C,0x00,0x00},//\"S\{0x18,0x00,0x08,0x00,0x08,0x20,0xF8,0x3F,0x08,0x20,0x08,0x00,0x18,0x00,0x00,0x00},//\"T\{0x08,0x00,0xF8,0x1F,0x08,0x20,0x00,0x20,0x00,0x20,0x08,0x20,0xF8,0x1F,0x08,0x00},//\"U\{0x08,0x00,0x78,0x00,0x88,0x07,0x00,0x38,0x00,0x0E,0xC8,0x01,0x38,0x00,0x08,0x00},//\"V\{0xF8,0x03,0x08,0x3C,0x00,0x07,0xF8,0x00,0x00,0x07,0x08,0x3C,0xF8,0x03,0x00,0x00},//\"W\{0x08,0x20,0x18,0x30,0x68,0x2C,0x80,0x03,0x80,0x03,0x68,0x2C,0x18,0x30,0x08,0x20},//\"X\{0x08,0x00,0x38,0x00,0xC8,0x20,0x00,0x3F,0xC8,0x20,0x38,0x00,0x08,0x00,0x00,0x00},//\"Y\{0x10,0x20,0x08,0x38,0x08,0x26,0x08,0x21,0xC8,0x20,0x38,0x20,0x08,0x18,0x00,0x00},//\"Z\{0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x7F,0x02,0x40,0x02,0x40,0x02,0x40,0x00,0x00},//\"[\{0x00,0x00,0x0C,0x00,0x30,0x00,0xC0,0x01,0x00,0x06,0x00,0x38,0x00,0xC0,0x00,0x00},//\"\\\{0x00,0x00,0x02,0x40,0x02,0x40,0x02,0x40,0xFE,0x7F,0x00,0x00,0x00,0x00,0x00,0x00},//\"]\{0x00,0x00,0x00,0x00,0x04,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00},//\"^\{0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},//\"_\{0x00,0x00,0x02,0x00,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\"`\{0x00,0x00,0x00,0x19,0x80,0x24,0x80,0x22,0x80,0x22,0x80,0x22,0x00,0x3F,0x00,0x20},//\"a\{0x08,0x00,0xF8,0x3F,0x00,0x11,0x80,0x20,0x80,0x20,0x00,0x11,0x00,0x0E,0x00,0x00},//\"b\{0x00,0x00,0x00,0x0E,0x00,0x11,0x80,0x20,0x80,0x20,0x80,0x20,0x00,0x11,0x00,0x00},//\"c\{0x00,0x00,0x00,0x0E,0x00,0x11,0x80,0x20,0x80,0x20,0x88,0x10,0xF8,0x3F,0x00,0x20},//\"d\{0x00,0x00,0x00,0x1F,0x80,0x22,0x80,0x22,0x80,0x22,0x80,0x22,0x00,0x13,0x00,0x00},//\"e\{0x00,0x00,0x80,0x20,0x80,0x20,0xF0,0x3F,0x88,0x20,0x88,0x20,0x88,0x00,0x18,0x00},//\"f\{0x00,0x00,0x00,0x6B,0x80,0x94,0x80,0x94,0x80,0x94,0x80,0x93,0x80,0x60,0x00,0x00},//\"g\{0x08,0x20,0xF8,0x3F,0x00,0x21,0x80,0x00,0x80,0x00,0x80,0x20,0x00,0x3F,0x00,0x20},//\"h\{0x00,0x00,0x80,0x20,0x98,0x20,0x98,0x3F,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00},//\"i\{0x00,0x00,0x00,0xC0,0x00,0x80,0x80,0x80,0x98,0x80,0x98,0x7F,0x00,0x00,0x00,0x00},//\"j\{0x08,0x20,0xF8,0x3F,0x00,0x24,0x00,0x02,0x80,0x2D,0x80,0x30,0x80,0x20,0x00,0x00},//\"k\{0x00,0x00,0x08,0x20,0x08,0x20,0xF8,0x3F,0x00,0x20,0x00,0x20,0x00,0x00,0x00,0x00},//\"l\{0x80,0x20,0x80,0x3F,0x80,0x20,0x80,0x00,0x80,0x3F,0x80,0x20,0x80,0x00,0x00,0x3F},//\"m\{0x80,0x20,0x80,0x3F,0x00,0x21,0x80,0x00,0x80,0x00,0x80,0x20,0x00,0x3F,0x00,0x20},//\"n\{0x00,0x00,0x00,0x1F,0x80,0x20,0x80,0x20,0x80,0x20,0x80,0x20,0x00,0x1F,0x00,0x00},//\"o\{0x80,0x80,0x80,0xFF,0x00,0xA1,0x80,0x20,0x80,0x20,0x00,0x11,0x00,0x0E,0x00,0x00},//\"p\{0x00,0x00,0x00,0x0E,0x00,0x11,0x80,0x20,0x80,0x20,0x80,0xA0,0x80,0xFF,0x00,0x80},//\"q\{0x80,0x20,0x80,0x20,0x80,0x3F,0x00,0x21,0x80,0x20,0x80,0x00,0x80,0x01,0x00,0x00},//\"r\{0x00,0x00,0x00,0x33,0x80,0x24,0x80,0x24,0x80,0x24,0x80,0x24,0x80,0x19,0x00,0x00},//\"s\{0x00,0x00,0x80,0x00,0x80,0x00,0xE0,0x1F,0x80,0x20,0x80,0x20,0x00,0x00,0x00,0x00},//\"t\{0x80,0x00,0x80,0x1F,0x00,0x20,0x00,0x20,0x00,0x20,0x80,0x10,0x80,0x3F,0x00,0x20},//\"u\{0x80,0x00,0x80,0x01,0x80,0x0E,0x00,0x30,0x00,0x08,0x80,0x06,0x80,0x01,0x80,0x00},//\"v\{0x80,0x0F,0x80,0x30,0x00,0x0C,0x80,0x03,0x00,0x0C,0x80,0x30,0x80,0x0F,0x80,0x00},//\"w\{0x00,0x00,0x80,0x20,0x80,0x31,0x00,0x2E,0x80,0x0E,0x80,0x31,0x80,0x20,0x00,0x00},//\"x\{0x80,0x80,0x80,0x81,0x80,0x8E,0x00,0x70,0x00,0x18,0x80,0x06,0x80,0x01,0x80,0x00},//\"y\{0x00,0x00,0x80,0x21,0x80,0x30,0x80,0x2C,0x80,0x22,0x80,0x21,0x80,0x30,0x00,0x00},//\"z\{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x7C,0x3F,0x02,0x40,0x02,0x40},//\"{\{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},//\"|\{0x00,0x00,0x02,0x40,0x02,0x40,0x7C,0x3F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//\{0x00,0x00,0x06,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x04,0x00,0x04,0x00},//\"~\

//常⽤ASCII表//纵向取模//偏移量:32//⼤⼩:8*6

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

{0x08,0x14,0x14,0x14,0x7c,0x00},//-q- {0x7c,0x08,0x04,0x04,0x08,0x00},//-r- {0x48,0x54,0x54,0x54,0x24,0x00},//-s-{0x04,0x04,0x3f,0x44,0x24,0x00},//-t- {0x3c,0x40,0x40,0x40,0x3c,0x00},//-u- {0x1c,0x20,0x40,0x20,0x1c,0x00},//-v-{0x3c,0x40,0x30,0x40,0x3c,0x00},//-w- {0x44,0x28,0x10,0x28,0x44,0x00},//-x- {0x04,0x48,0x30,0x08,0x04,0x00},//-y-{0x44,0x64,0x54,0x4c,0x44,0x00},//-z- {0x08,0x36,0x41,0x41,0x00,0x00},//-{- {0x00,0x00,0x77,0x00,0x00,0x00},//-|-{0x00,0x41,0x41,0x36,0x08,0x00},//-}- {0x04,0x02,0x02,0x02,0x01,0x00},//-~- };#endif

因篇幅问题不能全部显示,请点此查看更多更全内容