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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 數(shù)據(jù)高低位交換程序

          數(shù)據(jù)高低位交換程序

          作者: 時(shí)間:2016-11-18 來源:網(wǎng)絡(luò) 收藏
          有時(shí)候連接數(shù)據(jù)口的時(shí)候,為了硬件電路連接布線方便,所以剛好把數(shù)據(jù)口的高低位逆向連接,但是可以用軟件來轉(zhuǎn)換過來,具體程序如下:C51格式
          /////////數(shù)據(jù)高低位交換子程序/////////////
          //D0-D7 => D7-D0
          uchar Data_change(uchar data_temp)
          {
          uchar i,temp1;
          temp1=0;
          for(i=0;i<8;i++)
          {
          data_temp=data_temp<<1;
          if(CY==0)
          {temp1=temp1|0x00;}
          else
          {temp1=temp1|0x80;}
          if(7>i>0)
          {temp1=temp1>>1;}
          else
          {;}
          }
          return (temp1);
          }
          //////////////////////////////


          評(píng)論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁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); })();