123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164 |
- ///****************************************************************************
- //* Filename: hal_lcd.c
- //* Author: Andy https://aldsz.taobao.com
- //* Date: 2015-06-16
- //* Version: 1.0
- //* Description: OLED driver
- //****************************************************************************/
- //#include "hal_types.h"
- //#include "hal_lcd.h"
- //#include "OSAL.h"
- //#include "OnBoard.h"
- //#include "hal_assert.h"
- //#include <string.h>
- //
- //#if defined (ZTOOL_P1) || defined (ZTOOL_P2)
- // #include "DebugTrace.h"
- //#endif
- //
- //
- ////------------------------------------------------------------------------------
- //#define LCD_COMMAND 0x00
- //#define LCD_DATA 0x01
- //
- //#define LCD_MAX_BUF 25
- //
- //#define SOFTWARE_SPI
- ////#define HARDWARE_SPI //采用硬件SPI通讯
- //
- //#define COL_SPACE 2 //字符间距
- //#define ROW_SPACE 4 //行间距
- //#define ALL_CNS 128
- //#define X_MAX_PIXEL 128
- //#define Y_MAX_PIXEL 128
- //
- //// SPI TFT LCD端口定义
- //#define LCD_DC P0_0 // 数据/命令选择
- //#define LCD_SDA P1_3 // 双向数据
- //#define LCD_SCL P1_2 // 时钟
- ////#define LCD_CS P1_2 // 片选, L_S 将片选接地
- //#define LCD_RST P1_7 // 控制lcd复位
- //
- ////液晶控制口置1操作语句宏定义
- ////#define LCD_CS_SET (LCD_CS_CLRx01)
- //#define LCD_DC_SET (LCD_DC = 0x01)
- //#define LCD_SDA_SET (LCD_SDA = 0x01)
- //#define LCD_SCL_SET (LCD_SCL = 0x01)
- //#define LCD_RST_SET (LCD_RST = 0x01)
- //
- ////液晶控制口置0操作语句宏定义
- ////#define LCD_CS_CLR (LCD_CS_CLRx00)
- //#define LCD_DC_CLR (LCD_DC = 0x00)
- //#define LCD_SDA_CLR (LCD_SDA = 0x00)
- //#define LCD_SCL_CLR (LCD_SCL = 0x00)
- //#define LCD_RST_CLR (LCD_RST = 0x00)
- //
- //
- //void SPI_Init(void);
- //void LCD_clear(unsigned int color);
- //void LCD_write_EN_string(unsigned char X,unsigned char Y,uint8 *s);
- //static void LCD_set_window(unsigned int X, unsigned int Y,
- // unsigned Width,unsigned int Height);
- //static void LCD_write_EN(unsigned int X, unsigned int Y, unsigned char c);
- //static void LCD_write_CN(unsigned int X, unsigned int Y, unsigned char c);
- //
- //unsigned int Color = BLUE; //默认前景颜色
- //unsigned int Color_BK = GREEN;//默认背景颜色
- ////------------------------------------------------------------------------------
- //
- //#define XLevelL 0x00
- //#define XLevelH 0x10
- //#define XLevel ((XLevelH&0x0F)*16+XLevelL)
- //#define Max_Column 128
- //#define Max_Row 64
- //#define Brightness 0xCF
- //#define X_WIDTH 128
- //#define Y_WIDTH 64
- //
- //#define LCD_MAX_BUF 25
- //#define HAL_LCD_MAX_CHARS 16 // Max number of chars on a single LCD line
- //
- //
- //#if (HAL_LCD == TRUE)
- //void HalLcd_HW_Init(void);
- //void HalLcd_HW_WaitUs(uint16 i);
- //void HalLcd_HW_Clear(void);
- //void HalLcd_HW_Control(uint8 cmd);
- //void HalLcd_HW_Write(uint8 data);
- //void HalLcd_HW_SetContrast(uint8 value);
- //void HalLcd_HW_WriteChar(uint8 line, uint8 col, char text);
- //void HalLcd_HW_WriteLine(uint8 line, const char *pText);
- //
- //void DelayMS(unsigned int msec);
- //void LCD_WrDat(unsigned char dat);
- //void LCD_WrCmd(unsigned char cmd);
- //void LCD_Set_Pos(unsigned char x, unsigned char y);
- //void LCD_Fill(unsigned char bmp_dat) ;
- //void LCD_CLS(void);
- //
- ////-----------------------------------------------------------------------------
- //void DrawRect(unsigned int Xpos, unsigned int Ypos, unsigned int Width,
- // unsigned int Height,unsigned Color);
- //void DrawRectFill(unsigned int Xpos , unsigned int Ypos, unsigned int Width,
- // unsigned int Height, unsigned Color);
- //void SendByte(unsigned char Data);
- //void SPI_WriteData(unsigned char Data);
- //void LCD_write_byte(unsigned char data, unsigned char command);
- //void LCD_WriteData_16Bit(unsigned short Data);
- //void LCD_write_CN_string(unsigned char X,unsigned char Y,uint8 *s);
- //void ShowImage(const unsigned char *p);
- //
- //void DrawPixel(unsigned int x, unsigned int y, unsigned int color);
- //void DrawVerticalLine(unsigned int x, unsigned int y,
- // unsigned int Length,unsigned int Color);
- //void DrawHorizonLine(unsigned int x, unsigned int y,
- // unsigned int Length,unsigned int Color);
- //void Lcd_Reset(void);
- //
- //
- ////中文14x14点阵字符索引 ALD
- //__code const unsigned char CN14x14_Index[] =
- //{
- // "科技用户登录帐号密码确定取消专业专注无线通讯诚信立足创新致远强大原:"
- //};
- //
- ////中文14x14点阵字符 ald
- // const unsigned char CN14x14[][28] =
- //{
- //0x00,0x20,0x0D,0x20,0x70,0xA0,0x10,0xA0,0x12,0x20,0xFD,0x20,0x11,0x20,0x30,0x38,
- //0x3B,0xE0,0x54,0x20,0x90,0x20,0x10,0x20,0x10,0x20,0x10,0x20,/*"科",6*/
- //
- //0x20,0x80,0x20,0x80,0x20,0x80,0xF7,0xF0,0x20,0x80,0x20,0x80,0x27,0xE0,0x32,0x20,
- //0xE2,0x20,0x21,0x40,0x20,0x80,0x21,0x40,0x22,0x20,0xEC,0x18,/*"技",7*/
- //
- //0x00,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,
- //0x3F,0xF8,0x21,0x08,0x21,0x08,0x41,0x08,0x41,0x08,0x80,0x38,/*"用",8*/
- //
- //0x02,0x00,0x01,0x00,0x3F,0xF8,0x20,0x08,0x20,0x08,0x20,0x08,0x3F,0xF8,0x20,0x08,
- //0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,/*"户",9*/
- //
- //0x01,0x20,0x7D,0x40,0x04,0x90,0x28,0xA0,0x10,0x40,0x2F,0xA0,0x40,0x18,0x9F,0xC0,
- //0x10,0x40,0x10,0x40,0x1F,0xC0,0x10,0x40,0x08,0x80,0xFF,0xF8,/*"登",10*/
- //
- //0x00,0x00,0x7F,0xE0,0x00,0x20,0x3F,0xE0,0x00,0x20,0xFF,0xF8,0x02,0x00,0x22,0x20,
- //0x13,0x40,0x0A,0x80,0x12,0x40,0x22,0x20,0xC2,0x18,0x0E,0x00,/*"录",11*/
- //
- //0x21,0x00,0x21,0x10,0x21,0x10,0xF9,0x20,0xA9,0x40,0xA9,0x00,0xAB,0xF8,0xA9,0x40,
- //0xA9,0x40,0xA9,0x20,0xB9,0x20,0x21,0x50,0x21,0x88,0x21,0x00,/*"帐",12*/
- //
- //0x3F,0xE0,0x20,0x20,0x20,0x20,0x3F,0xE0,0x00,0x00,0x00,0x00,0xFF,0xF8,0x08,0x00,
- //0x10,0x00,0x3F,0xE0,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0xC0,/*"号",13*/
- //
- //0x02,0x00,0xFF,0xF8,0x80,0x08,0x04,0x40,0x52,0x90,0x51,0x08,0x92,0x28,0x0F,0xE0,
- //0x30,0x00,0xC2,0x00,0x22,0x20,0x22,0x20,0x3F,0xE0,0x00,0x20,/*"密",14*/
- //
- //0x00,0x00,0x07,0xE0,0xF8,0x20,0x22,0x20,0x22,0x20,0x42,0x20,0x7B,0xF8,0xC8,0x08,
- //0x48,0x08,0x4F,0xE8,0x48,0x08,0x78,0x08,0x48,0x08,0x00,0x30,/*"码",15*/
- //
- //0x01,0x00,0x01,0xF0,0xFA,0x10,0x24,0x20,0x23,0xF8,0x42,0x48,0x7A,0x48,0xCB,0xF8,
- //0x4A,0x48,0x4A,0x48,0x4B,0xF8,0x7A,0x48,0x42,0x48,0x04,0x18,/*"确",16*/
- //
- //0x04,0x00,0x02,0x00,0xFF,0xF8,0x80,0x08,0x00,0x00,0x3F,0xE0,0x02,0x00,0x02,0x00,
- //0x22,0x00,0x23,0xE0,0x22,0x00,0x22,0x00,0x52,0x00,0x8F,0xF8,/*"定",17*/
- //
- //0x00,0x00,0xFC,0x00,0x4B,0xF0,0x49,0x10,0x79,0x10,0x49,0x10,0x49,0x10,0x78,0xA0,
- //0x48,0xA0,0x4E,0x40,0xF8,0x40,0x08,0xA0,0x09,0x10,0x0A,0x08,/*"取",18*/
- //
- //0x00,0x80,0x44,0x90,0x22,0xA0,0x10,0x80,0x07,0xF0,0x84,0x10,0x44,0x10,0x17,0xF0,
- //0x14,0x10,0x24,0x10,0x27,0xF0,0x44,0x10,0x44,0x10,0x04,0x70,/*"消",19*/
- //
- //0x02,0x00,0x02,0x00,0x7F,0xF0,0x04,0x00,0x04,0x00,0xFF,0xF8,0x08,0x00,0x10,0x00,
- //0x3F,0xE0,0x00,0x20,0x00,0x40,0x1C,0x80,0x03,0x00,0x00,0x80,/*"专",20*/
- //
- //0x08,0x80,0x08,0x80,0x08,0x80,0x88,0x90,0x48,0x90,0x48,0x90,0x28,0xA0,0x28,0xA0,
- //0x28,0xC0,0x08,0x80,0x08,0x80,0x08,0x80,0x08,0x80,0xFF,0xF8,/*"业",21*/
- //
- //0x02,0x00,0x02,0x00,0x7F,0xF0,0x04,0x00,0x04,0x00,0xFF,0xF8,0x08,0x00,0x10,0x00,
- //0x3F,0xE0,0x00,0x20,0x00,0x40,0x1C,0x80,0x03,0x00,0x00,0x80,/*"专",22*/
- //
- //0x01,0x00,0x40,0x80,0x20,0x00,0x17,0xF0,0x00,0x80,0x80,0x80,0x40,0x80,0x00,0x80,
- //0x17,0xF0,0x10,0x80,0x20,0x80,0x20,0x80,0x40,0x80,0x4F,0xF8,/*"注",23*/
- //
- //0x00,0x00,0x7F,0xF0,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xF8,0x05,0x00,
- //0x05,0x00,0x09,0x00,0x11,0x00,0x21,0x08,0x41,0x08,0x80,0xF8,/*"无",24*/
- //
- //0x20,0xA0,0x20,0x90,0x48,0x80,0x48,0xF0,0xF3,0x80,0x10,0x80,0x20,0xB8,0x43,0xC0,
- //0xF8,0x90,0x00,0xA0,0x00,0x48,0x18,0xA8,0xE3,0x18,0x00,0x08,/*"线",25*/
- //
- //0x47,0xF0,0x21,0x20,0x20,0xC0,0x07,0xF0,0x04,0x90,0xE4,0x90,0x27,0xF0,0x24,0x90,
- //0x24,0x90,0x27,0xF0,0x24,0x90,0x24,0xB0,0x50,0x00,0x8F,0xF8,/*"通",26*/
- //
- //0x40,0x00,0x2F,0xE0,0x22,0x20,0x02,0x20,0x02,0x20,0xE2,0x20,0x2F,0xE0,0x22,0x20,
- //0x22,0x20,0x22,0x28,0x2A,0x28,0x32,0x28,0x22,0x18,0x02,0x08,/*"讯",27*/
- //
- //0x40,0x50,0x20,0x48,0x20,0x40,0x07,0xF8,0xE4,0x40,0x24,0x48,0x27,0x48,0x25,0x50,
- //0x25,0x50,0x2D,0x20,0x35,0x28,0x2B,0x68,0x08,0x98,0x11,0x08,/*"诚",28*/
- //
- //0x11,0x00,0x10,0x80,0x2F,0xF8,0x20,0x00,0x67,0xF0,0xA0,0x00,0x27,0xF0,0x20,0x00,
- //0x27,0xF0,0x24,0x10,0x24,0x10,0x24,0x10,0x27,0xF0,0x24,0x10,/*"信",29*/
- //
- //0x04,0x00,0x02,0x00,0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,
- //0x10,0x40,0x10,0x40,0x08,0x80,0x08,0x80,0x01,0x00,0xFF,0xF8,/*"立",30*/
- //
- //0x00,0x00,0x3F,0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0x3F,0xE0,0x02,0x00,0x02,0x00,
- //0x22,0x00,0x23,0xF0,0x22,0x00,0x22,0x00,0x52,0x00,0x8F,0xF8,/*"足",31*/
- //
- //0x10,0x10,0x10,0x10,0x28,0x10,0x24,0x90,0x42,0x90,0x80,0x90,0x7C,0x90,0x44,0x90,
- //0x44,0x90,0x44,0x90,0x58,0x10,0x42,0x10,0x42,0x10,0x3E,0x70,/*"创",32*/
- //
- //0x20,0x18,0x10,0xE0,0xFE,0x80,0x44,0x80,0x28,0x80,0xFE,0xF8,0x00,0x90,0x10,0x90,
- //0xFE,0x90,0x10,0x90,0x54,0x90,0x92,0x90,0x11,0x10,0x72,0x10,/*"新",33*/
- //
- //0x00,0x80,0xFE,0x80,0x10,0x80,0x24,0xF8,0x43,0x10,0xFE,0x90,0x12,0x90,0x10,0x90,
- //0xFE,0xA0,0x10,0xA0,0x10,0x40,0x1E,0xA0,0xF1,0x10,0x02,0x08,/*"致",34*/
- //
- //0x00,0x00,0x47,0xE0,0x20,0x00,0x20,0x00,0x00,0x00,0x0F,0xF0,0xE2,0x40,0x22,0x40,
- //0x22,0x40,0x22,0x48,0x24,0x48,0x28,0x38,0x50,0x00,0x8F,0xF8,/*"远",35*/
- //
- //0x00,0x00,0xF3,0xE0,0x12,0x20,0x12,0x20,0xF3,0xE0,0x80,0x80,0x87,0xF0,0x84,0x90,
- //0xF4,0x90,0x17,0xF0,0x10,0x80,0x10,0x90,0x1F,0xF8,0x60,0x08,/*"强",36*/
- //
- //0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x05,0x00,0x05,0x00,
- //0x05,0x00,0x08,0x80,0x08,0x80,0x10,0x40,0x20,0x20,0xC0,0x18,/*"大",37*/
- //
- //0x3F,0xF8,0x20,0x80,0x21,0x00,0x27,0xF0,0x24,0x10,0x27,0xF0,0x24,0x10,0x27,0xF0,
- //0x20,0x80,0x24,0x90,0x24,0x88,0x48,0x88,0x40,0x80,0x83,0x80,/*"原",38*/
- //
- //0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,
- //0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,/*":",41*/
- //
- //};
- //
- ////英文7x14点阵字符 andy
- //__code const unsigned char ASCII7x14[][14] =
- //{
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//" ",0//
- //{0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x30,0x30,0x00,0x00},//"!",1//
- //{0x00,0x14,0x28,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//""",2//
- //{0x00,0x00,0x00,0x28,0x28,0xFC,0x28,0x48,0x50,0xFC,0x50,0x50,0x00,0x00},//"#",3//
- //{0x00,0x00,0x10,0x38,0x54,0x54,0x30,0x18,0x14,0x54,0x54,0x38,0x10,0x00},//"$",4//
- //{0x00,0x00,0x00,0x44,0xA8,0xA8,0xB0,0x54,0x1A,0x2A,0x2A,0x44,0x00,0x00},//"%",5//
- //{0x00,0x00,0x00,0x20,0x50,0x50,0x60,0xAC,0xA8,0x98,0x92,0x7C,0x00,0x00},//"&",6//
- //{0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"'",7//
- //{0x00,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x00},//"(",8//
- //{0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x00},//">",9//
- //{0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0x38,0xD6,0x10,0x10,0x00,0x00,0x00},//"*",10//
- //{0x00,0x00,0x00,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x00,0x00,0x00,0x00},//"+",11//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x20,0xC0},//",",12//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"-",13//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00},//".",14//
- //{0x00,0x02,0x04,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x40,0x00},//"/",15//
- //{0x00,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30,0x00,0x00},//"0",16//
- //{0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},//"1",17//
- //{0x00,0x00,0x00,0x38,0x44,0x44,0x04,0x08,0x10,0x20,0x44,0x7C,0x00,0x00},//"2",18//
- //{0x00,0x00,0x00,0x38,0x44,0x44,0x18,0x04,0x04,0x44,0x44,0x38,0x00,0x00},//"3",19//
- //{0x00,0x00,0x08,0x08,0x18,0x28,0x48,0x48,0x88,0x7C,0x08,0x1C,0x00,0x00},//"4",20//
- //{0x00,0x00,0x00,0x7C,0x40,0x40,0x78,0x44,0x04,0x44,0x44,0x38,0x00,0x00},//"5",21//
- //{0x00,0x00,0x00,0x3C,0x44,0x80,0xB8,0xC4,0x84,0x84,0x84,0x78,0x00,0x00},//"6",22//
- //{0x00,0x00,0x00,0x7C,0x44,0x48,0x08,0x10,0x10,0x10,0x10,0x10,0x00,0x00},//"7",23//
- //{0x00,0x00,0x00,0x78,0x84,0x84,0x48,0x78,0x84,0x84,0x84,0x78,0x00,0x00},//"8",24//
- //{0x00,0x00,0x00,0x78,0x84,0x84,0x84,0x8C,0x74,0x04,0x88,0xF0,0x00,0x00},//"9",25//
- //{0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x30,0x30,0x00,0x00},//":",26//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x10,0x20},//";",27//
- //{0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x00,0x00,0x00},//"<",28//
- //{0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00},//"=",29//
- //{0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x00},//">",30//
- //{0x00,0x00,0x78,0x84,0x84,0x84,0x08,0x10,0x10,0x00,0x30,0x30,0x00,0x00},//"?",31//
- //{0x00,0x00,0x00,0x38,0x44,0x9A,0xAA,0xAA,0xAA,0xB4,0x42,0x3C,0x00,0x00},//"@",32//
- //{0x00,0x00,0x00,0x10,0x10,0x28,0x28,0x28,0x38,0x44,0x44,0xEE,0x00,0x00},//"A",33//
- //{0x00,0x00,0x00,0xF8,0x44,0x44,0x78,0x44,0x44,0x44,0x44,0xF8,0x00,0x00},//"B",34//
- //{0x00,0x00,0x00,0x3C,0x44,0x84,0x80,0x80,0x80,0x80,0x44,0x38,0x00,0x00},//"C",35//
- //{0x00,0x00,0x00,0xF0,0x48,0x44,0x44,0x44,0x44,0x44,0x48,0xF0,0x00,0x00},//"D",36//
- //{0x00,0x00,0x00,0xFC,0x44,0x40,0x48,0x78,0x48,0x40,0x44,0xFC,0x00,0x00},//"E",37//
- //{0x00,0x00,0x00,0xFC,0x42,0x40,0x48,0x78,0x48,0x40,0x40,0xE0,0x00,0x00},//"F",38//
- //{0x00,0x00,0x00,0x3C,0x44,0x84,0x80,0x80,0x8E,0x84,0x44,0x38,0x00,0x00},//"G",39//
- //{0x00,0x00,0x00,0xEE,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0xEE,0x00,0x00},//"H",40//
- //{0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},//"I",41//
- //{0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x90,0xE0},//"J",42//
- //{0x00,0x00,0x00,0xEE,0x44,0x48,0x50,0x70,0x48,0x48,0x44,0xEE,0x00,0x00},//"K",43//
- //{0x00,0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x44,0xFC,0x00,0x00},//"L",44//
- //{0x00,0x00,0x00,0xEE,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x54,0xD6,0x00,0x00},//"M",45//
- //{0x00,0x00,0x00,0xEE,0x64,0x64,0x54,0x54,0x54,0x4C,0x4C,0xE4,0x00,0x00},//"N",46//
- //{0x00,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30,0x00,0x00},//"O",47//
- //{0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x40,0x40,0x40,0xE0,0x00,0x00},//"P",48//
- //{0x00,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x84,0xB4,0x48,0x38,0x0C,0x00},//"Q",49//
- //{0x00,0x00,0x00,0xF8,0x44,0x44,0x78,0x50,0x48,0x48,0x44,0xE6,0x00,0x00},//"R",50//
- //{0x00,0x00,0x00,0x3C,0x44,0x40,0x20,0x18,0x04,0x04,0x44,0x78,0x00,0x00},//"S",51//
- //{0x00,0x00,0x00,0xFE,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},//"T",52//
- //{0x00,0x00,0x00,0xEE,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00,0x00},//"U",53//
- //{0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x28,0x28,0x10,0x10,0x00,0x00},//"V",54//
- //{0x00,0x00,0x00,0xD6,0x54,0x54,0x54,0x54,0x6C,0x28,0x28,0x28,0x00,0x00},//"W",55//
- //{0x00,0x00,0x00,0xEE,0x44,0x28,0x28,0x10,0x28,0x28,0x44,0xEE,0x00,0x00},//"X",56//
- //{0x00,0x00,0x00,0xEE,0x44,0x28,0x28,0x10,0x10,0x10,0x10,0x38,0x00,0x00},//"Y",57//
- //{0x00,0x00,0x00,0x7C,0x88,0x08,0x10,0x20,0x20,0x40,0x44,0xFC,0x00,0x00},//"Z",58//
- //{0x00,0x1C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1C,0x00},//"[",59//
- //{0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00},//"]",60//
- //{0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x70,0x00},//"]",61//
- //{0x00,0x10,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"^",62//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE},//"_",63//
- //{0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"'",64//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x1C,0x24,0x44,0x3E,0x00,0x00},//"a",65//
- //{0x00,0x00,0x00,0xC0,0x40,0x40,0x78,0x44,0x44,0x44,0x44,0x78,0x00,0x00},//"b",66//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x40,0x40,0x44,0x38,0x00,0x00},//"c",67//
- //{0x00,0x00,0x00,0x0C,0x04,0x04,0x3C,0x44,0x44,0x44,0x44,0x3E,0x00,0x00},//"d",68//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x7C,0x40,0x44,0x38,0x00,0x00},//"e",69//
- //{0x00,0x00,0x00,0x1C,0x24,0x20,0xF8,0x20,0x20,0x20,0x20,0x78,0x00,0x00},//"f",70//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x48,0x48,0x30,0x40,0x78,0x44,0x38},//"g",71//
- //{0x00,0x00,0x00,0xC0,0x40,0x40,0x58,0x64,0x44,0x44,0x44,0xEE,0x00,0x00},//"h",72//
- //{0x00,0x00,0x00,0x10,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},//"i",73//
- //{0x00,0x00,0x00,0x08,0x00,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x70},//"j",74//
- //{0x00,0x00,0x00,0xC0,0x40,0x40,0x5C,0x48,0x50,0x70,0x48,0xEC,0x00,0x00},//"k",75//
- //{0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},//"l",76//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x54,0x54,0x54,0x54,0xD6,0x00,0x00},//"m",77//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x44,0x44,0x44,0xEE,0x00,0x00},//"n",78//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00,0x00},//"o",79//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x44,0x78,0x40,0xE0},//"p",80//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x3C,0x04,0x0E},//"q",81//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x30,0x20,0x20,0x20,0xF8,0x00,0x00},//"r",82//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x44,0x30,0x08,0x44,0x78,0x00,0x00},//"s",83//
- //{0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x0C,0x00,0x00},//"t",84//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0x44,0x44,0x44,0x44,0x3E,0x00,0x00},//"u",85//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x28,0x28,0x28,0x10,0x00,0x00},//"v",86//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0x54,0x54,0x54,0x28,0x28,0x00,0x00},//"w",87//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x48,0x30,0x30,0x48,0xEC,0x00,0x00},//"x",88//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x44,0x28,0x28,0x10,0x10,0x20,0xE0},//"y",89//
- //{0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x48,0x10,0x10,0x24,0x7C,0x00,0x00},//"z",90//
- //{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},//"|",91//
- //};
- ////-----------------------------------------------------------------------------
- //#endif //LCD
- //
- //
- ///**************************************************************************************************
- // * @fn HalLcdInit
- // *
- // * @brief Initilize LCD Service
- // *
- // * @param init - pointer to void that contains the initialized value
- // *
- // * @return None
- // **************************************************************************************************/
- //void HalLcdInit(void)
- //{
- //#if (HAL_LCD == TRUE)
- // HalLcd_HW_Init();
- //#endif
- //}
- //
- ///**************************************************************************************************
- // * @fn HalLcdWriteValue
- // *
- // * @brief Write a value to the LCD
- // *
- // * @param value - value that will be displayed
- // * radix - 8, 10, 16
- // * option - display options
- // *
- // * @return None
- // **************************************************************************************************/
- //void HalLcdWriteValue ( uint32 value, const uint8 radix, uint8 option)
- //{
- //#if (HAL_LCD == TRUE)
- // uint8 buf[LCD_MAX_BUF];
- //
- // _ltoa( value, &buf[0], radix );
- // HalLcdWriteString( (char*)buf, option );
- //#endif
- //}
- //
- ///**************************************************************************************************
- // * @fn HalLcdWriteScreen
- // *
- // * @brief Write a value to the LCD
- // *
- // * @param line1 - string that will be displayed on line 1
- // * line2 - string that will be displayed on line 2
- // *
- // * @return None
- // **************************************************************************************************/
- //void HalLcdWriteScreen( char *line1, char *line2 )
- //{
- //#if (HAL_LCD == TRUE)
- // HalLcdWriteString( line1, 0 );//andy
- // HalLcdWriteString( line2, 1 );
- //#endif
- //}
- //
- ///**************************************************************************************************
- // * @fn HalLcdWriteStringValue
- // *
- // * @brief Write a string followed by a value to the LCD
- // *
- // * @param title - Title that will be displayed before the value
- // * value - value
- // * format - redix
- // * line - line number
- // *
- // * @return None
- // **************************************************************************************************/
- //void HalLcdWriteStringValue( char *title, uint16 value, uint8 format, uint8 line )
- //{
- //#if (HAL_LCD == TRUE)
- // uint8 tmpLen;
- // uint8 buf[LCD_MAX_BUF];
- // uint32 err;
- //
- // tmpLen = (uint8)osal_strlen( (char*)title );
- // osal_memcpy( buf, title, tmpLen );
- // //buf[tmpLen] = ' ';
- // err = (uint32)(value);
- // _ltoa( err, &buf[tmpLen], format );
- // HalLcdWriteString( (char*)buf, line );
- //#endif
- //}
- //
- ///**************************************************************************************************
- // * @fn HalLcdWriteStringValue
- // *
- // * @brief Write a string followed by a value to the LCD
- // *
- // * @param title - Title that will be displayed before the value
- // * value1 - value #1
- // * format1 - redix of value #1
- // * value2 - value #2
- // * format2 - redix of value #2
- // * line - line number
- // *
- // * @return None
- // **************************************************************************************************/
- //void HalLcdWriteStringValueValue( char *title, uint16 value1, uint8 format1,
- // uint16 value2, uint8 format2, uint8 line )
- //{
- //#if (HAL_LCD == TRUE)
- //
- // uint8 tmpLen;
- // uint8 buf[LCD_MAX_BUF];
- // uint32 err;
- //
- // tmpLen = (uint8)osal_strlen( (char*)title );
- // if ( tmpLen )
- // {
- // osal_memcpy( buf, title, tmpLen );
- // //buf[tmpLen++] = ' ';
- // }
- //
- // err = (uint32)(value1);
- // _ltoa( err, &buf[tmpLen], format1 );
- // tmpLen = (uint8)osal_strlen( (char*)buf );
- //
- // buf[tmpLen++] = ',';
- // buf[tmpLen++] = ' ';
- // err = (uint32)(value2);
- // _ltoa( err, &buf[tmpLen], format2 );
- //
- // HalLcdWriteString( (char *)buf, line );
- //
- //#endif
- //}
- //
- //#if (HAL_LCD == TRUE)
- //void DelayMS(unsigned int msec)
- //{
- // unsigned int i;
- // while(msec >0)
- // {
- // for (i=0; i<8000; i++) asm("NOP"); //1ms
- // msec--;
- // }
- //}
- //
- ////option 1=第1行 2=第2行 其它类推
- //void HalLcdWriteString (char *s, uint8 option)
- //{
- // Color = BLUE;
- // Color_BK = WHITE;
- // DrawRectFill(7,option*15+20,118,15,WHITE);
- // LCD_write_EN_string(7,option*15+20,(unsigned char *)s);
- //}
- //
- ////向SPI总线传输一个8位数据
- //void SendByte(unsigned char Data)
- //{
- // unsigned char i=0;
- //
- // for(i=8;i>0;i--)
- // {
- // if(Data&0x80)
- // LCD_SDA_SET;//输出数据
- // else
- // LCD_SDA_CLR;
- //
- // LCD_SCL_CLR;
- // LCD_SCL_SET;
- // Data<<=1;
- // }
- //}
- //
- ////向SPI总线传输一个8位数据
- //void SPI_WriteData(unsigned char Data)
- //{
- // unsigned char i=0;
- //
- // for(i=8;i>0;i--)
- // {
- // if(Data&0x80)
- // LCD_SDA_SET;//输出数据
- // else
- // LCD_SDA_CLR;
- //
- // LCD_SCL_CLR;
- // LCD_SCL_SET;
- // Data<<=1;
- // }
- //}
- //
- ////向液晶屏写一个8位指令
- //void LCD_WrCmd(unsigned char Index)
- //{
- // //LCD_CS_CLR; //ALD del SPI写命令时序开始
- // LCD_DC_CLR;
- // SPI_WriteData(Index);
- // //LCD_CS_SET; //ALD del
- //}
- //
- ////向液晶屏写一个8位数据
- //void LCD_WrDat(unsigned char Data)
- //{
- // //LCD_CS_CLR; //ALD del
- // LCD_DC_SET;
- // SPI_WriteData(Data);
- // //LCD_CS_SET; //ALD del
- //}
- //
- ////向液晶屏写一个16位数据
- //void LCD_WriteData_16Bit(unsigned short Data)
- //{
- // //LCD_CS_CLR; //ALD del
- // LCD_DC_SET;
- // SPI_WriteData(Data>>8); //写入高8位数据
- // SPI_WriteData(Data); //写入低8位数据
- // //LCD_CS_SET; //ALD del
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_write_byte()
- //* 功 能: 数据到LCD
- //* 入口参数: data —写入的数据
- //* command —写数据/命令选择
- //* 出口参数: 无
- //****************************************************************************/
- //static void LCD_write_byte(unsigned char data, unsigned char command)
- //{
- // ////LCD_CS_CLR ;// 使能LCD
- // if (command == 0)
- // LCD_WrCmd(data); // 传送命令
- // else
- // LCD_WrDat(data) ; // 传送数据
- // //SendByte(data);
- // //LCD_CS_SET; // 关闭LCD
- // //LCD_DC_SET;
- //}
- //
- //// 复位lcd
- //void Lcd_Reset(void)
- //{
- // LCD_RST_CLR;
- // DelayMS(110);
- // LCD_RST_SET;
- // DelayMS(50);
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_set_window()
- //* 功 能: 设置显示窗口
- //* 入口参数: X - 显示窗口左上角横坐标 Y —显示窗口左上角纵坐标
- //* Width —显示窗口宽度 Height —显示窗口高度
- //* 出口参数: 无
- //****************************************************************************/
- //static void LCD_set_window(unsigned int X , unsigned int Y,
- // unsigned int Width, unsigned int Height)
- //{
- // LCD_write_byte(0x2A,LCD_COMMAND); //列地址设置命令
- // LCD_write_byte(X>>8,LCD_DATA) ; //设置显示窗口左上角横坐标高位
- // LCD_write_byte((X+2)&0xFF,LCD_DATA); //设置显示窗口左上角横坐标低位
- // LCD_write_byte((X+Width+1)>>8,LCD_DATA); //设置宽度高位
- // LCD_write_byte((X+Width+1)&0xFF,LCD_DATA);// 设置宽度低位
- //
- // LCD_write_byte(0x2B,LCD_COMMAND); //行地址设置命令
- // LCD_write_byte(Y>>8,LCD_DATA) ; //设置显示窗口左上角纵坐标高位
- // LCD_write_byte((Y+3)&0xFF,LCD_DATA); //设置显示窗口左上角纵坐标低位
- // LCD_write_byte((Y+Height+2)>>8,LCD_DATA); // 设置显示窗口高度高位
- // LCD_write_byte((Y+Height+2)&0xFF,LCD_DATA);// 设置显示窗口高度低位
- // LCD_write_byte(0x2C,LCD_COMMAND) ;
- //}
- //
- ///****************************************************************************
- //* 名 称: DrawPixel()
- //* 功 能: 在指定位置以指定颜色显示像素
- //****************************************************************************/
- //void DrawPixel(unsigned int x, unsigned int y, unsigned int color)
- //{
- // //LCD_set_XY(x,y); //设定显示位置 andy
- // LCD_write_byte(color>>8,LCD_DATA); //发送显示颜色数据高位字节
- // LCD_write_byte(color&0xFF,LCD_DATA);//发送显示颜色数据低位字节
- //}
- //
- ///****************************************************************************
- //* 名 称: DrawVerticalLine()
- //* 功 能: 在指定位置以指定颜色画垂直线
- //* 入口参数: X - 垂直线起始位置横坐标 Y —垂直线起始位置纵坐标
- //* Length —垂直线长度 Color —垂直线颜色
- //* 出口参数: 无
- //****************************************************************************/
- //void DrawVerticalLine(unsigned int x, unsigned int y,
- // unsigned int Length,unsigned int Color)
- //{
- // register int index = 0;
- // register char ch,cl;
- //
- // ch = (unsigned char)(Color>>8);
- // cl = (unsigned char)(Color);
- // LCD_set_window(x,y,1,Length);
- // for(index=0;index<Length;index++)
- // {
- // LCD_write_byte(ch,LCD_DATA) ;
- // LCD_write_byte(cl,LCD_DATA) ;
- // }
- //}
- //
- ///****************************************************************************
- //* 名 称: DrawHorizonLine()
- //* 功 能: 在指定位置以指定颜色画水平线
- //* 入口参数: X - 水平线起始位置横坐标 Y —水平线起始位置纵坐标
- //* Length —水平线长度 Color —水平线颜色
- //* 出口参数: 无
- //****************************************************************************/
- //void DrawHorizonLine(unsigned int x, unsigned int y,
- // unsigned int Length,unsigned int Color)
- //{
- // register int index = 0;
- // register char ch,cl;
- //
- // ch = (unsigned char)(Color>>8);
- // cl = (unsigned char)(Color);
- // LCD_set_window(x,y,Length,1);
- // for(index=0;index<Length;index++)
- // {
- // LCD_write_byte(ch,LCD_DATA);
- // LCD_write_byte(cl,LCD_DATA);
- // }
- //}
- //
- ///****************************************************************************
- //* 名 称: DrawRect()
- //* 功 能: 在指定位置以指定颜色画矩形
- //* 入口参数: X - 矩形起始位置横坐标 Y —矩形起始位置纵坐标
- //* Width —矩形宽度 Height —矩形高度
- //* Color —矩形颜色
- //* 出口参数: 无
- //****************************************************************************/
- //void DrawRect(unsigned int Xpos, unsigned int Ypos, unsigned int Width,
- // unsigned int Height,unsigned Color)
- //{
- // DrawHorizonLine(Xpos, Ypos, Width, Color) ;
- // DrawHorizonLine(Xpos, (Ypos + Height), Width, Color) ;
- // DrawVerticalLine(Xpos, Ypos, Height, Color) ;
- // DrawVerticalLine((Xpos+Width-1) ,Ypos, Height, Color);
- //}
- //
- ///****************************************************************************
- //* 名 称: DrawRectFill()
- //* 功 能: 在指定位置以指定颜色画矩形
- //* 入口参数: X - 矩形起始位置横坐标 Y —矩形起始位置纵坐标
- //* Width —矩形宽度 Height —矩形高度
- //* Color —矩形填充颜色
- //* 出口参数: 无
- //****************************************************************************/
- //void DrawRectFill(unsigned int Xpos , unsigned int Ypos, unsigned int Width,
- // unsigned int Height, unsigned Color )
- //{
- // register unsigned int i;
- // register unsigned int index = Width*Height/16+1;
- // register char ch,cl;
- //
- // ch = (unsigned char)(Color>>8);
- // cl = (unsigned char)(Color);
- // LCD_set_window(Xpos,Ypos,Width,Height);
- // LCD_write_byte(0x2C,LCD_COMMAND);
- // //LCD_CS_CLR ; andy
- // LCD_DC_SET ;
- // for(i=0;i<index;i++)
- // {
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // }
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_clear()
- //* 功 能: 以指定颜色清屏
- //* 入口参数: color —清屏颜色
- //* 出口参数: 无
- //****************************************************************************/
- //void LCD_clear(unsigned int color)
- //{
- // register unsigned int i=0,j=0;
- // register unsigned char ch;
- // register unsigned char cl;
- //
- // LCD_set_window(0,0,X_MAX_PIXEL,Y_MAX_PIXEL);
- // ch = color>>8;
- // cl = color&0xFF;
- // LCD_write_byte(0x2C,LCD_COMMAND);
- // //LCD_CS_CLR;
- // LCD_DC_SET;
- // for (i=0;i<Y_MAX_PIXEL;i++)
- // for (j=0;j<2;j++)
- // {
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // SendByte(ch);
- // SendByte(cl);
- // }
- // LCD_DC_SET;
- // //LCD_CS_SET;
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_write_EN()
- //* 功 能: 在指定位置显示 7 ×14 点阵ASCII字符
- //* 入口参数: X - 显示位置左上角横坐标 Y —显示位置左上角纵坐标
- //* c —显示字符
- //* 出口参数: 无
- //****************************************************************************/
- //static void LCD_write_EN(unsigned int X, unsigned int Y, unsigned char c)
- //{
- // unsigned char i,j,temp;
- //
- // LCD_set_window(X,Y,7,14);
- // //LCD_CS_CLR ;
- // LCD_DC_SET ;
- // for(i=0;i<14;i++)
- // {
- // temp = ASCII7x14[c-32][i];
- // for(j=0;j<7;j++)
- // {
- // if(temp&0x80)
- // {
- // SendByte(Color>>8);
- // SendByte(Color) ;
- // }
- // else
- // {
- // SendByte(Color_BK>>8) ;
- // SendByte(Color_BK);
- // }
- // temp <<= 1 ;
- // }
- // }
- // //LCD_CS_SET ; andy
- // LCD_DC_SET ;
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_write_EN_string()
- //* 功 能: 在指定位置显示 7 ×14 点阵ASCII字符串
- //* 入口参数: X - 显示位置左上角横坐标 Y —显示位置左上角纵坐标
- //* s —字符串指针
- //* 出口参数: 无
- //****************************************************************************/
- //void LCD_write_EN_string(unsigned char X,unsigned char Y,uint8 *s)
- //{
- // unsigned char i=0;
- //
- // while (*s)
- // {
- // LCD_write_EN(X+i*7,Y,*s);
- // s++;
- // i++;
- // if(i>=HAL_LCD_MAX_CHARS)return;
- // }
- // return;
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_write_CN()
- //* 功 能: 在指定位置显示 14 ×14 点阵汉字字符
- //* 入口参数: X - 显示位置左上角横坐标 Y —显示位置左上角纵坐标
- //* c —显示字符指针
- //* 出口参数: 无
- //****************************************************************************/
- //static void LCD_write_CN(unsigned int X, unsigned int Y, unsigned char c)
- //{
- // unsigned char i,j,temp;
- //
- // LCD_set_window(X,Y,14,14); //按字符点阵大小设置显示窗口
- // //LCD_CS_CLR; //液晶SPI使能andy
- // LCD_DC_SET; //发送数据信号使能
- // for(i=0;i<28;i++) // 14x14字符点阵数据大小为2x14=28字节
- // {
- // temp = CN14x14[c][i] ; //读字模数组
- // for(j=0;j<8;j++) // 按位显示
- // {
- // if(temp&0x80) //如果位值为1,显示字符色
- // {
- // SendByte(Color>>8);
- // SendByte(Color) ;
- // }
- // else //如果位值为0,显示背景色
- // {
- // SendByte(Color_BK>>8) ;
- // SendByte(Color_BK);
- // }
- // temp <<= 1 ;
- // }
- // i++ ; //指向下一字节
- // temp = CN14x14[c][i];
- // for(j=0;j<6;j++) // 按位显示,点阵横向为14像素,
- // { // 所以每行第2字节最后2位抛弃
- // if(temp&0x80) // 如果位值为1,显示字符色
- // {
- // SendByte(Color>>8);
- // SendByte(Color) ;
- // }
- // else // 如果位值为0,显示背景色
- // {
- // SendByte(Color_BK>>8) ;
- // SendByte(Color_BK);
- // }
- // temp <<= 1 ;
- // }
- // }
- // //LCD_CS_SET; //液晶SPI禁止
- // LCD_DC_SET; //数据控制信号禁止
- //}
- //
- ///****************************************************************************
- //* 名 称: LCD_write_CN_string()
- //* 功 能: 在指定位置显示 14 ×14 点阵中文字符串
- //* 入口参数: X - 显示位置左上角横坐标 Y —显示位置左上角纵坐标
- //* s —字符串指针
- //* 出口参数: 无
- //****************************************************************************/
- //void LCD_write_CN_string(unsigned char X,unsigned char Y,uint8 *s)
- //{
- // unsigned char i=0;
- // static unsigned char j=0;
- //
- // while (*s)
- // {
- // for(j=0;j<ALL_CNS;j++) //搜索点阵字模
- // {
- // if( *s ==CN14x14_Index[j*2]
- // &&*(s+1)==CN14x14_Index[j*2+1]) //汉字内码存在于字模索引数组中
- // {
- // LCD_write_CN(X+i*14,Y,j) ; //显示汉字
- // break;
- // }
- // }
- // if(j>=ALL_CNS) //无此字的点阵字模
- // {
- // DrawRectFill(X+i*14,Y,14,14,Color_BK);//显示空格
- // }
- // s++; s++ ; //字符指针移位
- // i++;
- // if(i>=HAL_LCD_MAX_CHARS/2)
- // return; //超过最大显示字符数,返回
- // }
- // return ;
- //}
- //
- ///****************************************************************************
- //* 名 称: ShowImage()
- //* 功 能: 显示图片
- //* 入口参数: p - 图片点阵数据 取模方式 水平扫描 从左到右 低位在前
- //* 出口参数: 无
- //****************************************************************************/
- //void ShowImage(const unsigned char *p)
- //{
- // int i;
- // unsigned char picH,picL;
- //
- // LCD_set_window(24,5,80,40); //坐标设置
- // for(i=0;i<80*40;i++)
- // {
- // picL=*(p+i*2); //数据低位在前
- // picH=*(p+i*2+1);
- // LCD_WriteData_16Bit(picH<<8|picL);
- // }
- //}
- //
- ////初始化LCD
- //void HalLcd_HW_Init(void)
- //{
- // P0SEL &= 0xFE; //设置P00为普通IO口,
- // P0DIR |= 0x01; //设置P00为输出
- // P1SEL &= 0x73; //设置P12,P13,P17为普通IO口
- // P1DIR |= 0x8c; //设置P12,P13,P17为输出
- //
- // Lcd_Reset();
- //
- //#ifdef HARDWARE_SPI
- // P1DIR &= 0x9F;
- // SPI_Init(); //初始化SPI端口
- //#endif
- //
- // LCD_write_byte(0x11,LCD_COMMAND); //退出睡眠模式
- // DelayMS(1);
- //
- // ///ST7735R Frame Rate
- // LCD_write_byte(0xB1,LCD_COMMAND);
- // LCD_write_byte(0x01,LCD_DATA);
- // LCD_write_byte(0x2C,LCD_DATA);
- // LCD_write_byte(0x2D,LCD_DATA);
- // LCD_write_byte(0xB2,LCD_COMMAND);
- // LCD_write_byte(0x01,LCD_DATA);
- // LCD_write_byte(0x2C,LCD_DATA);
- // LCD_write_byte(0x2D,LCD_DATA);
- // LCD_write_byte(0xB3,LCD_COMMAND);
- // LCD_write_byte(0x01,LCD_DATA);
- // LCD_write_byte(0x2C,LCD_DATA);
- // LCD_write_byte(0x2D,LCD_DATA);
- // LCD_write_byte(0x01,LCD_DATA);
- // LCD_write_byte(0x2C,LCD_DATA);
- // LCD_write_byte(0x2D,LCD_DATA);
- //
- // LCD_write_byte(0xB4,LCD_COMMAND);//列对调
- // LCD_write_byte(0x07,LCD_DATA);
- // //ST7735R加电序列
- // LCD_write_byte(0xC0,LCD_COMMAND);
- // LCD_write_byte(0xA2,LCD_DATA);
- // LCD_write_byte(0x02,LCD_DATA);
- // LCD_write_byte(0x84,LCD_DATA);
- // LCD_write_byte(0xC1,LCD_COMMAND);
- // LCD_write_byte(0xC5,LCD_DATA);
- // LCD_write_byte(0xC2,LCD_COMMAND);
- // LCD_write_byte(0x0A,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0xC3,LCD_COMMAND);
- // LCD_write_byte(0x8A,LCD_DATA);
- // LCD_write_byte(0x2A,LCD_DATA);
- // LCD_write_byte(0xC4,LCD_COMMAND);
- // LCD_write_byte(0x8A,LCD_DATA);
- // LCD_write_byte(0xEE,LCD_DATA);
- //
- // LCD_write_byte(0xC5,LCD_COMMAND); //加VCOM
- // LCD_write_byte(0x0E,LCD_DATA);
- //
- // LCD_write_byte(0x36,LCD_COMMAND); //RGB模式
- // LCD_write_byte(0xC8,LCD_DATA);
- //
- // // ST7735R Gamma 校正序列
- // LCD_write_byte(0xe0,LCD_COMMAND);
- // LCD_write_byte(0x0f,LCD_DATA);
- // LCD_write_byte(0x1a,LCD_DATA);
- // LCD_write_byte(0x0f,LCD_DATA);
- // LCD_write_byte(0x18,LCD_DATA);
- // LCD_write_byte(0x2f,LCD_DATA);
- // LCD_write_byte(0x28,LCD_DATA);
- // LCD_write_byte(0x20,LCD_DATA);
- // LCD_write_byte(0x22,LCD_DATA);
- // LCD_write_byte(0x1f,LCD_DATA);
- // LCD_write_byte(0x1b,LCD_DATA);
- // LCD_write_byte(0x23,LCD_DATA);
- // LCD_write_byte(0x37,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- //
- // LCD_write_byte(0x07,LCD_DATA);
- // LCD_write_byte(0x02,LCD_DATA);
- // LCD_write_byte(0x10,LCD_DATA);
- // LCD_write_byte(0xe1,LCD_COMMAND);
- // LCD_write_byte(0x0f,LCD_DATA);
- // LCD_write_byte(0x1b,LCD_DATA);
- // LCD_write_byte(0x0f,LCD_DATA);
- // LCD_write_byte(0x17,LCD_DATA);
- // LCD_write_byte(0x33,LCD_DATA);
- // LCD_write_byte(0x2c,LCD_DATA);
- // LCD_write_byte(0x29,LCD_DATA);
- // LCD_write_byte(0x2e,LCD_DATA);
- // LCD_write_byte(0x30,LCD_DATA);
- // LCD_write_byte(0x30,LCD_DATA);
- // LCD_write_byte(0x39,LCD_DATA);
- // LCD_write_byte(0x3f,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x07,LCD_DATA);
- // LCD_write_byte(0x03,LCD_DATA);
- // LCD_write_byte(0x10,LCD_DATA);
- //
- // LCD_write_byte(0x2a,LCD_COMMAND);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x7f,LCD_DATA);
- // LCD_write_byte(0x2b,LCD_COMMAND);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x00,LCD_DATA);
- // LCD_write_byte(0x9f,LCD_DATA);
- //
- // LCD_write_byte(0xF0,LCD_COMMAND); //使能测试命令
- // LCD_write_byte(0x01,LCD_DATA);
- // LCD_write_byte(0xF6,LCD_COMMAND); //关闭ram省电模式
- // LCD_write_byte(0x00,LCD_DATA);
- //
- // LCD_write_byte(0x3A,LCD_COMMAND); //色深16bit
- // LCD_write_byte(0x05,LCD_DATA);
- //
- // LCD_write_byte(0x29,LCD_COMMAND); //开显示
- // LCD_clear(GREEN); //清屏
- //}
- //#endif
|