STM32液晶屏驱动程序.docx
《STM32液晶屏驱动程序.docx》由会员分享,可在线阅读,更多相关《STM32液晶屏驱动程序.docx(39页珍藏版)》请在冰豆网上搜索。
STM32液晶屏驱动程序
附录2
整个设计全部源程序:
/*以下是32x64点阵LED电子显示屏的源程序,采用C语言编写,在KeilμVisionV2.38a(C51.ExeV7.06)以及MedWin3.0版环境下均测试通过。
*/
#include
unsignedintzimo,xx=0;//zimo是字模计数器,xx为分屏显示的时候的字数。
unsignedcharyid,h;//yid为移动计数器,h为行段计数器
unsignedcharcodehanzi[];//汉字字模
unsignedcharBUFF[18],BUFF2[18];//左移显示的缓存
voidqing(void);voidxianshi(void);
voidfen(void);voidzuo(void);
voidin_data(void);//调整数据
voidrxd_data(void);//左移发送数据
voidout_rxd(unsignedchar*d);//分屏、上移发送数据
charcodesw[]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x00};/*8行段码*/
/***********主程序******************/
voidmain(void)
{unsignedcharee;
SCON=0;P1=0;yid=0;zimo=0;
while
(1)
{fen();//分屏显示
for(ee=30;ee>0;ee--)//清屏幕3秒
{qing();}
zuo();//左移显示
for(ee=30;ee>0;ee--)
}
/**********清屏幕*******************/
voidqing(void)
{unsignedcharzz,xx=0x0ff;
for(zz=33;zz>0;zz--)
{out_rxd(&xx);}
P1=0xff;P1=0;//锁存为高,74HC595锁存信号
P2=0;//清74LS138的使能端
/**********分屏显示***********/
voidfen(void)
{do{xianshi();}while(xx++<=5);//调用单屏显示
xx=0;
/************单屏显示*************/
voidxianshi(void)
{unsignedcharii,jj;unsignedintkk,aa;
for(kk=500;kk>0;kk--)//每屏显示500次
{for(ii=1;ii<16;ii+=2)//每个汉字分8行扫描
{for(jj=0;jj<8;jj++)//每次要发送8个汉字的2个字节,发送8次
{aa=(xx*8+jj)*32+ii;
out_rxd(&hanzi[aa]);//从串口输出第1个字的第1字节。
out_rxd(&hanzi[aa-1]);//从串口输出第1个字的第1字节。
for(jj=0;jj<8;jj++)//每次要发送8个汉字的2个字节,发送8次
out_rxd(&hanzi[aa+16]);//从串口输出第1个字的第17字节。
out_rxd(&hanzi[aa+15]);//从串口输出第1个字的第18字节
P2=0x0ff;
P2=sw[h];//输出行信号
h++;//行加一
if(h==8)h=0;
/***************左移显示************/
voidzuo(void)
{unsignedchari,d=5;//d为移动的时候一个汉字的扫描显示次数
xianshi();//调用单屏显示
while(zimo<=1450)
{while(yid<16)//数据移位。
{for(i=0;i{for(h=0;h<8;h++)//8行扫描{in_data();//调整数据rxd_data();//串口发送数据P2=sw[h];//送段码P1=0xff;//锁存为高,595锁存信号P1=0;}}yid++;//移动一步}yid=0;zimo=zimo+32;//后移一个字,}zimo=0;}/*************分屏显示的数据发送************/voidout_rxd(unsignedchar*d)/*从串口发送数据*/{SBUF=*d;while(!TI);//等待发送完毕TI=0;}/*******左移显示读取数据并调整**************/voidin_data(void){chars,w;unsignedintqqq;for(s=8;s>=0;s--){w=s+s;qqq=zimo+h+h+s*32;BUFF[w+1]=hanzi[qqq];BUFF[w]=hanzi[qqq+1];BUFF2[w+1]=hanzi[qqq+16];BUFF2[w]=hanzi[qqq+17];}}/**********左移显示的数据调整发送***************/voidrxd_data(void)//串行发送数据{unsignedcharinc,s,tempyid,temp;if(yid<8)inc=0;elseinc=1;for(s=0+inc;s<16+inc;s++)//发送数据{if(yid<8)tempyid=yid;elsetempyid=yid-8;temp=(BUFF[s]>>tempyid)|(BUFF[s+1]<<(8-tempyid));SBUF=temp;//把BUFF中的字节从大到小移位相或后发送输出。while(!TI);TI=0;//等待发送中断}for(s=0+inc;s<16+inc;s++)//发送8字节数据{if(yid<8)tempyid=yid;elsetempyid=yid-8;temp=(BUFF2[s]>>tempyid)|(BUFF2[s+1]<<(8-tempyid));SBUF=temp;//把BUFF中的字节从大到小移位相或后发送输出。while(!TI);TI=0;//等待发送中断}}/*************汉字编码信息*************/unsignedcharcodehanzi[]={/*--文字:勤--*/0xFB,0xBB,0xFA,0x00,0xFB,0xBB,0xFB,0x83,0xC0,0xEF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F,0xBF,0xEF,0xBF,0xC0,0x01,0xEF,0xBF,0xF7,0xBF,0xFB,0xBF,0x80,0x00,0xFE,0x7F,0xFF,0xBF,0xF3,0xCF,0xFC,0xD3,0xFF,0x1C,0xDF,0xDF,0xDF,0xDF,0xC0,0x3F,0xFF,0xFF,/*--文字:师--*/0xFF,0xEF,0x80,0x2F,0xFB,0xED,0xFB,0xED,0x80,0x2D,0xBB,0xAD,0xBB,0xAD,0xBB,0xAD,0xBB,0xAD,0xBB,0xB5,0xAB,0xB5,0xDB,0xB7,0xFB,0xFB,0xFB,0xFD,0xFB,0xFE,0xFB,0xFF,/*--文字:!--*/0xFE,0x3F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFE,0x3F,0xFE,0x3F,0xFF,0x7F,0xFF,0xFF,0xFF,0x7F,0xFE,0x3F,0xFE,0x3F,0xFF,0x7F,0xFF,0xFF};stm32_19264液晶LCD驱动程序/****************************lcd.h********************************************/#ifndef__LCD_H #define__LCD_H #include"sys.h" #defineLCD_RS PFout(0)//PF.0 #defineLCD_E PFout(1)//PF.1 #defineLCD_CS1PFout(2)//PF.2 #defineLCD_RSTPFout(3)//PF.3 #defineLCD_CS2PFout(4)//PF.4 #defineLCD_CS3PFout(5)//PF.5 #defineLCD_DATA(x) GPIOE->ODR=(GPIOB->ODR&0x807F)|((x&0x00FF)<<7)//PE7~14,作为数据线 #defineLCD_PAGE_ADDR0xb8 #defineLCD_COL_ADDR 0x40 voidLCDPortSet(void);//LCDIO口配置 voidLcdInit(void); //初始化程序 voidLcdClear(void);//清屏程序 voidWriteChr16x16(u8pag,u8col,u8 *chr);//写一个汉字 #endif /******************************************************lc
{for(h=0;h<8;h++)//8行扫描
{in_data();//调整数据
rxd_data();//串口发送数据
P2=sw[h];//送段码
P1=0xff;//锁存为高,595锁存信号
P1=0;
yid++;//移动一步
yid=0;zimo=zimo+32;//后移一个字,
zimo=0;
/*************分屏显示的数据发送************/
voidout_rxd(unsignedchar*d)/*从串口发送数据*/
{SBUF=*d;while(!
TI);//等待发送完毕
TI=0;
/*******左移显示读取数据并调整**************/
voidin_data(void)
{chars,w;unsignedintqqq;
for(s=8;s>=0;s--)
{w=s+s;
qqq=zimo+h+h+s*32;
BUFF[w+1]=hanzi[qqq];
BUFF[w]=hanzi[qqq+1];
BUFF2[w+1]=hanzi[qqq+16];
BUFF2[w]=hanzi[qqq+17];
/**********左移显示的数据调整发送***************/
voidrxd_data(void)//串行发送数据
{unsignedcharinc,s,tempyid,temp;
if(yid<8)inc=0;
elseinc=1;
for(s=0+inc;s<16+inc;s++)//发送数据
{if(yid<8)tempyid=yid;
elsetempyid=yid-8;
temp=(BUFF[s]>>tempyid)|(BUFF[s+1]<<(8-tempyid));
SBUF=temp;//把BUFF中的字节从大到小移位相或后发送输出。
while(!
TI);TI=0;//等待发送中断
for(s=0+inc;s<16+inc;s++)//发送8字节数据
temp=(BUFF2[s]>>tempyid)|(BUFF2[s+1]<<(8-tempyid));
/*************汉字编码信息*************/
unsignedcharcodehanzi[]={/*--文字:
勤--*/
0xFB,0xBB,0xFA,0x00,0xFB,0xBB,0xFB,0x83,0xC0,0xEF,0xDB,0x01,0xDB,0x6D,0xDB,0x01,0xDB,0xEF,0xDB,0x01,0xDB,0xEF,0xDB,0x83,0xDD,0xEF,0xDD,0x0F,0xD6,0xE0,0xEF,0x7D,/*--文字:
奋--*/
0xFF,0x7F,0xFF,0x7F,0xFF,0x7F,0x80,0x00,0xFE,0xBF,0xFD,0xDF,0xF3,0xEF,0x8F,0xF3,0xD0,0x04,0xF7,0x77,0xF7,0x77,0xF0,0x07,0xF7,0x77,0xF7,0x77,0xF0,0x07,0xF7,0xF7,/*--文字:
求--*/
0xFB,0x7F,0xF7,0x7F,0xF7,0x7F,0xC0,0x01,0xFF,0x7F,0xEF,0x7B,0xF7,0x77,0xFA,0x6F,0xFD,0x7F,0xFB,0x5F,0xF7,0x6F,0x8F,0x77,0xDF,0x79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0xFF,0xDF,0xFF,0xDF,0xF0,0x1F,0xFB,0xCF,0xFB,0xB7,0xFD,0xB9,0xFE,0x7F,0xF9,0x9F,0x87,0xE7,0xD0,0x08,0xF7,0xEF,0xF7,0xEF,0xF7,0xEF,0xF7,0xEF,0xF0,0x0F,0xFF,0xFF,/*--文字:
位--*/
0xFF,0x6F,0xFC,0xCF,0xFD,0xF7,0xC0,0x17,0xFF,0xFB,0xF7,0xD3,0xE7,0xB5,0xF7,0xB5,0xF7,0x76,0xFB,0x77,0xFB,0x77,0xFB,0xF7,0xFD,0xF7,0x80,0x07,0xFF,0xF7,0xFF,0xFF,/*--文字:
老--*/
0xFF,0xBF,0xEF,0xBF,0xC0,0x01,0xEF,0xBF,0xF7,0xBF,0xFB,0xBF,0x80,0x00,0xFE,0x7F,0xFF,0xBF,0xF3,0xCF,0xFC,0xD3,0xFF,0x1C,0xDF,0xDF,0xDF,0xDF,0xC0,0x3F,0xFF,0xFF,/*--文字:
师--*/
0xFF,0xEF,0x80,0x2F,0xFB,0xED,0xFB,0xED,0x80,0x2D,0xBB,0xAD,0xBB,0xAD,0xBB,0xAD,0xBB,0xAD,0xBB,0xB5,0xAB,0xB5,0xDB,0xB7,0xFB,0xFB,0xFB,0xFD,0xFB,0xFE,0xFB,0xFF,/*--文字:
!
--*/
0xFE,0x3F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFC,0x1F,0xFE,0x3F,0xFE,0x3F,0xFF,0x7F,0xFF,0xFF,0xFF,0x7F,0xFE,0x3F,0xFE,0x3F,0xFF,
0x7F,0xFF,0xFF};
stm32_19264液晶LCD驱动程序
/****************************lcd.h********************************************/
#ifndef__LCD_H
#define__LCD_H
#include"sys.h"
#defineLCD_RS PFout(0)//PF.0
#defineLCD_E PFout
(1)//PF.1
#defineLCD_CS1PFout
(2)//PF.2
#defineLCD_RSTPFout(3)//PF.3
#defineLCD_CS2PFout(4)//PF.4
#defineLCD_CS3PFout(5)//PF.5
#defineLCD_DATA(x) GPIOE->ODR=(GPIOB->ODR&0x807F)|((x&0x00FF)<<7)//PE7~14,作为数据线
#defineLCD_PAGE_ADDR0xb8
#defineLCD_COL_ADDR 0x40
voidLCDPortSet(void);//LCDIO口配置
voidLcdInit(void); //初始化程序
voidLcdClear(void);//清屏程序
voidWriteChr16x16(u8pag,u8col,u8 *chr);//写一个汉字
#endif
/******************************************************lc
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1