微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > 射频无线通信设计 > 蓝牙4.0 oled 显示驱动源码

蓝牙4.0 oled 显示驱动源码

时间:10-02 整理:3721RD 点击:

蓝牙4.0  oled 显示驱动源码


在蓝牙4.0 BLE系统中,一般我们都是使用cc2540和cc2541,  有些项目例如智能手环等都需要低功耗的显示, 而oled屏幕只是点亮的那个像素耗电, 所以我们一般都是弄成黑屏白字的, oled屏幕功耗低显示效果好, 非一般的TFT材质的LCD可以比。
      我们回顾一下android的版本, android2.3之前的版本, 系统菜单如设置等菜单都是白色的, 但是随着oled显示屏在大屏幕手机上越来越普及, 背景非黑色就会很耗电, 我做过测试, 发现普通的设置菜单黑底与白底系统电流竟然相差150mA以上, 真的是耗电哇, 所以谷歌顺势就在android2.3及以后的版本后推出了黑底的菜单, 可以大大的降低整机功耗。
下面是我们项目中用的128x64的显示屏幕驱动。贴出来供有需要的朋友参考
1,  头文件:
#ifndef HAL_LCD_H  
#define HAL_LCD_H  
  
#ifdef __cplusplus  
extern "C"  
{  
#endif  
#include "Common.h"  
  
#define int8    unsigned char   
  
/* These are used to specify which line the text will be printed */  
#define HAL_LCD_LINE_1      0x01  
#define HAL_LCD_LINE_2      0x02  
/*
   This to support LCD with extended number of lines (more than 2).
   Don't use these if LCD doesn't support more than 2 lines
*/  
#define HAL_LCD_LINE_3      0x03  
#define HAL_LCD_LINE_4      0x04  
#define HAL_LCD_LINE_5      0x05  
#define HAL_LCD_LINE_6      0x06  
#define HAL_LCD_LINE_7      0x07  
#define HAL_LCD_LINE_8      0x08  
  
  
/* Max number of chars on a single LCD line */  
#define HAL_LCD_MAX_CHARS   21  
#define HAL_LCD_MAX_BUFF    25  
  
void HalLcd_HW_Init(void);  
void HalLcd_HW_WriteLine(uint8 line, const char *pText);  
//int8* IntToStr(int8* buf, int m);  
void DelayMS(unsigned int msec);  
  
#ifdef __cplusplus  
}  
#endif  
  
  
#endif  
2,  c 文件
#ifndef HAL_LCD_H  
#define HAL_LCD_H  
  
#ifdef __cplusplus  
extern "C"  
{  
#endif  
[cpp] view plain copy 在CODE上查看代码片派生到我的代码片
#include "Common.h"  
  
#define int8    unsigned char   
  
/* These are used to specify which line the text will be printed */  
#define HAL_LCD_LINE_1      0x01  
#define HAL_LCD_LINE_2      0x02  
/*
   This to support LCD with extended number of lines (more than 2).
   Don't use these if LCD doesn't support more than 2 lines
*/  
#define HAL_LCD_LINE_3      0x03  
#define HAL_LCD_LINE_4      0x04  
#define HAL_LCD_LINE_5      0x05  
#define HAL_LCD_LINE_6      0x06  
#define HAL_LCD_LINE_7      0x07  
#define HAL_LCD_LINE_8      0x08  
  
/* Max number of chars on a single LCD line */  
#define HAL_LCD_MAX_CHARS   21  
#define HAL_LCD_MAX_BUFF    25  
  
void HalLcd_HW_Init(void);  
void HalLcd_HW_WriteLine(uint8 line, const char *pText);  
//int8* IntToStr(int8* buf, int m);  
void DelayMS(unsigned int msec);  
  
#ifdef __cplusplus  
}  
#endif  

#endif  
2,  c 文件
[cpp] view plain copy 在CODE上查看代码片派生到我的代码片
/*
CC254x test demo [电装科技]  
by AMO
20130106
*/  
  
