亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hal.h

?? 基于IAR開發環境的利用CC2510無線單片機實現的多路數據采集。
?? H
?? 第 1 頁 / 共 5 頁
字號:

#define BAUD_E(baud, clkDivPow)( \
   (baud ==   2400) ?   6 +clkDivPow : \
   (baud ==   4800) ?   7 +clkDivPow : \
   (baud ==   9600) ?   8 +clkDivPow : \
   (baud ==  14400) ?   9 +clkDivPow : \
   (baud ==  19200) ?   9 +clkDivPow : \
   (baud ==  28800) ?  10 +clkDivPow : \
   (baud ==  38400) ?  10 +clkDivPow : \
   (baud ==  57600) ?  11 +clkDivPow : \
   (baud ==  76800) ?  11 +clkDivPow : \
   (baud == 115200) ?  12 +clkDivPow : \
   (baud == 230400) ?  13 +clkDivPow : \
   (baud == 307200) ?  13 +clkDivPow : \
   (baud == 460800) ?  14 +clkDivPow : \
   0)

#define BAUD_M(baud) ( \
   (baud ==   2400) ?  131 : \
   (baud ==   4800) ?  131 : \
   (baud ==   9600) ?  131 : \
   (baud ==  14400) ?   34 : \
   (baud ==  19200) ?  131 : \
   (baud ==  28800) ?   34 : \
   (baud ==  38400) ?  131 : \
   (baud ==  57600) ?   34 : \
   (baud ==  76800) ?  131 : \
   (baud == 115200) ?   34 : \
   (baud == 230400) ?   34 : \
   (baud == 307200) ?  131 : \
   (baud == 460800) ?   34 : \
   0)


//*****************************************************************************

// Macro for setting up a UART transfer channel. The macro sets the appropriate
// pins for peripheral operation, sets the baudrate, and the desired options of
// the selected uart. _uart_ indicates which uart to configure and must be
// either 0 or 1. _baudRate_ must be one of 2400, 4800, 9600, 14400, 19200,
// 28800, 38400, 57600, 76800, 115200, 153600, 230400 or 307200. Possible
// options are defined below.
//
// Example usage:
//
//      UART_SETUP(0,115200,HIGH_STOP);
//
// This configures uart 0 for contact with "hyperTerminal", setting:
//      Baudrate:           115200
//      Data bits:          8
//      Parity:             None
//      Stop bits:          1
//      Flow control:       None
//

#define UART_SETUP(uart, baudRate, options)      \
   do {                                          \
      if ((options) & FLOW_CONTROL_ENABLE){     \
         if((uart) == 0){      /* USART0       */\
            if(PERCFG & 0x01){ /* Alt 2        */\
               P1SEL |= 0x3C;                    \
            } else {           /* Alt 1        */\
               P0SEL |= 0x3C;                    \
            }                                    \
         }                                       \
         else {                /* USART1       */\
            if(PERCFG & 0x02){ /* Alt 2        */\
               P1SEL |= 0xF0;                    \
            } else {           /* Alt 1        */\
               P0SEL |= 0x3C;                    \
            }                                    \
         }                                       \
      }                                          \
      else{                    /* Flow Ctrl Dis*/\
         if((uart) == 0){      /* USART0       */\
            if(PERCFG & 0x01){ /* Alt 2        */\
               P1SEL |= 0x30;                    \
            } else {           /* Alt 1        */\
               P0SEL |= 0x0C;                    \
            }                                    \
         }                                       \
         else {                /* USART1       */\
            if(PERCFG & 0x02){ /* Alt 2        */\
               P1SEL |= 0xC0;                    \
            } else {           /* Alt 1        */\
               P0SEL |= 0x30;                    \
            }                                    \
         }                                       \
      }                                          \
                                                 \
      U##uart##GCR = BAUD_E((baudRate), CLKSPD); \
      U##uart##BAUD = BAUD_M(baudRate);          \
                                                 \
      U##uart##CSR |= 0x80;                      \
                                                 \
      U##uart##UCR |= ((options) | 0x80);        \
                                                 \
      if((options) & TRANSFER_MSB_FIRST){        \
         U##uart##GCR |= 0x20;                   \
      }                                          \
   } while(0)


// Options for UART_SETUP macro
#define FLOW_CONTROL_ENABLE         0x40
#define FLOW_CONTROL_DISABLE        0x00
#define EVEN_PARITY                 0x20
#define ODD_PARITY                  0x00
#define NINE_BIT_TRANSFER           0x10
#define EIGHT_BIT_TRANSFER          0x00
#define PARITY_ENABLE               0x08
#define PARITY_DISABLE              0x00
#define TWO_STOP_BITS               0x04
#define ONE_STOP_BITS               0x00
#define HIGH_STOP                   0x02
#define LOW_STOP                    0x00
#define HIGH_START                  0x01
#define TRANSFER_MSB_FIRST          0x80
#define TRANSFER_MSB_LAST           0x00


