打印
[开发资料]

【CW32L031CxTx StartKit评估板测评】03-SPI驱动0.96寸OLED

[复制链接]
1118|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
一、硬件
材料:中景园的0.96寸黄蓝OLED显示屏,驱动芯片是SSD1306。
OLED介绍
OLED引脚,是7针SPI模式。
1). GND 电源地
2). VCC 电源正(3~5.5V)
3). D0 OLED 的 D0 脚,在 SPI 和 IIC 通信中为时钟管脚
4). D1 OLED 的 D1 脚,在 SPI 和 IIC 通信中为数据管脚
5). RES OLED 的 RES#脚,用来复位(低电平复位)
6). DC OLED 的 D/C#E 脚,数据和命令控制管脚.
本次实验中,使用CW32L031U8T6进行驱动OLED显示屏。
OLED与SPI引脚连接顺序为:
D0---PB03;
D1---PB05;
RES-PA06;
DC---PB00;
CS---PA15;
注意:CE32L031U8只有一个SPI接口;
二、软件设计
1、OLED驱动程序编写
在这里需要注意打开SPI相应IO口的复用功能。
#include "OLED.h"
//#include "OLED_Font.h"
#include "font.h"
/*OLED段码分布
128*64;每个COM对应8个点
正常
(page0)      SEG0-SEG128
                                        COM0
                                         |
                                        COM7

反置
(page0)       SEG128-SEG0
                                        COM63
                                         |
                                        COM56
                                       
写命令,其实是写寄存器
*/


/****************************************************************************
* 名        称:void OLED_Config(void)
* 功        能:配置OLED相关配置
* 入口参数:无
* 出口参数:无
* 说        明:
****************************************************************************/
void OLED_Config(void)
{
        OLED_GPIO_Init();
        OLED_SPI_Init();
        OLED_Init();
}
/****************************************************************************
* 名        称:void OLED_GPIO_Init(void)
* 功        能:配置在OLED与stm32间spi通信的引脚及控制OLED的引脚
* 入口参数:无
* 出口参数:无
* 说        明:
****************************************************************************/
void OLED_GPIO_Init(void)
{
        GPIO_InitTypeDef GPIO_InitStructure;
       
        RCC_AHBPeriphClk_Enable(OLED_SPI_SCK_GPIO_CLK | OLED_SPI_MOSI_GPIO_CLK, ENABLE);

        RCC_APBPeriphClk_Enable2(RCC_APB2_PERIPH_SPI1, ENABLE);
       
        PB03_AFx_SPI1SCK(); //打开SPI时钟引脚复用功能;芯源在这里直接封装了接口,不需要看数据手册,就可以看对应接口,很方便的进行功能复用
        PB05_AFx_SPI1MOSI();//打开SPIMOSI引脚复用功能
        //OLEDSCLK和MOSI管脚
        GPIO_InitStructure.Pins =GPIO_PIN_3 | GPIO_PIN_5;
        GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;                                                                                       
        GPIO_Init(CW_GPIOB,&GPIO_InitStructure);
       
  //OLED片选CS管脚和复位RES管脚 ,低电平复位
        GPIO_InitStructure.Pins = GPIO_PIN_15 | GPIO_PIN_6;
        GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;                                                                                        //
  GPIO_Init(CW_GPIOA,&GPIO_InitStructure);
  
//初始状态都给高电平
       
  //OLED 数据和命令控制引脚
        GPIO_InitStructure.Pins = GPIO_PIN_0;
        GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;                                                                                       
  GPIO_Init(CW_GPIOB,&GPIO_InitStructure);        
        GPIO_WritePin(CW_GPIOA, GPIO_PIN_15 | GPIO_PIN_6, GPIO_Pin_SET);
        GPIO_WritePin(CW_GPIOB,GPIO_PIN_0,GPIO_Pin_SET);

}


