亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码
標題:
普中lcd12864參考程序與pdf資料下載,帶背景點陣屏
[打印本頁]
作者:
holikey
時間:
2019-1-10 20:46
標題:
普中lcd12864參考程序與pdf資料下載,帶背景點陣屏
這個屏幕資料不是很多,這是自己寫的,給各位新手參考,
0.png
(43.78 KB, 下載次數: 45)
下載附件
2019-1-11 14:46 上傳
單片機源程序如下:
#include "st7565p.h"
//#include "charcode.h"
// 類似8080接口
extern struct CharCodeTypedef{
unsigned char CharWord;
unsigned char Ecode[16];
};
extern struct CNCodeTypedef
{
unsigned char HZ[2];
unsigned char HZcode[32];
};
extern struct CharCodeTypedef code letter[74];
extern struct CNCodeTypedef code hanzi[3];
void Init_st7565p(void)
{
unsigned int i;
LCD_PZ12864_CS = 0;
LCD_PZ12864_RSET = 0;
for (i=0; i<2000; i++);
LCD_PZ12864_RSET = 1;
WriteCmd_st7565(0xe2); // (14) Internal reset
for (i=0; i<100; i++); //延時一下
WriteCmd_st7565(0xa0); // (8) ADC select : normal , 0xa0: normal, 0xa1: reverse
WriteCmd_st7565(0xc8); // (15) Common output mode select : normal, 0xc8:reverse direction, 0xc7: normal direction
WriteCmd_st7565(0xa6); // (9) Display normal, 0xa6: normal, 0xa7: reverse
WriteCmd_st7565(0xa4); // (10) 0xa5: all points on, 0xa4: all points off
WriteCmd_st7565(0xa2); // (11) bias set : 1/7 , 0xa2:1/9, 0xa3:1/7 區別不大。。
WriteCmd_st7565(0xf8); // (20)
WriteCmd_st7565(0x01);
WriteCmd_st7565(0x81); // (18)
WriteCmd_st7565(0x23);
WriteCmd_st7565(0x25); // (17) Select internal resistor ratio(Rb/Ra) mode
WriteCmd_st7565(0x2f); // (16) Select internal power supply operating mode
for (i=0; i<100; i++);
WriteCmd_st7565(0x40); // (2) Set the display RAM display start line address 0x40 + (0-63)
WriteCmd_st7565(0xaf); // (1) display on/off , 0xaf: on, 0xae: off
for (i=0; i<100; i++);
}
void ClearScreen(void)
{
unsigned char i,j;
for(i = 0; i < 8; i++)
{
WriteCmd_st7565(0xb0 + i); //y
WriteCmd_st7565(0x10);
WriteCmd_st7565(0x00);
for(j = 0; j < 128; j++)
{
WriteData_st7565(0x00);
}
}
}
void WriteCmd_st7565(unsigned char cmd)
{
LCD_PZ12864_CS = 0;
LCD_PZ12864_WR = 0;
LCD_PZ12864_RD = 1; //disable read
LCD_PZ12864_RS = 0; // command
_nop_();
_nop_();
DATA_PORT = cmd;
_nop_();
_nop_();
LCD_PZ12864_WR = 1;
}
void WriteData_st7565(unsigned char dat)
{
LCD_PZ12864_CS = 0;
LCD_PZ12864_WR = 0;
LCD_PZ12864_RD = 1; //disable read
LCD_PZ12864_RS = 1; // data
_nop_();
_nop_();
DATA_PORT = dat;
_nop_();
_nop_();
LCD_PZ12864_WR = 1;
}
void XY_WriteCmd(unsigned char x, unsigned char y)
{
unsigned char xl,xh;
xh = (x >> 4) & 0x0f;
xl = x & 0x0f;
// 八頁0-7,一頁四位
WriteCmd_st7565(0xb0 + y); //y
// 橫坐標127個 0-127,比如第5個 5 - 1 =0x04 ,則高四位為0,第四位為4,即0x10+0,0x00+4
WriteCmd_st7565(0x10 + xh); //x
WriteCmd_st7565(0x00 + xl); //x
}
void XY_Write816Data(unsigned char x,unsigned char y, unsigned char *CH)
{
unsigned char i;
XY_WriteCmd(x,y);
for(i = 0; i < 16; i ++)
{
if(i == 8)
XY_WriteCmd(x,y+1);
WriteData_st7565(*(CH+i));
}
}
void XY_Write1616Data(unsigned char x,unsigned char y, unsigned char *CH)
{
unsigned char i;
XY_WriteCmd(x,y);
for(i = 0; i < 32; i ++)
{
if(i == 16)
XY_WriteCmd(x,y+1);
WriteData_st7565(*(CH+i));
}
}
void XY_WriteString(unsigned char x, unsigned char y, unsigned char *str)
{
unsigned char i;
while(*str != '\0')
{
for(i = 0; i < 74; i ++) //字庫字符數量
{
if(*str == letter[i].CharWord)
{
XY_Write816Data(x, y, letter[i].Ecode);
x += 8;
}
}
str += 1;
}
}
void XY_WriteCN(unsigned char x, unsigned char y, unsigned char *str)
{
unsigned char i;
while(*str != '\0')
{
for(i = 0; i < 3; i ++)//字庫漢字數量
{
if((*str == hanzi[i].HZ[0]) && (*(str + 1) == hanzi[i].HZ[1]))
{
XY_Write1616Data(x, y, hanzi[i].HZcode);
x += 16;
}
}
str += 2;
}
}
復制代碼
所有資料51hei提供下載:
普中12864帶背景點陣屏.rar
(2.75 MB, 下載次數: 41)
2019-1-10 20:45 上傳
點擊文件名下載附件
參考
下載積分: 黑幣 -5
作者:
holikey
時間:
2019-1-10 20:47
老手忽略就好
歡迎光臨 (http://www.denmoz.com/bbs/)
Powered by Discuz! X3.1