// Example usage:
//   if(UART0_PARERR())
//     ...
#define UART_PARERR(num)      ((U##num##CSR & 0x08) == 0x08)
#define UART0_PARERR()        UART_PARERR(0)
#define UART1_PARERR()        UART_PARERR(1)

// Example usage:
//   if(UART1_FRAMEERR())
//     ...
#define UART_FRAMEERR(num)    ((U ##num## CSR & 0x10) == 0x10)
#define UART0_FRAMEERR()      UART_FRAMEERR(0)
#define UART1_FRAMEERR()      UART_FRAMEERR(1)


// Example usage:
//   char ch = 'A';
//   UART1_SEND(ch);
//   ...
//   UART1_RECEIVE(ch);
#define UART_SEND(num, x)   U##num##DBUF = x
#define UART0_SEND(x)       UART_SEND(0, x)
#define UART1_SEND(x)       UART_SEND(1, x)

#define UART_RECEIVE(num, x)  x = U##num##DBUF
#define UART0_RECEIVE(x)      UART_RECEIVE(0, x)
#define UART1_RECEIVE(x)      UART_RECEIVE(1, x)



/******************************************************************************
*******************    USART-SPI specific functions/macros  *******************
*******************************************************************************
The macros in this section simplify SPI operation.

******************************************************************************/

// Macro for setting up an SPI connection. The macro configures the appropriate
// pins for peripheral operation, sets the baudrate if the chip is configured
// to be SPI master, and sets the desired clock polarity and phase. Whether to
// transfer MSB or LSB first is also determined. _spi_ indicates whether
// to use spi 0 or 1. _baudRate_ must be one of 2400, 4800, 9600, 14400, 19200,
// 28800, 38400, 57600, 76800, 115200, 153600, 230400 or 307200.
// Possible options are defined below.

#define SPI_SETUP(spi, baudRate, options)           \
   do {                                             \
      U##spi##UCR = 0x80;                           \
      U##spi##CSR = 0x00;                           \
                                                    \
      if((options) & SPI_SLAVE){  /* Slave        */\
         if(spi == 0){            /* USART0       */\
            if(PERCFG & 0x01){    /* Alt 2        */\
               P1SEL |= 0x3C;                       \
            } else {              /* Alt 1        */\
               P0SEL |= 0x3C;                       \
            }                                       \
         } else {                 /* USART1       */\
            if(PERCFG & 0x02){    /* Alt 2        */\
               P1SEL |= 0xF0;                       \
            } else {                                \
              P0SEL |= 0x3C;      /* Alt 1        */\
            }                                       \
         }                                          \
         U##spi##CSR = 0x20;                        \
      }                                             \
      else {                      /* Master       */\
         if(spi == 0){            /* USART0       */\
            if(PERCFG & 0x01){    /* Alt 2        */\
                P1SEL |= 0x38;                      \
                P1SEL &= ~0x04;                     \
            } else {              /* Alt 1        */\
               P0SEL |= 0x2C;                       \
               P0SEL &= ~0x10;                      \
            }                                       \
         } else {                 /* USART 1      */\
            if(PERCFG & 0x02){    /* Alt 2        */\
               P1SEL |= 0xE0;                       \
               P1SEL &= ~0x10;                      \
            } else {              /* Alt 1        */\
               P0SEL |= 0x38;                       \
               P0SEL &= ~0x04;                      \
            }                                       \
         }                                          \
         U##spi##GCR = BAUD_E(baudRate, CLKSPD);    \
         U##spi##BAUD = BAUD_M(baudRate);           \
      }                                             \
      U##spi##GCR |= ((options) & 0xE0);            \
   } while(0)


// Options for the SPI_SETUP macro.
#define SPI_SLAVE              0x01
#define SPI_MASTER             0x00
#define SPI_CLOCK_POL_LO       0x00
#define SPI_CLOCK_POL_HI       0x80
#define SPI_CLOCK_PHA_0        0x00
#define SPI_CLOCK_PHA_1        0x40
#define SPI_TRANSFER_MSB_FIRST 0x20
#define SPI_TRANSFER_MSB_LAST  0x00



/******************************************************************************
*******************       FLASH programming functions       *******************
*******************************************************************************
 _halFlashWritePage(...)_ writes a whole flash page. Because code memory cannot
be read during flash write, the writing routines are copied to XDATA RAM. The
function is implemented in assembly code with file extensions .s51 rather than .c

The Direct Memory Access (DMA) may also be used for flash write.
******************************************************************************/

