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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 基于WINCE S3C2440 的LED驅(qū)動(dòng)程序的編寫

          基于WINCE S3C2440 的LED驅(qū)動(dòng)程序的編寫

          作者: 時(shí)間:2016-11-23 來源:網(wǎng)絡(luò) 收藏
          在SMDK2440的BSP包里經(jīng)??匆娺@兩句語句:

          volatile IOPreg *s2440IOP = (IOPreg *)IOP_BASE;
          volatile INTreg *s2440INT = (INTreg *)INT_BASE;

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

          這兩條語句簡單的理解就是把s2440IOP和IOP_BASE等價(jià),把s2440INT和INT_BASE等價(jià)。

          IOP_BASE和INT_BASE在s244.h頭文件中

          #define IOP_BASE 0xB1600000 // 0x56000000
          typedef struct {
          unsigned int rGPACON;// 00
          unsigned int rGPADAT;
          unsigned int rPAD1[2];

          unsigned int rGPBCON;// 10
          unsigned int rGPBDAT;
          unsigned int rGPBUP;
          unsigned int rPAD2;

          unsigned int rGPCCON;// 20
          unsigned int rGPCDAT;
          unsigned int rGPCUP;
          unsigned int rPAD3;

          unsigned int rGPDCON;// 30
          unsigned int rGPDDAT;
          unsigned int rGPDUP;
          unsigned int rPAD4;

          unsigned int rGPECON;// 40
          unsigned int rGPEDAT;
          unsigned int rGPEUP;
          unsigned int rPAD5;

          unsigned int rGPFCON;// 50
          unsigned int rGPFDAT;
          unsigned int rGPFUP;
          unsigned int rPAD6;

          unsigned int rGPGCON;// 60
          unsigned int rGPGDAT;
          unsigned int rGPGUP;
          unsigned int rPAD7;

          unsigned int rGPHCON;// 70
          unsigned int rGPHDAT;
          unsigned int rGPHUP;
          unsigned int rPAD8;

          unsigned int rMISCCR;// 80
          unsigned int rDCKCON;
          unsigned int rEXTINT0;
          unsigned int rEXTINT1;
          unsigned int rEXTINT2;// 90
          unsigned int rEINTFLT0;
          unsigned int rEINTFLT1;
          unsigned int rEINTFLT2;
          unsigned int rEINTFLT3;// A0
          unsigned int rEINTMASK;
          unsigned int rEINTPEND;
          unsigned int rGSTATUS0;// AC
          unsigned int rGSTATUS1;// B0
          unsigned int rGSTATUS2;// B4 ;;; SHL
          unsigned int rGSTATUS3;// B8
          unsigned int rGSTATUS4;// BC

          unsigned int rFLTOUT;// C0
          unsigned int rDSC0;
          unsigned int rDSC1;
          unsigned int rMSLCON;

          unsigned int rGPJCON;// D0
          unsigned int rGPJDAT;
          unsigned int rGPJUP;
          unsigned int rPAD9;

          }IOPreg;

          #define INT_BASE 0xB0A00000 // 0x4A000000
          typedef struct {
          unsigned int rSRCPND;
          unsigned int rINTMOD;
          unsigned int rINTMSK;
          unsigned int rPRIORITY;
          unsigned int rINTPND;
          unsigned int rINTOFFSET;
          unsigned int rSUBSRCPND;
          unsigned int rINTSUBMSK;
          }INTreg ;

          可見IOPreg和INTreg是兩個(gè)結(jié)構(gòu)體,而INT_BASE和IOP_BASE是連個(gè)虛擬地址。因此上面的兩條語句就是把兩個(gè)虛擬地址強(qiáng)化成結(jié)構(gòu)體的首地址,因此可以訪問結(jié)構(gòu)體對(duì)應(yīng)的寄存器了。




          評(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); })();