/*
说明:
oled 128x64的显示屏, 驱动实现代码
*/  
[cpp] view plain copy 在CODE上查看代码片派生到我的代码片
#include "ioCC2540.h"  
#include "stdio.h"  
#include "Hal_lcd.h"  
[cpp] view plain copy 在CODE上查看代码片派生到我的代码片
#define LCD_SCL P1_5       //SCLK  时钟 D0(SCLK)  
#define LCD_SDA P1_6       //SDA   D1(MOSI) 数据  
#define LCD_RST P1_7       //_RES  hardware reset   复位   
#define LCD_DC  P1_2       //A0  H/L 命令数据选通端,H:数据,L:命令  
  
#define X_WIDTH        128  
#define Y_WIDTH        64  
  
#ifdef LCD_SUPPORT  
/***************************16*16的点阵字体取模方式:共阴——列行式——逆向输出*********/  
const unsigned char F16x16[] =     
{      
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
  
  
  
  
/*--  文字:  服  --*/  
0x00,0xFF,0xFF,0x33,0xFF,0xFF,0x00,0xFF,0xFF,0xC3,0xDB,0xDB,0xDF,0xCF,0x00,0x00,  
0x20,0x7F,0x1F,0x63,0x7F,0x3F,0x00,0x7F,0x7F,0x20,0x37,0x18,0x3F,0x73,0x20,0x00,  
  
  
/*--  文字:  务  --*/  
0x80,0x80,0x90,0x98,0xCC,0xDF,0x77,0x66,0x66,0xF6,0xDE,0x8E,0x80,0x80,0x80,0x00,  
0x00,0x61,0x61,0x67,0x36,0x3E,0x1F,0x07,0x06,0x66,0x7E,0x3F,0x01,0x01,0x00,0x00,  
  
  
/*--  文字:  创  --*/  
0x20,0x30,0xF8,0xEC,0x67,0x6F,0xFC,0xF8,0x10,0xF8,0xF8,0x00,0xFE,0xFE,0x00,0x00,  
0x00,0x00,0x3F,0x7F,0x60,0x66,0x67,0x73,0x30,0x0F,0x0F,0x60,0x7F,0x3F,0x00,0x00,  
  
  
/*--  文字:  新  --*/  
0x00,0x66,0x7E,0x7E,0xE7,0xFF,0x7E,0x66,0x00,0xFE,0xFE,0x66,0xE6,0xE7,0x63,0x00,  
0x00,0x33,0x1B,0x63,0x7F,0x3F,0x0B,0x5B,0x70,0x3F,0x0F,0x00,0x7F,0x7F,0x00,0x00,  
  
  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
  
  
  
  
/*--  文字:  深  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x10,0x61,0x06,0xE0,0x00,0x26,0x22,0x1A,0x02,0xC2,0x0A,0x12,0x32,0x06,0x02,0x00,  
0x04,0xFC,0x03,0x20,0x20,0x11,0x11,0x09,0x05,0xFF,0x05,0x09,0x19,0x31,0x10,0x00,  
  
  
/*--  文字:  圳  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x10,0x10,0x10,0xFE,0x10,0x10,0xFE,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x00,0x00,  
0x08,0x08,0x04,0x47,0x24,0x18,0x07,0x00,0x00,0x1F,0x00,0x00,0x00,0x7F,0x00,0x00,  
  
  
/*--  文字:  市  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x04,0x04,0x04,0xE4,0x24,0x24,0x25,0xFE,0x24,0x24,0x24,0x24,0xE4,0x04,0x04,0x00,  
0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0xFF,0x00,0x00,0x10,0x20,0x1F,0x00,0x00,0x00,  
  
  
/*--  文字:  电  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x00,0x00,0xF8,0x48,0x48,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0xF8,0x00,0x00,0x00,  
0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x3F,0x44,0x44,0x44,0x44,0x4F,0x40,0x70,0x00,  
  
  
/*--  文字:  装  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x00,0x42,0x2C,0x24,0x10,0xFF,0x04,0x64,0xA4,0x24,0x3F,0x24,0x24,0x24,0x04,0x00,  
0x20,0x21,0x11,0x11,0xF9,0x45,0x23,0x03,0x05,0x09,0x11,0x29,0x45,0xC1,0x41,0x00,  
  
  
/*--  文字:  科  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x10,0x12,0x92,0x72,0xFE,0x51,0x91,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,  
0x04,0x02,0x01,0x00,0xFF,0x00,0x04,0x04,0x04,0x02,0x02,0x02,0xFF,0x01,0x01,0x00,  
  
  
/*--  文字:  技  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x08,0x08,0x88,0xFF,0x48,0x28,0x00,0xC8,0x48,0x48,0x7F,0x48,0xC8,0x48,0x08,0x00,  
0x01,0x41,0x80,0x7F,0x00,0x40,0x40,0x20,0x13,0x0C,0x0C,0x12,0x21,0x60,0x20,0x00,  
  
  
/*--  文字:  专  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x20,0x20,0x24,0x24,0xA4,0x64,0x3C,0x27,0x24,0x24,0xA4,0x24,0x24,0x20,0x20,0x00,  
0x00,0x00,0x00,0x00,0x01,0x01,0x09,0x11,0x29,0x45,0x03,0x01,0x00,0x00,0x00,0x00,  
  
  
/*--  文字:  业  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x00,0x10,0x60,0x80,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x80,0x60,0x38,0x10,0x00,  
0x20,0x20,0x20,0x23,0x21,0x3F,0x20,0x20,0x20,0x3F,0x22,0x21,0x20,0x30,0x20,0x00,  
  
  
/*--  文字:  专  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x20,0x20,0x24,0x24,0xA4,0x64,0x3C,0x27,0x24,0x24,0xA4,0x24,0x24,0x20,0x20,0x00,  
0x00,0x00,0x00,0x00,0x01,0x01,0x09,0x11,0x29,0x45,0x03,0x01,0x00,0x00,0x00,0x00,  
  
  
/*--  文字:  注  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x10,0x60,0x01,0x86,0x60,0x08,0x08,0x08,0x09,0xFE,0x08,0x08,0x08,0x08,0x08,0x00,  
0x04,0x04,0xFE,0x01,0x40,0x40,0x41,0x41,0x41,0x7F,0x41,0x41,0x41,0x41,0x40,0x00,  
  
  
/*--  文字:  无  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x00,0x40,0x42,0x42,0x42,0x42,0x42,0xFE,0xC2,0x42,0x42,0x42,0x42,0x42,0x40,0x00,  
0x40,0x40,0x20,0x10,0x08,0x04,0x03,0x00,0x3F,0x40,0x40,0x40,0x40,0x40,0x70,0x00,  
  
  
/*--  文字:  线  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x40,0x60,0x58,0xC7,0x62,0x00,0x90,0x90,0x90,0xFF,0x90,0x92,0x9C,0x94,0x80,0x00,  
0x20,0x22,0x23,0x12,0x12,0x12,0x20,0x20,0x10,0x13,0x0C,0x14,0x22,0x40,0xF8,0x00,  
  
  
/*--  文字:  通  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x40,0x41,0xC6,0x00,0x00,0xF2,0x52,0x52,0x56,0xFA,0x5A,0x56,0xF2,0x00,0x00,0x00,  
0x40,0x20,0x1F,0x20,0x40,0x5F,0x42,0x42,0x42,0x5F,0x4A,0x52,0x4F,0x40,0x40,0x00,  
  
  
/*--  文字:  讯  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x20,0x21,0x2E,0xE4,0x00,0x42,0x42,0xFE,0x42,0x42,0x42,0x02,0xFE,0x00,0x00,0x00,  
0x00,0x00,0x00,0x7F,0x20,0x10,0x00,0x7F,0x00,0x00,0x00,0x00,0x3F,0x40,0x38,0x00,  
  
  
/*--  文字:  十  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFF,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
  
  
/*--  文字:  年  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x40,0x20,0x10,0x0C,0xE3,0x22,0x22,0x22,0xFE,0x22,0x22,0x22,0x22,0x02,0x00,0x00,  
0x04,0x04,0x04,0x04,0x07,0x04,0x04,0x04,0xFF,0x04,0x04,0x04,0x04,0x04,0x04,0x00,  
  
  
/*--  文字:  经  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x20,0x30,0xAC,0x63,0x10,0x00,0x40,0x42,0x22,0x22,0x12,0x1A,0x26,0x42,0xC0,0x00,  
0x22,0x23,0x22,0x12,0x12,0x00,0x20,0x21,0x21,0x21,0x3F,0x21,0x21,0x21,0x20,0x00,  
  
  
/*--  文字:  验  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x02,0xFA,0x82,0x82,0xFE,0x80,0x40,0x60,0x58,0x46,0x48,0x50,0x20,0x20,0x20,0x00,  
0x08,0x08,0x04,0x24,0x40,0x3F,0x22,0x2C,0x21,0x2E,0x20,0x30,0x2C,0x23,0x20,0x00,  
  
  
/*--  文字:  开  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x40,0x42,0x42,0x42,0x42,0xFE,0x42,0x42,0x42,0x42,0xFE,0x42,0x42,0x42,0x42,0x00,  
0x00,0x40,0x20,0x10,0x0C,0x03,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,  
  
  
/*--  文字:  拓  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x08,0x08,0x08,0xFF,0x48,0x28,0x0A,0x02,0xE2,0x9E,0x82,0x82,0x82,0x82,0x02,0x00,  
0x02,0x42,0x81,0x7F,0x00,0x08,0x04,0x03,0x7F,0x20,0x20,0x20,0x20,0x7F,0x00,0x00,  
  
  
/*--  文字:  创  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x40,0x20,0xD0,0x4C,0x43,0x44,0x48,0xD8,0x30,0x10,0x00,0xFC,0x00,0x00,0xFF,0x00,  
0x00,0x00,0x3F,0x40,0x40,0x42,0x44,0x43,0x78,0x00,0x00,0x07,0x20,0x40,0x3F,0x00,  
  
  
/*--  文字:  新  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x20,0x24,0x2C,0x35,0xE6,0x34,0x2C,0x24,0x00,0xFC,0x24,0x24,0xE2,0x22,0x22,0x00,  
0x21,0x11,0x4D,0x81,0x7F,0x05,0x59,0x21,0x18,0x07,0x00,0x00,0xFF,0x00,0x00,0x00,  
  
  
/*--  文字:  !  --*/  
/*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*/  
0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
  
  
};  
  
  
/****************************************8*16的点阵************************************/  
static 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,//@ 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  
};  
#endif  
  
  
  
  
/************************************6*8的点阵************************************/  
static 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  
};  
  
  
/*--  宽度x高度=128x64  D:\mdcg.bmp--*/  
#if 0  
unsigned char BMP[] =     
{  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0xFC,0xFC,0x70,0xE0,0xFF,0x8C,0xF0,0xE0,0xC0,0xC0,0xC0,0xE0,  
0xE0,0xF0,0xF0,0xF0,0xF8,0x98,0x1C,0x0C,0x2C,0x24,0x04,0x1C,0xF8,0x00,0x00,0xFE,  
0xFF,0x4C,0x4C,0xF8,0xF8,0x60,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,0xC0,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,  
0x60,0x60,0xF8,0xF8,0xFF,0xBF,0xFE,0xFF,0xFF,0xFF,0x87,0x83,0xBF,0xBF,0xFF,0xFF,  
0xFD,0xE1,0xF1,0xFF,0xFF,0xFF,0xFC,0x61,0x62,0x32,0x13,0x1D,0x0F,0x00,0x00,0x03,  
0xEF,0x7A,0x7E,0xCF,0x9D,0x1B,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,  
0x18,0x0C,0xC6,0xE2,0x79,0x7D,0xB7,0xF2,0x71,0x39,0x19,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x0E,0x0E,0x0E,0xCE,0x0E,0x0E,0x0E,0x0E,0x0E,0xFE,0x00,0x00,0x00,0x00,  
0x0E,0x0E,0x0E,0xCE,0x3E,0xCE,0x0E,0x0E,0x0E,0xC0,0x00,0x00,0x00,0xFE,0x00,0x00,  
0x00,0x09,0x97,0xDE,0x6D,0xB7,0xFF,0x7F,0xFF,0xFF,0x9F,0x1F,0x4F,0x87,0xC7,0xE7,  
0x17,0x9F,0x9D,0xF1,0xE1,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0F,  
0x83,0xE0,0x60,0x1D,0xFF,0xFE,0x06,0x0E,0x1C,0x18,0x00,0x00,0xF0,0x87,0xC1,0xE0,  
0x70,0x38,0x1F,0x1E,0x1F,0x1D,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFE,0xC0,0xCE,0xF0,0xF0,0xC0,0x00,  
0x30,0x30,0x30,0xF0,0x30,0x30,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0xF0,0xCF,0xC0,0xC0,0xC0,0xC0,0xFE,0xC1,0xC0,0xC0,0x00,0x00,  
0x30,0x3E,0x3E,0x31,0xF0,0x31,0x3E,0x3E,0x30,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,  
0x00,0x00,0x00,0x03,0x0D,0x3E,0xDB,0x6B,0x37,0x1F,0x7C,0xFC,0xC5,0xC7,0x3F,0x07,  
0x03,0x86,0x8C,0xC0,0xC0,0xC1,0xE3,0x6F,0xEE,0xFC,0x38,0x30,0x30,0x90,0x90,0x7B,  
0xE9,0xEC,0x7C,0xFC,0xFF,0xFE,0xFE,0xF7,0xEF,0x3F,0x3F,0xBD,0xF7,0xDF,0x7E,0xF8,  
0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0xFF,0xFF,0xC1,0xC1,0xC1,0x01,0x01,0xFF,0x01,0x01,0xF1,0xF1,0x01,0x00,  
0x00,0x00,0x00,0xFF,0x00,0x00,0x0E,0x0E,0x0E,0xFF,0x0E,0x0E,0x0E,0xFE,0x00,0x00,  
0x00,0x38,0x38,0x38,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x01,0xFF,0xFF,0x00,0x00,  
0x38,0x38,0x38,0x38,0xFF,0x38,0x38,0x38,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x00,  
0x00,0x00,0x00,0x08,0xFC,0xFC,0x1E,0x3E,0xFE,0xFE,0xE7,0xE7,0xE3,0xC7,0xCF,0xD9,  
0xF1,0xF0,0xF9,0x0C,0x60,0xFF,0xFF,0xDB,0x9B,0x08,0x01,0xFF,0xFF,0xCC,0xEC,0xEE,  
0xEE,0xC3,0xFF,0x2D,0x6C,0x76,0x37,0x33,0x13,0xFF,0x7C,0x96,0xD6,0xEB,0x6B,0xE9,  
0xFF,0xFF,0xF8,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0xFF,0xFF,0xC1,0x01,0xFF,0x00,0x00,0x07,0xF8,0x06,0x01,0x01,0xC0,0x00,  
0xC0,0xC0,0xC0,0x3F,0x38,0x38,0x00,0x00,0xF8,0x07,0x00,0x00,0x00,0xFF,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x07,0x07,0x00,0x00,  
0x38,0x38,0x38,0x38,0x07,0x06,0x06,0x06,0x06,0x01,0x38,0x38,0x38,0x3F,0x00,0x00,  
0x00,0x00,0x00,0x00,0x7F,0xFF,0x00,0x00,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x81,  
0xC1,0x7D,0x1F,0x03,0x87,0x66,0x7C,0x1C,0x1E,0x1F,0x3F,0x3B,0x33,0x37,0x37,0x7E,  
0x7C,0x37,0x34,0x37,0x3F,0x1B,0x1B,0x78,0x7F,0x87,0x84,0xFE,0xFE,0x03,0x07,0x07,  
0x18,0x38,0x60,0xC0,0x0F,0x3C,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x38,0x07,0x07,0x01,0x06,0x01,0x38,0x38,0x06,0x01,0x06,0x38,0x38,0x3F,0x00,  
0x01,0x01,0x01,0x00,0x38,0x38,0x06,0x06,0x01,0x38,0x38,0x38,0x38,0x07,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x3F,0x3F,0x3F,0x3F,0x3F,0xB0,0x80,0x70,0xB8,0x7F,0x7F,  
0x1B,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x40,  
0x40,0x60,0xA0,0xB0,0x98,0x48,0x48,0x64,0x34,0x1F,0x1B,0x0F,0x07,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x07,0x06,0x19,0x3F,0x7C,0xF8,0xC0,0x80,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0xF8,0xCC,0xE6,0x1F,0x0D,0x03,0x01,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x78,0x3F,0x3F,0x3F,0x3F,0x06,  
0x02,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0x0E,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  
};  
#endif  
  