//Macro for erasing a given flash page
#define FLASH_ERASE_PAGE(page) \
   do{                         \
      FADDRH = (page) << 1;    \
      FADDRL = 0x00;           \
      FLASH_CONFIG(ERASE);     \
   }while (0)


// Macro for configuring flash access and setting flash access mode.
#define FLASH_CONFIG(options)     \
   do {                           \
      FWT  = ( 0x22 >> CLKSPD );  \
      FCTL = (options);           \
   } while (0)

// _options_ may be the following:
#define READ_WHEN_NEED  0x00
#define CONTINOUS_READ  0x10
#define WRITE           0x02
#define ERASE           0x01
#define FLASH_BUSY      0x80

/******************************************************************************
* @fn  halFlashWritePage
*
* @brief
*       This function writes a byte field in XDATA RAM to a given flash
*       page. Normal program execution is run from flash. However during flash
*       write, flash memory is not available for reading. To circumvent this
*       problem the core operation of this procedure, namely the actual flash
*       write procedure, is copied to XDATA RAM and run from there. The flash
*       write procedure is copied to a 35 byte XDATA RAM buffer.
*       Prior to a write the page is erased.
*
*       This function disables interrupts when running, and re-enables interrupt
*       if interrupts were enabled at function entry.
*
* Parameters:
*
* @param  BYTE*	 pSrcAddr
*         Pointer to first byte in xdata space which is to be written to
*         flash. The number of bytes a flash page consists of starting from
*         this address will be written to the page _page_.
* @param  BYTE*	 pBuffer
*         Pointer to a buffer of 35 bytes in XDATA RAM to which the flash
*         write procedure
*         can be copied.
* @param  BYTE	    page
*         Indicates which of the flash pages the data is to be written to.
*
* @return void
*
******************************************************************************/
void halFlashWritePage(BYTE *pSrcAddr, BYTE *pBuffer, BYTE page);


/******************************************************************************
* @fn  halFlashErasePage
*
* @brief
*       This function erases a given flash page.
*
*       This function disables interrupts when running, and re-enables interrupt
*       if interrupts were enabled at function entry.
*
* Parameters:
*
* @param  BYTE*	 pBuffer
*         Pointer to a buffer of 10 bytes in XDATA RAM to which the flash
*         erase procedure can be copied.
* @param  BYTE	    page
*         Indicates which of the flash pages is to be erased.
*
* @return void
*
******************************************************************************/
void halFlashErasePage(BYTE* buffer, BYTE page);



/******************************************************************************
*******************      Power and clock management        ********************
*******************************************************************************

These macros are used to set power-mode, clock source and clock speed.

******************************************************************************/

// Macro for getting the clock division factor
#define CLKSPD  (CLKCON & 0x07)