/****************************************************************************
* 名        称:void OLED_SPI_Init(void)       
* 功        能:配置在OLED与stm32间spi通信的初始化
* 入口参数:无
* 出口参数:无
* 说        明:
****************************************************************************/
void OLED_SPI_Init(void)
{
        SPI_InitTypeDef SPI_InitStructure;
       
       
        OLED_SPI_APBClkENx(OLED_SPI_CLK, ENABLE);
       
        //配置SPI1相关参数:全双工通信、MSB/LSB、通信速度、工作模式(mode0~mode3)......
        SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;                //全双工通信
        SPI_InitStructure.SPI_Mode = SPI_Mode_Master;                                                                                                        //主机角色
        SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;                                 //看时序图,8位数据位
        SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;                                                                                                                //时钟线空闲的时候是什么电平,当前配置为低电平
        SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;                          //主机在时钟线哪一个时刻读取MISO引脚的电平,在时钟第一个边沿来采集数据
        SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;                                                                                                                        //片选需要代码控制
        SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8;                //SPI1的通信硬件时钟=72MHz/256   
        SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;                                                                                //最高有效位优先传输
        SPI_Init(CW_SPI1,&SPI_InitStructure);
       
        SPI_Cmd(CW_SPI1,ENABLE);
       
       
}


/****************************************************************************
* 名        称:void OLED_Init(void)       
* 功        能:OLED初始化
* 入口参数:无
* 出口参数:无
* 说        明:参照上电序列初始化(24/40)
****************************************************************************/
void OLED_Init(void)
{
       
        OLED_CS_High;
        //复位OLED
        OLED_RST_High;  
        Delay(0xffff);
        Delay(0xffff);
        Delay(0xffff);
        OLED_RST_Low;
        Delay(0xffff);
        Delay(0xffff);
        Delay(0xffff);
        OLED_RST_High;
       
        OLED_Write_Operate(OLED_Mode_Cmd,0xAE); //关闭OLED
        OLED_Write_Operate(OLED_Mode_Cmd,0x00); //设置列低位地址
        OLED_Write_Operate(OLED_Mode_Cmd,0x10); //设置列高位地址
  OLED_Write_Operate(OLED_Mode_Cmd,0x40); //设置起始行地址及映射RAM显示起始行 (0x00~0x3F)
        OLED_Write_Operate(OLED_Mode_Cmd,0xB0); //设置页地址
        OLED_Write_Operate(OLED_Mode_Cmd,0x81); //对比度设置                                                
        OLED_Write_Operate(OLED_Mode_Cmd,0xCF); //Set SEG Output Current Brightness
       
        OLED_Write_Operate(OLED_Mode_Cmd,0xA1); //Set SEG/Column Mapping     0xa0左右反置 0xa1正常
        OLED_Write_Operate(OLED_Mode_Cmd,0xA6); //
        OLED_Write_Operate(OLED_Mode_Cmd,0xA8); //设置驱动路数(1 to 64)
        OLED_Write_Operate(OLED_Mode_Cmd,0x3F); //*duty = 1/64*/
        OLED_Write_Operate(OLED_Mode_Cmd,0xC8); //0xc0上下反置 0xc8正常
        OLED_Write_Operate(OLED_Mode_Cmd,0xD3); //设置显示偏移(0x00~0x3F)
        OLED_Write_Operate(OLED_Mode_Cmd,0x00); //not offset
        OLED_Write_Operate(OLED_Mode_Cmd,0xD5); //--set Display clock divide ratio/oscillator frequency
        OLED_Write_Operate(OLED_Mode_Cmd,0x80); //--set divide ratio, Set Clock as 100 Frames/Sec
        OLED_Write_Operate(OLED_Mode_Cmd,0xD9); //*set pre-charge period*/
        OLED_Write_Operate(OLED_Mode_Cmd,0Xf1); //Set Pre-Charge as 15 Clocks & Discharge as 1 Clock
        OLED_Write_Operate(OLED_Mode_Cmd,0xDA); //*set COM pins*/
        OLED_Write_Operate(OLED_Mode_Cmd,0x12); //
        OLED_Write_Operate(OLED_Mode_Cmd,0xdb); //*set vcomh*/
        OLED_Write_Operate(OLED_Mode_Cmd,0x40); //Set VCOM Deselect Level
        /**/
        OLED_Write_Operate(OLED_Mode_Cmd,0x20);        //设置存储模式(0x00,0x02,0x01)
        OLED_Write_Operate(OLED_Mode_Cmd,0x02); //页地址模式
       
        OLED_Write_Operate(OLED_Mode_Cmd,0x8d); //*set charge pump disable*/
        OLED_Write_Operate(OLED_Mode_Cmd,0x14); //--set(0x10) disable
        /**/
        OLED_Write_Operate(OLED_Mode_Cmd,0xA4); //显示开启(A4,显示,A5无显示)
        OLED_Write_Operate(OLED_Mode_Cmd,0xA6); //背景正反向显示(0xa6,正显,0xa7,反显)
       
       
        OLED_Display_Clear();                                                                                //清屏
        OLED_Write_Operate(OLED_Mode_Cmd,0xAF); //打开显示
       
}


