标题:
STM32驱动12864 ST7567源程序
[打印本页]
作者:
小鸡腿
时间:
2020-3-4 19:07
标题:
STM32驱动12864 ST7567源程序
坛友驱动成功图片:
http://www.51hei.com/bbs/dpj-198180-1.html
#include "stm32f10x.h"
#include "key.h"
#include "lcd.h"
unsigned char cheng1[];
unsigned char gong1[];
unsigned char zhuang1[];
unsigned char tai1[];
unsigned char shi1[];
unsigned char yong1[];
unsigned char bmp_12864_1[];
unsigned char bmp_12864_2[];
unsigned char bmp_12864_3[];
unsigned char bmp_12864_4[];
unsigned char bmp_12864_5[];
unsigned char bmp_12864_6[];
unsigned char Bmp_Tou[];
int main(void)
{
LCD_GPIO_Config();
KEY_GPIO_Config();
while(1)
{
initial_lcd();
clear_screen(); //clear all dots
test_display(0x55,0xff); //全显示
waitkey();
//delay(3000);
test_display(0x55,0xaa); //雪花1
waitkey();
//delay(3000);
test_display(0xaa,0x55); //雪花2
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_128x64(1,1,bmp_12864_1); //显示12864点阵图片 回字型图案
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_128x64(1,1,bmp_12864_2);
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_128x64(1,1,bmp_12864_3);
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_128x64(1,1,bmp_12864_4);
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_128x64(1,1,bmp_12864_5);
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_128x64(1,1,bmp_12864_6);
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_graphic_32x32(1,(1+32*1),cheng1); /*在第1页,第49列显示单个汉字"成"*/
display_graphic_32x32(1,(1+32*2),gong1); /*在第1页,第49列显示单个汉字"功"*/
display_graphic_16x16_2(0,6,1,zhuang1); /*在第5页,第1列显示单个汉字"状"*/
display_graphic_16x16_2(0,6,(1+16),tai1); /*在第5页,第17列显示单个汉字"态"*/
display_string_8x16(6,(1+16+16),":"); /*在第5页,第25列显示单个字符":"*/
display_graphic_16x16(6,(1+16*2+8),shi1); /*在第5页,第41列显示单个汉字"使"*/
display_graphic_16x16(6,(1+16*3+8),yong1); /*在第5页,第49列显示单个汉字"用"*/
display_string_8x16(6,89,"12:45"); /*在第5页,第89列显示单个数字"0"*/
waitkey();
//delay(3000);
clear_screen(); //clear all dots
display_string_8x16(1,1,"0123456789abcdef");/*在第1页,第1列显示字符串*/
display_string_8x16(3,1,"~`!@#$%^&*()_-+=");/*在第*页,第*列显示字符串*/
display_string_5x8(5,1," ! #$%&'()*+,-./01234");
display_string_5x8(6,1,"56789:;<=>?@ABCDEFGHI");
display_string_5x8(7,1,"JKLMNOPQRSTUVWXYZ[\\]^");
display_string_5x8(8,1,"_`abcdefghijklmnopqrs");
waitkey();
//delay(3000);
}
}
unsigned char Bmp_Tou[]={0x00,0x10,0x10,0x10,0xFE,0x90,0x10,0xC0,0xBC,0x84,0x84,0xBE,0xC4,0x40,0x40,0x00,
0x00,0x02,0x22,0x41,0x3F,0x00,0x40,0x40,0x23,0x14,0x08,0x16,0x21,0x60,0x20,0x00};//投,16*16
unsigned char cheng1[]={
/*-- 文字: 成 --*/
/*-- 宋体23; 此字体下对应的点阵为:宽x高=31x31 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=32x32 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,
0xFC,0xFC,0x88,0x00,0x00,0x1C,0x78,0xF0,0xE0,0x00,0x80,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFF,0xFF,0x83,0x83,0x83,0x83,0x83,0x83,0xC3,0xC3,0x03,0x1F,
0xFF,0xFF,0x83,0x03,0x03,0x03,0xC3,0xF3,0xF3,0x63,0x03,0x03,0x00,0x00,0x00,0x00,
0x00,0x00,0xFC,0xFF,0x3F,0x00,0x80,0x00,0x00,0x80,0xFF,0xFF,0x03,0x00,0x00,0x03,
0x9F,0xFF,0xF8,0xF8,0xBE,0x1F,0x07,0x01,0x00,0x00,0xE0,0x20,0x00,0x00,0x20,0x38,
0x1F,0x07,0x01,0x00,0x00,0x01,0x01,0x07,0x07,0x23,0x31,0x18,0x0C,0x0E,0x07,0x03,
0x01,0x01,0x01,0x03,0x07,0x0F,0x0E,0x1C,0x1F,0x3F,0x30,0x00,0x00,0x00,0x00,0x00};
unsigned char gong1[]={
/*-- 文字: 功 --*/
/*-- 宋体23; 此字体下对应的点阵为:宽x高=31x31 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=32x32 --*/
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xC0,0xC0,0xC0,0x00,
0x00,0x00,0x00,0xFE,0xFC,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x0C,0x04,0x04,
0x04,0x84,0xFF,0xFF,0x04,0x04,0x04,0x04,0x04,0xFE,0xFE,0x04,0x00,0x00,0x00,0x00,
0xC0,0xC0,0xC0,0xC0,0xE0,0x60,0x7F,0x3F,0x30,0x30,0x10,0x18,0x18,0x88,0xC0,0xF8,
0x7F,0x1F,0x01,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x01,
0x01,0x00,0x00,0x00,0x00,0x20,0x20,0x30,0x18,0x0C,0x0C,0x07,0x03,0x01,0x00,0x04,
0x04,0x0C,0x0C,0x1C,0x38,0x3C,0x1F,0x0F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
unsigned char zhuang1[]={
/*-- 文字: 状 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x08,0x30,0x00,0xFF,0x20,0x20,0x20,0x20,0xFF,0x20,0xE1,0x26,0x2C,0x20,0x20,0x00,
0x04,0x02,0x01,0xFF,0x40,0x20,0x18,0x07,0x00,0x00,0x03,0x0C,0x30,0x60,0x20,0x00};
unsigned char tai1[]={
/*-- 文字: 态 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x04,0x04,0x04,0x84,0x44,0x34,0x4F,0x94,0x24,0x44,0x84,0x84,0x04,0x00,0x00,
0x00,0x60,0x39,0x01,0x00,0x3C,0x40,0x42,0x4C,0x40,0x40,0x70,0x04,0x09,0x31,0x00};
unsigned char shi1[]={
复制代码
全部资料51hei下载地址:
JHDLCDSTM32.7z
(667.43 KB, 下载次数: 199)
2020-3-4 19:18 上传
点击文件名下载附件
下载积分: 黑币 -5
作者:
aslfm
时间:
2020-5-9 15:18
感谢,正好需要, 验证OK后,再上来回复。
作者:
凤凰院凶真
时间:
2020-11-17 21:38
下载了,非常好用,谢谢楼主。
作者:
Mascreda
时间:
2021-5-27 10:00
资料很好,修改IO后可以直接使用
作者:
迪拜幼儿园
时间:
2023-1-10 13:04
我是在f407的板子上运行的,修改了io口,根据f103和f407的区别修改了一些命令,但是不知道为什么一直不显示
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1