<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 51單片機總線驅(qū)動

          51單片機總線驅(qū)動

          作者: 時間:2016-11-29 來源:網(wǎng)絡 收藏

          本文引用地址:http://www.ex-cimer.com/article/201611/323324.htm

          全部源代碼下載:http://www.51hei.com/f/128yhj.rar

          #include"reg51.h"sbit cd = P2^0;unsigned char pdata *addr;#define uchar unsigned  char#define uint unsigned shortvoid lcd_writecom_two(uchar onedat,uchar twodat,uchar com);void lcd_writedat_onebyte(uchar onedat,uchar com);uchar lcd_readdat_onebyte(uchar com);void lcd_writedat_nbyte(uchar *dat,uchar len);void lcd_readdat_nbyte(uchar *dat ,uchar len);void clear_point(uchar x,uchar y);void sel_point(uchar x,uchar y);void sel_rmiddling(uchar x,uchar y);void clr_rmiddling(uchar x,uchar y);void sel_rbig(uchar x,uchar y);void clr_rbig(uchar x,uchar y);void graph_mode_writeword(uchar x,uchar y,uchar *dat);void graph_mode_write_letter(uchar x,uchar y,uchar *dat);void rhorizontal(uchar x0,uchar x1,uchar y);void erect(uchar y0,uchar y1,uchar x);void Draw_line(uchar x0,uchar y0,uchar x1,uchar y1);void draw_circle(int x, int y, int r);void lcd_init();/**********************************讀取lcd狀態(tài)**********************************/uchar lcd_readcom(){uchar temp;cd=1;addr = 0xff;temp = *addr;return temp;}/*********************************判斷指令/數(shù)據(jù)讀寫忙碌狀態(tài)*********************************/void check_busy(){uchar temp;do{temp=lcd_readcom();}while((temp&0x03)!=0x03);}/*********************************判斷數(shù)據(jù)自動寫忙碌狀態(tài)*********************************/void check_auto_write_busy(){uchar temp;do{temp=lcd_readcom();}while((temp&0x08)!=0x08);}/*********************************判斷數(shù)據(jù)自動讀忙碌狀態(tài)*********************************/void check_auto_read_busy(){uchar temp;do{temp=lcd_readcom();}while((temp&0x04)!=0x04);}/*********************************向lcd寫命令*********************************/void lcd_writecom(uchar dat){check_busy();cd=1;*addr = dat;}/************************************向lcd寫數(shù)據(jù)************************************/void lcd_writedat(uchar dat){check_busy();cd=0;*addr = dat;}/********************************從lcd讀數(shù)據(jù)*********************************/uchar lcd_readdat(){uchar temp;cd=0;addr = 0xff;temp = *addr;return temp;}				   
          				
                      
                          
          			
          							
          上一頁 1 2 3 4 下一頁

          評論


          技術專區(qū)

          關閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();