/****************************************************************************
* 名        称:uint8_t SPI1_WriteReadByte(uint8_t Data)       
* 功        能:SPI1读写一个字节
* 入口参数:无
* 出口参数:接收的数据
* 返回值  :0,发送接收超时,1成功
* 说        明:无
****************************************************************************/
uint8_t SPI1_WriteReadByte(uint8_t Data)
{
        uint8_t cnt = 0;
        while(SPI_GetFlagStatus(CW_SPI1,SPI_FLAG_TXE) == RESET)        //等待发送区为空
        {
                cnt++;
                if( cnt > 100)
                        return 0;
               
        }
        SPI_SendData(CW_SPI1,Data);                                                                                                                                        //发送一个字节的数据
        cnt = 0;
        while(SPI_GetFlagStatus(CW_SPI1,SPI_FLAG_RXNE) == RESET)        //等待接收完一个Byte
        {       
                cnt++;
                if( cnt > 100)
                        return 0;
        }
        return SPI_ReceiveData(CW_SPI1);                                                                                                //接收一个字节的数据
       
}

/****************************************************************************
* 名        称:uint8_t OLED_Write_Byte(uint8_t data)       
* 功        能:OLED写一个字节
* 入口参数:无
* 出口参数:接收的数据
* 返回值  :0失败,1成功
* 说        明:无
****************************************************************************/
uint8_t OLED_Write_Byte(uint8_t data)
{
        if(!SPI1_WriteReadByte(data))
                return 0;
        else
                return 1;
}


