/*****************************************************/
//描述:LCD12864的驱动
//作者:happygrilclh
//时间:2015/06/30
//画图
//功能:画图
/*****************************************************/
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File#define LCD_DATA (*((volatile Uint16 *)0x45EF))
#define E GpioDataRegs.GPBDAT.bit.GPIO61
#define RW GpioDataRegs.GPADAT.bit.GPIO27
#define RS GpioDataRegs.GPBDAT.bit.GPIO60
#define LOW 0
#define HIGH 1
#define CLEAR_SCREEN 0x01 //清屏指令:清屏且AC值为00H
#define AC_INIT 0x02 //将AC设置为00H。且游标移到原点位置
#define CURSE_ADD 0x06 //设定游标移到方向及图像整体移动方向(默认游标右移,图像整体不动)
#define FUN_MODE 0x30 //工作模式:8位基本指令集
#define DISPLAY_ON 0x0c //显示开,显示游标,且游标位置反白
#define DISPLAY_OFF 0x08 //显示关
#define CURSE_DIR 0x14 //游标向右移动:AC=AC+1
#define SET_CG_AC 0x40 //设置AC,范围为:00H~3FH
#define SET_DD_AC 0x80 #define DELAY_MS(A) DELAY_US((long double)A * 1000.0L)
#define DELAY_100US(B) DELAY_US((long double)B * 100.0L)void InitXintf(void);
void ConfigGpio(void);
void InitLcd(void);
void Read_Busy(void);
void WriteCmd12864(Uint16 cmd);
void WriteData12864(Uint16 dat);
void DisplayDdram(uchar *hz);
//void InitBMP(void);
void DispBMP(uchar *adress);
void CLR_GDRAM(void);uchar A[] = "输出功率:";
uchar A_DATA[] = "123.45";
uchar B[] = "日发电量:";
uchar B_DATA[] = "123.45";
uchar C[] = "本月发电量:";
uchar C_DATA[] = "123.45";
uchar D[] = "总发电量:";
uchar D_DATA[] = "123.45";
uchar danwei[] = " kWh";
uchar danwei_kw[] = " kW";
/*
uchar fanlong[] = {0x10,0x80,0x08,0x80,0x7E,0xFC,0x24,0x80,0x18,0xFC,0xFF,0x04,0x00,0xFC,0x3E,0x80,0x22,0xF8,0x3E,0x80,0x22,0xF8,0x3E,0x80,0x22,0xFA,0x22,0x82,0x2A,0x82,0x24,0x7E};*//*龍,16 X 16 ,逐行式,顺向(高位,低位)*/
/*
uchar guo[] = {0x7F,0xFC,0x40,0x84,0x40,0xA4,0x40,0xA4,0x5F,0xF4,0x40,0x84,0x5E,0xA4,0x52,0xB4,0x5E,0x64,0x40,0x44,0x46,0xD4,0x59,0x54,0x42,0x24,0x40,0x04,0x7F,0xFC,0x40,0x04};*//*"國",0*//* (16 X 16 , 宋体 )*/uchar tab[] = {0X00,0X00,0X04,0X01,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X04,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X06,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X00,0X00,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0XC0,0X03,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X1F,0XFC,0X06,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X60,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X18,0X01,0X80,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X0F,0X83,0X00,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X01,0X86,0X00,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X04,0X00,0X00,0X10,0X3E,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X48,0X0D,0X98,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X08,0X84,0X08,0X98,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X08,0X84,0X08,0X88,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X08,0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X1F,0X8C,0XFF,0XFF,0X98,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X06,0X48,0X89,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X02,0X48,0X89,0X21,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X03,0X28,0X8A,0X60,0X3C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XCC,0X99,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X70,0X07,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X70,0X0F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X01,0XC0,0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X01,0X00,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X30,0X10,0X06,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X20,0X18,0X02,0X00,0X00,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X40,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XC0,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFE,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFD,0XDF,0XFB,0XBF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFE,0X1F,0XFC,0X3F,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0X3F,0XFE,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFC,0XDF,0XF9,0X3F,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X40,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X01,0X80,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X01,0X80,0X00,0XFF,0XF7,0XFF,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFD,0X8F,0XFF,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XFC,0X3F,0XFF,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X08,0XC4,0X00,0X3F,0XFF,0XFF,0XFE,0X00,0X42,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X20,0X08,0X00,0X00,0X1F,0XFC,0X00,0X00,0X32,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X20,0X20,0X00,0X00,0X1F,0XFE,0X00,0X0E,0X13,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X10,0X40,0X00,0X00,0X37,0XFA,0X00,0X05,0XC1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X27,0XFB,0X00,0X07,0XE1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X63,0XF1,0X00,0X07,0XD1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X23,0XF1,0X00,0X00,0X19,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X21,0XE3,0X00,0X00,0X0D,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X32,0X32,0X00,0X00,0X07,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X10,0X00,0X00,0X03,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X06,0X18,0X00,0X00,0X01,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};
uchar tab1[] = {0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XD0,0X00,0X00,
0X00,0X00,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0X30,0X00,0X00,
0X00,0X00,0X1F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1E,0XF0,0X00,0X00,
0X00,0X00,0X60,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X37,0XE0,0X00,0X00,
0X00,0X01,0X80,0X00,0XC0,0X00,0X00,0X00,0X1F,0XFF,0XE0,0X00,0X73,0X40,0X00,0X00,
0X00,0X03,0X00,0X00,0X60,0X00,0X00,0X00,0XFF,0XFF,0XF8,0X00,0X7F,0X80,0X00,0X00,
0X00,0X06,0X00,0X00,0X20,0X00,0X00,0X03,0XFF,0XFF,0XFF,0X00,0X3F,0X00,0X00,0X00,
0X00,0X04,0X00,0X00,0X10,0X00,0X00,0X0F,0XE7,0XFF,0XFF,0XC0,0X30,0X00,0X00,0X00,
0X00,0X0C,0X30,0X0A,0X18,0X00,0X00,0X3F,0XF1,0XFF,0XFF,0XE0,0X60,0X00,0X00,0X00,
0X00,0X08,0X30,0X03,0X18,0X00,0X00,0XFF,0XF8,0X7F,0XFF,0XF0,0X60,0X00,0X00,0X00,
0X00,0X08,0X00,0X00,0X08,0X00,0X01,0X1F,0XFF,0X00,0X00,0X04,0X60,0X00,0X00,0X00,
0X00,0X08,0X00,0X00,0X18,0X00,0X07,0X9F,0XFF,0X00,0X1F,0XFE,0X40,0X00,0X00,0X00,
0X00,0X0C,0X00,0X00,0X18,0X00,0X0F,0XC3,0XE0,0X07,0XFF,0XF3,0X40,0X00,0X00,0X00,
0X00,0X06,0X00,0X00,0X10,0X00,0X3F,0XF8,0X0F,0X9F,0XFF,0XE0,0XC0,0X00,0X00,0X00,
0X00,0X02,0X00,0X80,0X20,0X00,0X3F,0XE0,0XFF,0X3F,0XFF,0X80,0XE0,0X00,0X00,0X00,
0X00,0X03,0X01,0X40,0X60,0X00,0XFF,0X0F,0XFE,0X7F,0XFF,0X00,0X60,0X00,0X00,0X00,
0X00,0X00,0XC0,0X01,0X80,0X01,0XF0,0X7F,0XFC,0XFF,0XFE,0X00,0X30,0X00,0X00,0X1F,
0X00,0X00,0X70,0X07,0X00,0X03,0X80,0XFF,0XFC,0XFF,0XF8,0X00,0X18,0X00,0X00,0XFB,
0X00,0X00,0X0F,0XFC,0X00,0X06,0X11,0XFF,0XF9,0XFF,0XF0,0X00,0X0C,0X00,0X07,0X61,
0X00,0X00,0X00,0X00,0X00,0X0F,0XF7,0XFF,0XF9,0XFF,0XC0,0X00,0X04,0X00,0X1F,0X1F,
0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XFF,0XF9,0XFF,0X00,0X00,0X02,0X00,0X37,0X7E,
0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XFF,0XFF,0XFC,0X00,0X00,0X03,0X00,0X7E,0XFE,
0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XFF,0X80,0X00,0X00,0X01,0X80,0XF9,0XFC,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XE1,0XC0,0X00,0X04,0X01,0X80,0XF1,0XEC,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFF,0X80,0X0C,0X00,0X80,0XF7,0XF8,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0XF8,0X00,0X40,0XEF,0XE0,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0XFF,0X00,0X60,0XDF,0X80,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X9F,0XFF,0XFF,0XC0,0X60,0X7E,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XEF,0XFF,0XFF,0XE0,0X30,0XC0,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XEF,0XF0,0XFF,0XE0,0X10,0XC0,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XCF,0X7F,0XE0,0X11,0X80,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFF,0X7F,0XE0,0X09,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFF,0XFF,0XC0,0X0A,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XC0,0X0E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XC0,0X0E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0X80,0X03,0XFF,0X80,0X0E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XB6,0XDB,0XFF,0X80,0X06,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XD6,0XD7,0XFF,0X80,0X06,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XE6,0XCF,0XFF,0X80,0X06,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFF,0XFF,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0XFF,0XFF,0XFF,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFE,0X4F,0X82,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X67,0XFA,0X00,0X7A,0XC3,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC7,0XF9,0X00,0X3E,0XE1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XF6,0X00,0X1F,0XA1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XF8,0X00,0X03,0XD1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XF0,0X00,0X00,0X19,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XE0,0X00,0X00,0X0D,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X30,0X00,0X00,0X07,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X10,0X00,0X00,0X03,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X06,0X18,0X00,0X00,0X01,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};
uchar tab2[] = {0X00,0X00,0X04,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X04,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X06,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X00,0X00,0X00,0X40,0X00,0X00,0X00,0XBF,0XB8,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0XC0,0X03,0X80,0X00,0X00,0X00,0XF3,0X3F,0X80,0X00,0X00,0X00,0X00,
0X00,0X00,0X1F,0XFC,0X06,0X00,0X00,0X00,0X00,0X7E,0X3D,0XC0,0X00,0X00,0X00,0X00,
0X00,0X00,0X60,0X03,0X00,0X00,0X00,0X00,0X00,0X7F,0XBD,0XE0,0X00,0X00,0X00,0X00,
0X18,0X01,0X80,0X00,0XC0,0X00,0X00,0X00,0X00,0X3F,0XE5,0XF8,0X00,0X00,0X00,0X00,
0X0F,0X03,0X00,0X00,0X60,0X00,0X00,0X00,0X00,0X1F,0XF8,0XF8,0X1C,0X00,0X00,0X00,
0X00,0X86,0X00,0X00,0X20,0X00,0X00,0X00,0X00,0X0F,0X80,0XF8,0X38,0X00,0X00,0X00,
0X00,0X04,0X00,0X00,0X10,0X1E,0X00,0X00,0X00,0X06,0XFF,0X3C,0X20,0X00,0X00,0X00,
0X00,0X0C,0X30,0X02,0X18,0XF0,0X00,0X00,0X00,0X01,0XFF,0XDC,0X60,0X00,0X00,0X00,
0X00,0X08,0X30,0X03,0X18,0X00,0X00,0X00,0X00,0X00,0X7F,0XEC,0X60,0X00,0X00,0X00,
0X00,0X08,0X00,0X00,0X08,0X00,0X00,0X00,0X00,0X00,0X07,0XF4,0X60,0X00,0X00,0X00,
0X00,0X08,0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X06,0X40,0X00,0X00,0X00,
0X1F,0X8C,0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X40,0X00,0X00,0X00,
0X00,0X06,0X00,0X00,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0X00,0X00,0X00,
0X00,0X02,0X00,0XA0,0X21,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0X00,0X00,0X00,
0X00,0X03,0X00,0X00,0X60,0X3C,0X00,0X00,0X00,0X00,0X00,0X00,0X60,0X00,0X00,0X00,
0X00,0X00,0XC0,0X01,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X30,0X00,0X00,0X1F,
0X00,0X10,0X70,0X07,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X18,0X00,0X00,0XFB,
0X00,0X30,0X0F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X00,0X07,0X61,
0X00,0XC0,0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X00,0X1F,0X1F,
0X01,0X00,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X00,0X37,0X7E,
0X00,0X00,0X30,0X10,0X04,0X00,0X00,0X00,0X00,0X02,0X00,0X00,0X03,0X00,0X7E,0XFE,
0X00,0X00,0X20,0X10,0X02,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X01,0X80,0XF9,0XFC,
0X00,0X00,0X40,0X18,0X00,0X00,0X00,0X00,0X00,0X01,0X81,0XE0,0X01,0X80,0XF1,0XEC,
0X00,0X00,0X40,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XF8,0X00,0X80,0XF7,0XF8,
0X00,0X00,0X00,0X08,0X00,0X00,0X00,0X00,0X00,0X7F,0XFF,0XFC,0X00,0X40,0XEF,0XE0,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0XFF,0X3C,0X00,0X60,0XDF,0X80,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X1C,0X00,0X60,0X7E,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XFF,0XFF,0XFF,0XFC,0X00,0X30,0XC0,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XFF,0X8F,0XFF,0XFE,0X00,0X10,0XC0,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0XFF,0XCF,0XFF,0XFE,0X00,0X11,0X80,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X09,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X0A,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X0E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFE,0X7F,0X00,0X0E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XFF,0XFA,0XFF,0X00,0X0E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XFF,0XFF,0XFF,0X80,0X06,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0XFF,0XFF,0XFF,0X80,0X06,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0X80,0X06,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XF0,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFC,0X00,0X00,0X02,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0XFF,0XFC,0X00,0X4F,0X82,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0X9F,0XFE,0X00,0X7A,0XC3,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X37,0XFA,0X00,0X3E,0XE1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X27,0XF3,0X00,0X1F,0XA1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X63,0XF1,0X00,0X03,0XD1,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X23,0XF1,0X00,0X00,0X19,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X21,0XE3,0X00,0X00,0X0D,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X32,0X32,0X00,0X00,0X07,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X10,0X00,0X00,0X03,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X08,0X00,0X00,0X01,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X06,0X18,0X00,0X00,0X01,0X00,0X00,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};void main(void)
{InitSysCtrl();InitXintf();InitXintf16Gpio();DINT;InitPieCtrl();IER = 0x0000;IFR = 0x0000;ConfigGpio();InitLcd();WriteCmd12864(CLEAR_SCREEN);DELAY_US(50);//DisplayChar();//InitBMP();while(1){CLR_GDRAM();DispBMP(tab);WriteCmd12864(0x36); //打开绘图显示DELAY_MS(4);CLR_GDRAM();DispBMP(tab1);WriteCmd12864(0x36); //打开绘图显示DELAY_MS(4);CLR_GDRAM();DispBMP(tab2);WriteCmd12864(0x36); //打开绘图显示DELAY_MS(4);}
}void ConfigGpio(void)
{EALLOW;GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 0;GpioCtrlRegs.GPBDIR.bit.GPIO60 = 1;GpioCtrlRegs.GPBMUX2.bit.GPIO61 = 0;GpioCtrlRegs.GPBDIR.bit.GPIO61 = 1;GpioCtrlRegs.GPAMUX2.bit.GPIO27 = 0;GpioCtrlRegs.GPADIR.bit.GPIO27 = 1;EDIS;
}
/*
void InitBMP()
{}*/
void InitLcd(void)
{DELAY_100US(5);WriteCmd12864(FUN_MODE);DELAY_US(5);WriteCmd12864(FUN_MODE);DELAY_US(5);WriteCmd12864(0x0C);DELAY_US(5);WriteCmd12864(CLEAR_SCREEN);DELAY_US(30);WriteCmd12864(AC_INIT);DELAY_US(4);}
void Read_Busy() //读忙标志最高位为1,则busy,不能进行读写操作
{RS = LOW;RW = HIGH;E = HIGH;while(LCD_DATA & 0X80);E = LOW;
}
void WriteCmd12864(Uint16 cmd)
{Read_Busy();RS = LOW;RW = LOW;//写数据E = HIGH;LCD_DATA = cmd;E = LOW;
}void WriteData12864(Uint16 dat)
{Read_Busy();RS = HIGH;RW = LOW;//写数据E = HIGH;LCD_DATA = dat;E = LOW;
}void DisplayDdram(uchar *hz)
{while(*hz != '\0'){WriteData12864(*hz);//地址里面的值hz++;}
}/*
//清屏:将第一个0-31(y)的第一行写0后,再将第二个0-31的第一行写0.
void CLR_GDRAM()
{uchar i,j;WriteCmd12864(0x34);for(j&#61;0;j<32;j&#43;&#43;){WriteCmd12864(0x80&#43;j); //y坐标WriteCmd12864(0x80); //x坐标for(i&#61;0;i<32;i&#43;&#43;){WriteData12864(0x00); //8位数据 }}
}
*/
void DispBMP(uchar *address)
{
uchar i;
uchar j;for(i&#61;0;i<32;i&#43;&#43;){WriteCmd12864(0x80&#43;i);WriteCmd12864(0x80);for(j&#61;0;j<16;j&#43;&#43;){WriteData12864(*address);address&#43;&#43;;}}for(i&#61;0;i<32;i&#43;&#43;){WriteCmd12864(0x80&#43;i);WriteCmd12864(0x88);for(j&#61;0;j<16;j&#43;&#43;){WriteData12864(*address);address&#43;&#43;;}}}
/*
void DispBMP(uchar *address)
{uchar i,j;for(j&#61;0;j<32;j&#43;&#43;){WriteCmd12864(0x80&#43;j); //y坐标WriteCmd12864(0x80); //x坐标for(i&#61;0;i<32;i&#43;&#43;){WriteData12864(*address);address&#43;&#43;;}}
}
*/void CLR_GDRAM()
{uchar i,j,k;WriteCmd12864(0x36);for(k&#61;0;k<2;k&#43;&#43;){for(j&#61;0;j<32;j&#43;&#43;){WriteCmd12864(0x80&#43;j);//写y坐标if(0&#61;&#61;k)//写x坐标{WriteCmd12864(0x80);//写上半屏}else{WriteCmd12864(0x88);//写下半屏}for(i&#61;0;i<16;i&#43;&#43;){WriteData12864(0x00);//写高位数据WriteData12864(0x00);//写低位数据}}}}
有问题&#xff0c;请咨询&#xff0c;个人公众号。