好文档 - 专业文书写作范文服务资料分享网站

ARM嵌入式课程设计

天下 分享 时间: 加入收藏 我要投稿 点赞

文档仅供参考

{

while ( ( Lcd_Right_Status_Read & 0x80 == 0x80 ;//busy wait Lcd_Right_Command_Write = a; //write command byte }

void Lcd_Data_Left_WR( U8 a {

while ( ( Lcd_Left_Status_Read & 0x80 == 0x80 ;//busy wait Lcd_Left_Data_Write = a; //write data }

void Lcd_Data_Right_WR( U8 a {

while ( ( Lcd_Right_Status_Read & 0x80 == 0x80 ; //busy waitLcd_Right_Data_Write = a; //write data }

void Lcd_Clear( void {

2020年4月19日

11

文档仅供参考

U8 a, b;

for ( a = 0; a < 8; a++ //Clear RAM space of display {

Lcd_Command_Left( 0xb8 | a ; //Set row address of the left half in display area

Lcd_Command_Right( 0xb8 | a ; //Set row address of the left half in display area

Lcd_Command_Left( 0x40 ; //Set tier address of the left half in display area

Lcd_Command_Right( 0x40 ; //Set tier address of the left half in display area

b = 64; while ( b {

Lcd_Data_Left_WR( 0x00 ; //Write 0 on the left half of display area

12

2020年4月19日

文档仅供参考

Lcd_Data_Right_WR( 0x00 ; //Write 0 on the right half of display area.

b = b - 1; } } }

void Lcd_Init( void {

int timeout=30000; //overtime control

Lcd_Command_Left( 0xC0 ; //Set the start row address on the left half

Lcd_Command_Right( 0xC0 ; //Set the start row address on the right half

do {

Lcd_Command_Left( 0x3F ;

13

2020年4月19日

文档仅供参考

timeout--; }

while ( (( Lcd_Left_Status_Read & 0x20 == 0x20 && (timeout!=0 ;//if display and overtiem is not,wait

timeout=30000; do {

Lcd_Command_Right( 0x3F ;//Open the left and right half of display area.

timeout--; }

while ( (( Lcd_Right_Status_Read & 0x20 == 0x20 && (timeout!=0 ;//if display and overtiem is not,wait

}

void Lcd_Display_s( U8* S,uint x,uint y {

2020年4月19日

14

文档仅供参考

U8 a, b; U32 c = 0; if(y<8

for ( a = 2*x; a < 2*x+2; a++ {

Lcd_Command_Left( 0xb8 | a ; Lcd_Command_Left( 0x40+ 8*y ; for ( b = 0; b < 8; b++ {

Lcd_Data_Left_WR( S[c] ;c = c + 1; } } else

for ( a = 2*x; a < 2*x+2; a++ {

Lcd_Command_Right( 0xb8 | a ; Lcd_Command_Right( 0x40+8*(y-8 ;

2020年4月19日15

ARM嵌入式课程设计

文档仅供参考{while((Lcd_Right_Status_Read&0x80==0x80;//busywaitLcd_Right_Command_Write=a;//writecommandbyte}voidLcd_Data_Left_WR(U8a{while((Lcd_Lef
推荐度:
点击下载文档文档为doc格式
3hvgh343kn3blzb1bwa62p7v43zg0p00hz0
领取福利

微信扫码领取福利

微信扫码分享