/****************************************************************************
* 名        称:void OLED_Write_Operate(uint8_t mode,uint8_t data)
* 功        能:OLED写操作
* 入口参数:模式,数据
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Write_Operate(uint8_t mode,uint8_t data)
{
        OLED_CS_Low;
       
        if(mode)
        {
                OLED_Write_Data;
        }
        else
        {
                OLED_Write_Cmd;
        }
       
        OLED_Write_Byte(data);
       
        OLED_CS_High;
}


/****************************************************************************
* 名        称:void OLED_Display_Clear(void)
* 功        能:OLED清屏
* 入口参数:无
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_Clear(void)
{
        uint8_t page = 0;
        uint8_t i=0;
        OLED_CS_Low;
       
        for(page=0;page < 8; page++)
        {
                OLED_Write_Operate(OLED_Mode_Cmd,0xB0+page);//设置页地址
                OLED_Write_Operate(OLED_Mode_Cmd,0x00);     //设置显示位置-列低地址
          OLED_Write_Operate(OLED_Mode_Cmd,0x10);     //设置显示位置-列高地址
               
                for(i = 0;i< 128; i++)
                {
                        OLED_Write_Operate(OLED_Mode_Data,0x00);  //清屏
                }
        }
}



/****************************************************************************
* 名        称:void OLED_Set_Positon(void)
* 功        能:设置显示坐标
* 入口参数:x,y
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Set_Positon(uint8_t x,uint8_t y)
{
       
        OLED_Write_Operate(OLED_Mode_Cmd,0xB0 + y);                                                           //设置页地址
        OLED_Write_Operate(OLED_Mode_Cmd,((x & 0xf0) >>4 ) | 0x10); //设置列高四位地址
        OLED_Write_Operate(OLED_Mode_Cmd,(x & 0x0f) | 0x01);              //设置列低四位地址

}


/****************************************************************************
* 名        称:void OLED_Display_on(void)
* 功        能:显示打开
* 入口参数:无
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_on(void)
{
       
        OLED_Write_Operate(OLED_Mode_Cmd,0x8d); //写充电泵寄存器
        OLED_Write_Operate(OLED_Mode_Cmd,0x14); //打开充电泵
        OLED_Write_Operate(OLED_Mode_Cmd,0xAF);        //打开OLED显示

}


/****************************************************************************
* 名        称:void OLED_Display_offvoid)
* 功        能:显示关闭
* 入口参数:无
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_off(void)
{
       
        OLED_Write_Operate(OLED_Mode_Cmd,0x8d); //写充电泵寄存器
        OLED_Write_Operate(OLED_Mode_Cmd,0x10); //关闭充电泵
        OLED_Write_Operate(OLED_Mode_Cmd,0xAE);        //关闭OLED显示

}


/****************************************************************************
* 名        称:void OLED_Display_onechar(uint8_t x,uint8_t y,uint8_t character,uint8_t size)
* 功        能:显示单个字符
* 入口参数:
x ,y坐标位置
character 字符
size 字号大小
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_onechar(uint8_t x,uint8_t y,uint8_t character,uint8_t size)
{
        uint8_t c=0,i=0;
        c = character-' ';
        if(x > MAX_COLUMN - 1)
        {
                x= 0;
                if(size == SIZE8)
                {
                        y = y+1;
                }
                if(size == SIZE16)
                {
                        y = y+2;
                }
        }
        if(size == SIZE16)
        {
                OLED_Set_Positon(x,y);
                for( i =0;i< 8; i++)
                {
                        OLED_Write_Operate(OLED_Mode_Data,F8X16[c*16 + i]);
                }
                OLED_Set_Positon(x,y+1);
                for( i =0;i< 8; i++)
                {
                        OLED_Write_Operate(OLED_Mode_Data,F8X16[c*16 + i+8]);
                }
        }
        else
        {
                OLED_Set_Positon(x,y+1);
                for( i =0;i< 6; i++)
                {
                        OLED_Write_Operate(OLED_Mode_Data,F6x8[c][i]);
                }
        }
}


/****************************************************************************
* 名        称:void OLED_Display_string(uint8_t x,uint8_t y,uint8_t *str,uint8_t size)
* 功        能:显示字符串
* 入口参数:
x ,y坐标位置
str 字符串
size 字号大小
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_string(uint8_t x,uint8_t y,uint8_t *str,uint8_t size)
{
        uint8_t i=0;
        while(str[i]!='\0')
        {
                OLED_Display_onechar(x,y,str[i],size);
                x += 8;
                if(x > 120)
                {
                        x = 0;
                        y += 2;
                }
                i++;
        }
}


/****************************************************************************
* 名        称:void OLED_Display_Chinese(uint8_t x,uint8_t y,uint8_t Sno)
* 功        能:显示单个字符
* 入口参数:
x ,y坐标位置
Sno 表示汉字数组中一个字的码所占的序号
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_Chinese(uint8_t x,uint8_t y,uint8_t Sno)
{
        uint8_t adder=0,i=0;
        OLED_Set_Positon(x,y);
        for(i = 0;i< 16;i++)
        {
                OLED_Write_Operate(OLED_Mode_Data,Hzk[2*Sno][i]);
                adder += 1;
        }
  OLED_Set_Positon(x,y+1);
        for(i = 0;i< 16;i++)
        {
                OLED_Write_Operate(OLED_Mode_Data,Hzk[2*Sno+1][i]);
                adder += 1;
        }       
}



/****************************************************************************
* 名        称:uint32_t OLED_POW(uint8_t m, uint8_t n)
* 功        能:m的n次方
* 入口参数:
m为底数,n为指数
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
uint32_t OLED_POW(uint8_t m, uint8_t n)
{
        uint32_t result=1;
        while(n--)
        {
                result *= m;
        }
        return result;
}


/****************************************************************************
* 名        称:void OLED_Display_Num(uint8_t x,uint8_t y,uint32_t num, uint8_t Len,uint8_t size)
* 功        能:显示单个字符
* 入口参数:
x ,y坐标位置
Sno 表示汉字数组中一个字的码所占的序号
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_Num(uint8_t x,uint8_t y,uint32_t num, uint8_t len,uint8_t size)
{
        uint8_t i=0;
        uint8_t endisplay=0;
        uint8_t temp=0;
        for(i = 0;i < len;i++)
        {
                temp = (num / (OLED_POW(10,len-i-1)))%10;
                if(endisplay == 0 && i < len-1)
                {
                        if(temp == 0)
                        {
                                OLED_Display_onechar(x + (size / 2) * i,y,' ',size);
                                continue;
                        }
                        else
                        {
                                endisplay = 1;
                        }
                }
                OLED_Display_onechar(x + (size / 2) * i,y,temp + '0',size);
        }
}


/****************************************************************************
* 名        称:void OLED_Display_Picture(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t BMP[])
* 功        能:显示一张图片
* 入口参数:
x0 ,y0,x1,y1图片的大小
BMP[] 图片的码
* 出口参数:无
* 返回值  :无
* 说        明:无
****************************************************************************/
void OLED_Display_Picture(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t BMP[])
{
        uint16_t i=0;
        uint8_t x,y;
  if(y1 == 8)
  {
   y= y1/ 8;
        }               
        else
        {
                y = y1/ 8 + 1;
        }
        for(y = y0;y < y1;y++)
        {
                OLED_Set_Positon(x0,y);
                for(x = x0;x< x1; x++)
                {
                        OLED_Write_Operate(OLED_Mode_Data,BMP[i++]);
                }       
        }
}
2、头文件