// Macro for getting the timer tick division factor.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久99久久久精品网站| 日韩av一区二| 成人中文字幕在线| 麻豆视频一区二区| 青青青伊人色综合久久| 亚洲一区二区三区三| 一区二区三区高清在线| 中文字幕一区二区三区乱码在线 | 91精品在线免费| 99国产精品一区| 一本色道亚洲精品aⅴ| 一本大道久久a久久综合| 91香蕉国产在线观看软件| aaa国产一区| 91蜜桃婷婷狠狠久久综合9色| av综合在线播放| 一本一本大道香蕉久在线精品| 成人动漫一区二区三区| 99re成人在线| 色狠狠av一区二区三区| 欧美日韩一区二区三区高清| 欧美日韩国产影片| 日韩欧美在线综合网| 久久看人人爽人人| 一区二区中文字幕在线| 亚洲国产日韩在线一区模特| 日韩av不卡在线观看| 蜜臀av一区二区在线免费观看 | 麻豆成人av在线| 国产精品白丝jk黑袜喷水| 成人免费高清视频在线观看| 色综合婷婷久久| 欧美日韩国产综合一区二区| 在线成人av网站| 久久久久国产精品麻豆ai换脸| 国产精品久久777777| 亚洲电影第三页| 国产精品亚洲午夜一区二区三区| 99久久精品国产网站| 91麻豆精品国产91久久久更新时间| 欧美一级片在线| 中文字幕中文字幕一区二区 | 91精品国产综合久久国产大片| 精品国产乱码久久久久久免费 | 91无套直看片红桃| 56国语精品自产拍在线观看| 久久综合色天天久久综合图片| 中文字幕一区二| 美女诱惑一区二区| 色噜噜狠狠成人网p站| 精品国产污网站| 一区二区三区加勒比av| 国产夫妻精品视频| 91.com在线观看| 亚洲欧洲日产国码二区| 激情综合五月天| 在线一区二区观看| 亚洲国产精品黑人久久久| 日韩高清不卡一区| 91在线小视频| 久久精品欧美日韩精品| 亚洲成人先锋电影| 色综合天天性综合| 久久综合久久久久88| 日本亚洲免费观看| 欧美日韩一区二区在线观看视频| 中日韩av电影| 国产激情一区二区三区四区| 日韩一级大片在线观看| 亚洲h在线观看| 色噜噜狠狠一区二区三区果冻| 国产亚洲一二三区| 国产美女久久久久| 精品国产自在久精品国产| 日韩影视精彩在线| 在线精品亚洲一区二区不卡| 亚洲国产日日夜夜| 色哟哟日韩精品| 亚洲色图丝袜美腿| 99久久亚洲一区二区三区青草| 久久久久久免费毛片精品| 免费高清在线视频一区·| 欧美日本韩国一区| 日韩av电影一区| 欧美一区二区三区免费观看视频| 亚洲国产精品一区二区尤物区| 欧美午夜电影网| 亚洲综合一区在线| 欧美日韩国产123区| 亚洲高清不卡在线| 欧美一区二区三区四区五区 | 日韩av在线免费观看不卡| 欧美丝袜丝交足nylons图片| 成人免费一区二区三区在线观看| 成人黄色免费短视频| 国产日韩欧美亚洲| 福利一区福利二区| 国产精品久久久久久妇女6080 | 日韩精品一区二区三区四区| 久久av资源站| 国产欧美日产一区| 色婷婷综合激情| 午夜影视日本亚洲欧洲精品| 日韩欧美的一区二区| 国产成人精品1024| 亚洲精品国产品国语在线app| 在线视频亚洲一区| 暴力调教一区二区三区| 亚洲精品视频在线| 911精品产国品一二三产区| 国产一区二区在线电影| 国产精品麻豆一区二区| 欧美日韩一区精品| 狠狠狠色丁香婷婷综合久久五月| 国产欧美日韩在线| 欧洲国内综合视频| 蜜臀国产一区二区三区在线播放| 国产午夜精品美女毛片视频| 色偷偷成人一区二区三区91 | 日韩欧美久久一区| 成人18视频日本| 蜜桃视频在线观看一区| 国产精品嫩草影院com| 欧美精品三级日韩久久| 成人性生交大片免费看中文| 一区二区三区免费| 欧美激情综合在线| 337p亚洲精品色噜噜| av成人免费在线观看| 久热成人在线视频| 亚洲一区二区三区小说| 久久精品视频免费| 欧美一级夜夜爽| 91精品福利在线| 成人激情av网| 国产真实精品久久二三区| 亚洲国产毛片aaaaa无费看| 国产精品二三区| 久久综合五月天婷婷伊人| 9191精品国产综合久久久久久| a在线欧美一区| 国产精品原创巨作av| 蜜臀av亚洲一区中文字幕| 亚洲一区在线看| 亚洲人妖av一区二区| 国产欧美视频在线观看| 精品少妇一区二区三区在线播放| 欧美性感一类影片在线播放| 91网站最新网址| 成人午夜精品一区二区三区| 极品尤物av久久免费看| 日本va欧美va瓶| 日韩成人伦理电影在线观看| 亚洲成在人线在线播放| 亚洲人成在线观看一区二区| 国产精品超碰97尤物18| 国产精品污www在线观看| 久久久久久久电影| 国产色一区二区| 欧美激情中文字幕一区二区| 久久久午夜电影| 久久久一区二区| 国产亚洲精品久| 国产人久久人人人人爽| 欧美国产一区视频在线观看| 久久亚洲一级片| 日本一区二区三区国色天香| 国产精品不卡一区二区三区| 国产精品亲子伦对白| 中文字幕中文字幕一区| 亚洲麻豆国产自偷在线| 亚洲综合色婷婷| 日韩二区在线观看| 九色|91porny| 国产99久久久国产精品免费看| 国产成a人无v码亚洲福利| 成人h精品动漫一区二区三区| bt7086福利一区国产| 欧美自拍丝袜亚洲| 91精品国产免费| 国产无遮挡一区二区三区毛片日本| 中文av一区二区| 亚洲成人av一区| 国产在线精品免费av| voyeur盗摄精品| 欧美日韩一区 二区 三区 久久精品| 7777精品伊人久久久大香线蕉完整版 | 奇米色777欧美一区二区| 国产乱国产乱300精品| 菠萝蜜视频在线观看一区| 欧美视频一区二区在线观看| 538在线一区二区精品国产| 久久毛片高清国产| 亚洲免费在线观看视频| 蜜桃精品视频在线| 91色视频在线| 精品奇米国产一区二区三区| 亚洲女厕所小便bbb| 蜜桃视频一区二区三区 | 亚洲丝袜美腿综合|