热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

12864带字库显示屏画图程序

*****************************************************描述:LCD12864的驱动作者:happ

/*****************************************************/
//描述: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;个人公众号。


推荐阅读
  • WinMain 函数详解及示例
    本文详细介绍了 WinMain 函数的参数及其用途,并提供了一个具体的示例代码来解析 WinMain 函数的实现。 ... [详细]
  • 最近遇到了一道关于哈夫曼树的编程题目,需要在下午之前完成。题目要求设计一个哈夫曼编码和解码系统,能够反复显示和处理多个项目,直到用户选择退出。希望各位大神能够提供帮助。 ... [详细]
  • C语言是计算机科学和编程领域的基石,许多初学者在学习过程中会感到困惑。本文将详细介绍C语言的基本概念、关键语法和实用示例,帮助你快速上手C语言。 ... [详细]
  • 本题涉及一种由Chip和Dale设计的文本加密方法。该方法通过预先约定的矩阵行数和列数,将字符转换为特定的二进制形式,并以螺旋方式填充矩阵。最终将矩阵中的二进制数连接成一个字符串,实现加密。 ... [详细]
  • PBO(PixelBufferObject),将像素数据存储在显存中。优点:1、快速的像素数据传递,它采用了一种叫DMA(DirectM ... [详细]
  • centos 7.0 lnmp成功安装过程(很乱)
    下载nginx[rootlocalhostsrc]#wgethttp:nginx.orgdownloadnginx-1.7.9.tar.gz--2015-01-2412:55:2 ... [详细]
  • 在本次学习中,主要通过外部中断来控制LED的亮灭。首先,先查看相关电路图。由图可知,当CC2530端口1的0号引脚输出低电平时࿰ ... [详细]
  • 第14周实践项目(4)-验证平衡二叉树
    问题**Copyright(c)2015,烟台大学计算机学院*Allrightsreserved.*文件名称:test.cpp*作者:王敏*完成日 ... [详细]
  • 本文整理了一份基础的嵌入式Linux工程师笔试题,涵盖填空题、编程题和简答题,旨在帮助考生更好地准备考试。 ... [详细]
  • 【线段树】  本质是二叉树,每个节点表示一个区间[L,R],设m(R-L+1)2(该处结果向下取整)左孩子区间为[L,m],右孩子区间为[m ... [详细]
  • C语言编写线程池的简单实现方法
    2019独角兽企业重金招聘Python工程师标准好文章,一起分享——有时我们会需要大量线程来处理一些相互独立的任务,为了避免频繁的申请释放线程所带 ... [详细]
  • malloc 是 C 语言中的一个标准库函数,全称为 memory allocation,即动态内存分配。它用于在程序运行时申请一块指定大小的连续内存区域,并返回该区域的起始地址。当无法预先确定内存的具体位置时,可以通过 malloc 动态分配内存。 ... [详细]
  • 为什么多数程序员难以成为架构师?
    探讨80%的程序员为何难以晋升为架构师,涉及技术深度、经验积累和综合能力等方面。本文将详细解析Tomcat的配置和服务组件,帮助读者理解其内部机制。 ... [详细]
  • T15483.【清华集训2017模拟11.26】简单路径T25484.【清华集训2017模拟11.26】快乐树T35485.【清华集训2017模拟11.26】字符串T1结论题,结论很 ... [详细]
  • 【妙】bug称它为数组越界的妙用
    1、聊一聊首先跟大家推荐一首非常温柔的歌曲,跑步的常听。本文主要把自己对C语言中柔性数组、零数组等等的理解分享给大家,并聊聊如何构建一种统一化的学习思想 ... [详细]
author-avatar
封鹏
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有