#ifndef _OLED_H
#define _OLED_H

#include "..\inc\main.h"


/*引脚连接
PA4  CS  低电平有效
PA5  SCLK(SPI1)
PA6  RES/MISO  低电平有效
PA7  MOSI
PB0  DC
Page0-7地址为B0-B7
*/


#define MAX_COLUMN 128
#define MAX_ROW    64

#define SIZE16       16
#define SIZE8        8

#define OLED_Mode_Data  1  //数据模式
#define OLED_Mode_Cmd   0  //命令模式

#define OLED_Write_Data PB00_SETHIGH()   //写数据
#define OLED_Write_Cmd  PB00_SETLOW() //写命令

#define OLED_SPI_CLK                                                                           RCC_APB2_PERIPH_SPI1
#define OLED_SPI_SCK_GPIO_CLK            RCC_AHB_PERIPH_GPIOA
#define OLED_SPI_MOSI_GPIO_CLK           RCC_AHB_PERIPH_GPIOB

#define OLED_SPI_APBClkENx               RCC_APBPeriphClk_Enable2

//CS LOW or HIGH
#define OLED_CS_Low             PA15_SETLOW()
#define OLED_CS_High            PA15_SETHIGH()

#define OLED_RST_High  PA06_SETHIGH()
#define OLED_RST_Low   PA06_SETLOW()

void OLED_Config(void);
void OLED_GPIO_Init(void);
void OLED_SPI_Init(void);
void OLED_Init(void);
uint8_t SPI1_WriteReadByte(uint8_t Data);
uint8_t OLED_Write_Byte(uint8_t data);
void OLED_Write_Operate(uint8_t mode,uint8_t data);
void OLED_Display_Clear(void);
void OLED_Set_Positon(uint8_t x,uint8_t y);
void OLED_Display_on(void);
void OLED_Display_off(void);