/*********************LCD写数据************************************/   
void LCD_WrDat(unsigned char dat)      
{  
    unsigned char i=8, temp=0;  
    LCD_DC=1;   
    for(i=0;i<8;i++) //发送一个八位数据   
    {  
        LCD_SCL=0;   
         
        temp = dat&0x80;  
        if (temp == 0)  
        {  
            LCD_SDA = 0;  
        }  
        else  
        {  
            LCD_SDA = 1;  
        }  
        LCD_SCL=1;               
        dat<<=1;      
    }  
}  
/*********************LCD写命令************************************/                                          
void LCD_WrCmd(unsigned char cmd)  
{  
    unsigned char i=8, temp=0;  
    LCD_DC=0;  
    for(i=0;i<8;i++) //发送一个八位数据   
    {   
        LCD_SCL=0;   
         
        temp = cmd&0x80;  
        if (temp == 0)  
        {  
            LCD_SDA = 0;  
        }  
        else  
        {  
            LCD_SDA = 1;  
        }  
        LCD_SCL=1;  
        cmd<<=1;;         
    }      
}  
/*********************LCD 设置坐标************************************/  
void LCD_Set_Pos(unsigned char x, unsigned char y)   
{   
    LCD_WrCmd(0xb0+y);  
    LCD_WrCmd(((x&0xf0)>>4)|0x10);  
    LCD_WrCmd((x&0x0f)|0x01);   
}   
/*********************LCD全屏************************************/  
void LCD_Fill(unsigned char bmp_dat)   
{  
    unsigned char y,x;  
    for(y=0;y<8;y++)  
    {  
        LCD_WrCmd(0xb0+y);  
        LCD_WrCmd(0x01);  
        LCD_WrCmd(0x10);  
        for(x=0;x<X_WIDTH;x++)  
            LCD_WrDat(bmp_dat);  
    }  
}  
  
  
/***************功能描述:行填充, y为页范围0~7****************/  
void LCD_FillLine(unsigned char y,unsigned char ch)  
{  
    unsigned char x;      
    LCD_WrCmd(0xb0+y);  
    LCD_WrCmd(0x01);  
    LCD_WrCmd(0x10);   
    for(x=0;x<X_WIDTH;x++)  
        LCD_WrDat(ch);  
}  
  
  
/*********************LCD复位************************************/  
void LCD_CLS(void)  
{  
    unsigned char y,x;      
    for(y=0;y<8;y++)  
    {  
        LCD_WrCmd(0xb0+y);  
        LCD_WrCmd(0x01);  
        LCD_WrCmd(0x10);   
        for(x=0;x<X_WIDTH;x++)  
            LCD_WrDat(0);  
    }  
}  
/*********************LCD初始化************************************/  
void HalLcd_HW_Init(void)      
{   
    P1SEL &= 0x1b; //让 P1.2 P1.5 P1.6 P1.7为普通IO口           00011011  
    P1DIR |= 0xe4; //把 P1.2 P1.3 1.7设置为输出                 11100100  
      
    LCD_SCL=1;  
    LCD_RST=0;  
    HalHW_WaitMS(50);  
    LCD_RST=1;      //从上电到下面开始初始化要有足够的时间,即等待RC复位完毕     
    LCD_WrCmd(0xae);//--turn off oled panel  
    LCD_WrCmd(0x00);//---set low column address  
    LCD_WrCmd(0x10);//---set high column address  
    LCD_WrCmd(0x40);//--set start line address  Set Mapping RAM Display Start Line (0x00~0x3F)  
    LCD_WrCmd(0x81);//--set contrast control register  
    LCD_WrCmd(0xcf); // Set SEG Output Current Brightness  
    LCD_WrCmd(0xa1);//--Set SEG/Column Mapping     0xa0左右反置 0xa1正常  
    LCD_WrCmd(0xc8);//Set COM/Row Scan Direction   0xc0上下反置 0xc8正常  
    LCD_WrCmd(0xa6);//--set normal display  
    LCD_WrCmd(0xa8);//--set multiplex ratio(1 to 64)  
    LCD_WrCmd(0x3f);//--1/64 duty  
    LCD_WrCmd(0xd3);//-set display offset    Shift Mapping RAM Counter (0x00~0x3F)  
    LCD_WrCmd(0x00);//-not offset  
    LCD_WrCmd(0xd5);//--set display clock divide ratio/oscillator frequency  
    LCD_WrCmd(0x80);//--set divide ratio, Set Clock as 100 Frames/Sec  
    LCD_WrCmd(0xd9);//--set pre-charge period  
    LCD_WrCmd(0xf1);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock  
    LCD_WrCmd(0xda);//--set com pins hardware configuration  
    LCD_WrCmd(0x12);  
    LCD_WrCmd(0xdb);//--set vcomh  
    LCD_WrCmd(0x40);//Set VCOM Deselect Level  
    LCD_WrCmd(0x20);//-Set Page Addressing Mode (0x00/0x01/0x02)  
    LCD_WrCmd(0x02);//  
    LCD_WrCmd(0x8d);//--set Charge Pump enable/disable  
    LCD_WrCmd(0x14);//--set(0x10) disable  
    LCD_WrCmd(0xa4);// Disable Entire Display On (0xa4/0xa5)  
    LCD_WrCmd(0xa6);// Disable Inverse Display On (0xa6/a7)   
    LCD_WrCmd(0xaf);//--turn on oled panel  
    LCD_Fill(0x00); //初始成黑屏  
    LCD_Set_Pos(0,0);     
      
      
}   
/***************功能描述:显示6*8一组标准ASCII字符串    显示的坐标(x,y),y为页范围0~7****************/  
void LCD_P6x8Str(unsigned char x, unsigned char y,unsigned char ch[])  
{  
    unsigned char c=0,i=0,j=0;        
    while (ch[j]!='\0')  
    {      
        c =ch[j]-32;  
        if(x>126){x=0;y++;}  
        LCD_Set_Pos(x,y);      
        for(i=0;i<6;i++)      
            LCD_WrDat(F6x8[c]);   
        x+=6;  
        j++;  
    }  
}  
  
  
/***********功能描述:显示一行ascii 码?无显示的点阵显示黑色,     y为页的范围0~7*****************/  
void HalLcd_HW_WriteLine(unsigned char line, const char *pText)  
{  
    LCD_FillLine(line-1, 0);                            //先把这一行显示成黑色  
    LCD_P6x8Str(0, line-1, (unsigned char *)pText);  
}  
  
  
#ifdef LCD_SUPPORT  
/*******************功能描述:显示8*16一组标准ASCII字符串     显示的坐标(x,y),y为页范围0~7****************/  
void LCD_P8x16Str(unsigned char x, unsigned char y,unsigned char ch[])  
{  
    unsigned char c=0,i=0,j=0;  
    while (ch[j]!='\0')  
    {      
        c =ch[j]-32;  
        if(x>120){x=0;y++;}  
        LCD_Set_Pos(x,y);      
        for(i=0;i<8;i++)      
            LCD_WrDat(F8X16[c*16+i]);  
        LCD_Set_Pos(x,y+1);      
        for(i=0;i<8;i++)      
            LCD_WrDat(F8X16[c*16+i+8]);   
        x+=8;  
        j++;  
    }  
}  
/*****************功能描述:显示16*16点阵  显示的坐标(x,y),y为页范围0~7****************************/  
void LCD_P16x16Ch(unsigned char x, unsigned char y, unsigned char N)  
{  
    unsigned char wm=0;  
    unsigned int adder=32*N;  //        
    LCD_Set_Pos(x , y);  
    for(wm = 0;wm < 16;wm++)  //               
    {  
        LCD_WrDat(F16x16[adder]);      
        adder += 1;  
    }        
    LCD_Set_Pos(x,y + 1);   
    for(wm = 0;wm < 16;wm++) //           
    {  
        LCD_WrDat(F16x16[adder]);  
        adder += 1;  
    }            
}  
  
  
/***********功能描述:显示显示BMP图片128×64起始点坐标(x,y),x的范围0~127,y为页的范围0~7*****************/  
void Draw_BMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[])  
{      
    unsigned int j=0;  
    unsigned char x,y;  
      
    if(y1%8==0) y=y1/8;        
    else y=y1/8+1;  
    for(y=y0;y<y1;y++)  
    {  
        LCD_Set_Pos(x0,y);                  
        for(x=x0;x<x1;x++)  
        {        
            LCD_WrDat(BMP[j++]);              
        }  
    }  
}   
#endif  
/*int 转 字符串函数*/  
/*
unsigned char* IntToStr(unsigned char* buf, int m)
{
    unsigned char tmp[16];
    unsigned long isNegtive = 0;
    unsigned long index;


    if(m < 0)
    {
        isNegtive = 1;
        m = - m;
    }


    tmp[15] = '\0';
    index = 14;
    do  
    {
        tmp[index--] = m % 10 + '0';
        m /= 10;
    } while (m > 0);


    if(isNegtive)
        tmp[index--] = '-';
     
    strcpy((char *)buf, (char *)(tmp + index + 1));   
     
    return buf;
}
*/  
  
  
#ifdef LCD_SUPPORT  
int main()  
{  
    unsigned char i=0;   
         
    HalLcd_HW_Init();                //oled 初始化   
    LCD_Fill(0xff);                  //屏全亮   
      
    while(1)  
    {  
        for(i=0; i<8; i++)  
        {  
            LCD_P16x16Ch(i*16,0,i);  //点阵显示  
            LCD_P16x16Ch(i*16,2,i+8);  
            LCD_P16x16Ch(i*16,4,i+16);  
            LCD_P16x16Ch(i*16,6,i+24);  
        }   
        HalHW_WaitMS(1000);   
        LCD_CLS();     
        LCD_P8x16Str(44,0,"saler");     
        LCD_P8x16Str(20,2,"OLED DISPLAY");     
  
  
        LCD_P8x16Str(8,4,"TEL:18588220515");   
        LCD_P6x8Str(20,6,"mzy202@126.com");         
        LCD_P6x8Str(20,7,"2013-10-6 18:18");      
        HalHW_WaitMS(1000);   
         
        //LCD_CLS();  
        //Draw_BMP(0,0,128,8,BMP);     //图片显示  
        //DelayMS(1000);   
    }   
}  
#endif

号东西,多学习

学习学习 好东西,要学习 多学习

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top