void OLED_Display_onechar(uint8_t x,uint8_t y,uint8_t character,uint8_t size);
void OLED_Display_string(uint8_t x,uint8_t y,uint8_t *str,uint8_t size);
uint32_t OLED_POW(uint8_t m, uint8_t n);
void OLED_Display_Num(uint8_t x,uint8_t y,uint32_t num, uint8_t len,uint8_t size);
void OLED_Display_Chinese(uint8_t x,uint8_t y,uint8_t Sno);
void OLED_Display_Picture(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t BMP[]);
#endif
3、显示内容头文件

#ifndef __FONT_H
#define __FONT_H        


/*PCtoLCD2002软件取模设置
阴码  列行式  逆向  点阵大小16 索引16
16进制  C51格式  前缀0x


*/
//常用ASCII表
//偏移量32
//ASCII字符集
//偏移量32
//大小:12*6
/************************************6*8的点阵************************************/
const unsigned char F6x8[][6] =               
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp
0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !
0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "
0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #
0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $
0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %
0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &
0x00, 0x00, 0x05, 0x03, 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, 0x00, 0xA0, 0x60, 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,// 0
0x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
0x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 2
0x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
0x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
0x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 5
0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
0x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 7
0x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 8
0x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
0x00, 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, 0x59, 0x51, 0x3E,// @
0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A
0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B
0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C
0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E
0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F
0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G
0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I
0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J
0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K
0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L
0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P
0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R
0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S
0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T
0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W
0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X
0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y
0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z
0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [
0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 55
0x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]
0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^
0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _
0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '
0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a
0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b
0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c
0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d
0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e
0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f
0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g
0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h
0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i
0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j
0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k
0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l
0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m
0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n
0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o
0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p
0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q
0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r
0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s
0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t
0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x
0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y
0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z
0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
};
/****************************************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,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 1
  0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2
  0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 3
  0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 4
  0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 5
  0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 6
  0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7
  0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 8
  0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 9
  0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 10
  0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 11
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 12
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 13
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 14
  0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 15
  0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 16
  0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 17
  0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 18
  0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 19
  0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 20
  0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 21
  0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 22
  0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 23
  0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 24
  0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 25
  0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 26
  0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 27
  0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 28
  0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 29
  0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 30
  0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 31
  0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//[url=home.php?mod=space&uid=72445]@[/url] 32
  0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 33
  0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 34
  0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 35
  0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 36
  0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 37
  0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 38
  0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 39
  0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 40
  0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 41
  0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 42
  0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 43
  0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 44
  0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 45
  0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 46
  0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 47
  0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 48
  0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 49
  0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 50
  0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 51
  0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 52
  0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 53
  0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 54
  0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 55
  0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 56
  0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 57
  0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 58
  0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 59
  0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 60
  0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 61
  0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 63
  0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64
  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 65
  0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 66
  0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 67
  0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 68
  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 69
  0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 70
  0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 71
  0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 72
  0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 73
  0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 74
  0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 75
  0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 76
  0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 77
  0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 78
  0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 79
  0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 80
  0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 81
  0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 82
  0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 83
  0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 84
  0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 85
  0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 86
  0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 87
  0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 88
  0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 89
  0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 90
  0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 91
  0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 92
  0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 93
  0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
};
char Hzk[][32]={

{0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,0x10,0xF0,0x00,0x00,0x00},
{0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x0F,0x00,0x00,0x00},/*"中",0*/

{0x40,0x40,0x40,0x5F,0x55,0x55,0x55,0x75,0x55,0x55,0x55,0x5F,0x40,0x40,0x40,0x00},
{0x00,0x40,0x20,0x0F,0x09,0x49,0x89,0x79,0x09,0x09,0x09,0x0F,0x20,0x40,0x00,0x00},/*"景",1*/

{0x00,0xFE,0x02,0x42,0x4A,0xCA,0x4A,0x4A,0xCA,0x4A,0x4A,0x42,0x02,0xFE,0x00,0x00},
{0x00,0xFF,0x40,0x50,0x4C,0x43,0x40,0x40,0x4F,0x50,0x50,0x5C,0x40,0xFF,0x00,0x00},/*"园",2*/

{0x00,0x00,0xF8,0x88,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x88,0xF8,0x00,0x00,0x00},
{0x00,0x00,0x1F,0x08,0x08,0x08,0x08,0x7F,0x88,0x88,0x88,0x88,0x9F,0x80,0xF0,0x00},/*"电",3*/


{0x80,0x82,0x82,0x82,0x82,0x82,0x82,0xE2,0xA2,0x92,0x8A,0x86,0x82,0x80,0x80,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"子",4*/

{0x24,0x24,0xA4,0xFE,0xA3,0x22,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00},
{0x08,0x06,0x01,0xFF,0x00,0x01,0x04,0x04,0x04,0x04,0x04,0xFF,0x02,0x02,0x02,0x00},/*"科",5*/

{0x10,0x10,0x10,0xFF,0x10,0x90,0x08,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x08,0x00},
{0x04,0x44,0x82,0x7F,0x01,0x80,0x80,0x40,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00},/*"技",6*/




{0x08,0x08,0x08,0x08,0x88,0x78,0x0F,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00},
{0x20,0x10,0x48,0x46,0x41,0x41,0x41,0x41,0x7F,0x41,0x41,0x41,0x41,0x40,0x40,0x00},/*"左",12*/
/* (16 X 16 , 宋体 )*/

{0x08,0x08,0x08,0x08,0xC8,0x38,0x0F,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00},
{0x08,0x04,0x02,0x01,0xFF,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0xFF,0x00,0x00,0x00},/*"右",13*/
/* (16 X 16 , 宋体 )*/

{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00},
{0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00},/*"上",14*/
/* (16 X 16 , 宋体 )*/

{0x02,0x02,0x02,0x02,0x02,0x02,0xFE,0x02,0x02,0x42,0x82,0x02,0x02,0x02,0x02,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x01,0x06,0x00,0x00,0x00},/*"下",15*/
/* (16 X 16 , 宋体 )*/



{0x04,0x04,0x84,0x74,0x4F,0x44,0xC4,0x44,0x44,0x44,0x04,0x00,0x04,0x02,0x09,0x08},
{0x08,0x08,0x0F,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"左",0*/
};


char Hzk12X12[][32]={
       
{0x04,0x04,0x84,0x74,0x4F,0x44,0xC4,0x44,0x44,0x44,0x04,0x00,0x04,0x02,0x09,0x08},
{0x08,0x08,0x0F,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"左",0*/
/* (12 X 12 , 宋体 )*/

{0x04,0x04,0x84,0xE4,0x5C,0x47,0x44,0x44,0x44,0xC4,0x04,0x00,0x02,0x01,0x00,0x0F},
{0x04,0x04,0x04,0x04,0x04,0x0F,0x00,0x00},/*"右",1*/
/* (12 X 12 , 宋体 )*/

{0x00,0x00,0x00,0x00,0xFF,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x08,0x08,0x08,0x08},
{0x0F,0x08,0x08,0x08,0x08,0x08,0x08,0x00},/*"上",2*/
/* (12 X 12 , 宋体 )*/

{0x02,0x02,0x02,0x02,0xFE,0x02,0x12,0x22,0x42,0x82,0x02,0x00,0x00,0x00,0x00,0x00},
{0x0F,0x00,0x00,0x00,0x00,0x01,0x00,0x00},/*"下",3*/
/* (12 X 12 , 宋体 )*/
};

unsigned char **[] = {
0x00,0xF8,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,
0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0x7C,0x7C,0x3C,
0x1C,0x9C,0x9C,0xCC,0xCC,0xCC,0xEC,0xE4,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
0xF0,0xF0,0xF4,0xFC,0xFC,0xEC,0xDC,0x9C,0x3C,0xFC,0xFC,0xFC,0xFC,0xF8,0x10,0x00,
0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x7F,0x3F,0x1F,0x0F,0x07,0x87,0xC3,0xE1,0xF0,0xF0,0xF8,0xFC,0xFE,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xF1,0x0F,0xFF,0xFF,0x00,0x00,
0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x3F,0x0F,0x0F,0x07,0x03,
0x01,0xC0,0xE0,0xF0,0xF8,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xC0,0xFF,0xFF,0x00,0x00,
0x00,0xFF,0xFF,0xFF,0x7F,0x3F,0x0F,0x03,0x03,0x01,0x00,0x80,0xC0,0xE0,0xF0,0xE0,
0x81,0x01,0x01,0x01,0x01,0x01,0x01,0x39,0xFD,0xFD,0xFF,0xFF,0xFF,0xFF,0xFD,0xFD,
0xF9,0xF1,0xC1,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x39,0xFD,0xFD,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x8F,0xF8,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x1F,0x03,0x01,0x00,0x00,0x00,0x00,0x80,0xF0,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFE,0xF0,0xC0,0x00,0x00,0x00,0x00,0x01,0x07,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x1F,0xC4,0xC0,0x80,0x00,0x00,0x00,0x00,0x01,0x0F,0x1F,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x87,0xF1,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xE0,0x00,0x00,0x00,0x00,0x00,0x01,0x0F,0x7F,0x7F,
0x8F,0xE3,0xFC,0xFE,0xFF,0xFF,0xFF,0xFE,0xE0,0xC0,0x00,0x00,0x00,0x00,0x01,0x07,
0x1F,0x1F,0x8F,0xE1,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xE0,0xC0,0x00,0x00,0xC0,0xF8,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xF0,0x80,0x00,0x00,0xC0,
0xE0,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x0F,0x0F,0x0F,0x0F,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0E,0x0F,0x0F,0x0F,0x0F,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0E,0x0F,0x0F,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x04,0x00,
};
#endif
4、测试主程序

int32_t main(void)
{
    //配置RCC
    RCC_Configuration();

    //配置GPIO
    GPIO_Configuration();
                //i2c_config();
    //配置UART
    UART_Configuration();
                OLED_Config();
    printf("\r\n use CW32L031 simulate I2C READ EEPROM Example\r\n");
               
    while(1)
    {

                        GPIO_TogglePin(LED_GPIO_PORT, LED_GPIO_PINS);
      Delay(0xFF);
                        OLED_Display_Picture(0,0,64,8,(uint8_t *)**);
                        OLED_Display_string(64,0,"  OLED  ",SIZE16);
                        OLED_Display_string(64,2," example ",SIZE16);
                        OLED_Display_string(64,4," on ",SIZE16);
                        OLED_Display_string(64,6,"CW32L031",SIZE16);
                       
    }
}
三、最后的显示效果如下

具体功耗待后续测量一下;




使用特权

评论回复
沙发
weifeng90| | 2023-11-13 07:30 | 只看该作者
这个OLED屏以前的MP3就是用的这个啊

使用特权

评论回复
板凳
yangxiaor520| | 2023-11-13 08:20 | 只看该作者
现在这个屏用的少了

使用特权

评论回复
地板
怀揣少年梦|  楼主 | 2023-11-13 08:34 | 只看该作者
weifeng90 发表于 2023-11-13 07:30
这个OLED屏以前的MP3就是用的这个啊

是嘛,我是最近这几年才接触这个屏幕的

使用特权

评论回复
5
怀揣少年梦|  楼主 | 2023-11-13 08:35 | 只看该作者
yangxiaor520 发表于 2023-11-13 08:20
现在这个屏用的少了

尺寸小了点,不过在项目中还用到这个屏幕显示

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:一切皆有可能

28

主题

397

帖子

2

粉丝