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

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

?? hal_org.h

?? ZigBee協議棧2.0的程序
?? H
?? 第 1 頁 / 共 5 頁
字號:


#define BAUD_M(baud) (      \
    (baud==2400)   ?  59  : \
    (baud==4800)   ?  59  : \
    (baud==9600)   ?  59  : \
    (baud==14400)  ?  216 : \
    (baud==19200)  ?  59  : \
    (baud==28800)  ?  216 : \
    (baud==38400)  ?  59  : \
    (baud==57600)  ?  216 : \
    (baud==76800)  ?  59  : \
    (baud==115200) ?  216 : \
    (baud==153600) ?  59  : \
    (baud==230400) ?  216 : \
    (baud==307200) ?  59  : \
  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((uart) == 0){                           \
         if(PERCFG & 0x01){                      \
            P1SEL |= 0x30;                       \
         } else {                                \
            P0SEL |= 0x0C;                       \
         }                                       \
      }                                          \
      else {                                     \
         if(PERCFG & 0x02){                      \
            P1SEL |= 0xC0;                       \
         } else {                                \
            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)



//can do this via a macro
#define halSetBaud(baud) UART_SETUP(0, baud, HIGH_STOP);


// 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
#define UART_ENABLE_RECEIVE         0x40


// 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(spi == 0){                                 \
         if(PERCFG & 0x01){                         \
            P1SEL |= 0x3C;                          \
         } else {                                   \
            P0SEL |= 0x3C;                          \
         }                                          \
      }                                             \
      else {                                        \
         if(PERCFG & 0x02){                         \
            P1SEL |= 0xF0;                          \
         } else {                                   \
            P0SEL |= 0x3C;                          \
         }                                          \
      }                                             \
                                                    \
      if(options & SPI_SLAVE){                      \
         U##spi##CSR = 0x20;                        \
      }                                             \
      else {                                        \
         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  = ( 0x2A >> 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.
#define TICKSPD ((CLKCON & 0x38) >> 3)

// Macro for checking status of the crystal oscillator
#define XOSC_STABLE (SLEEP & 0x40)

// Macro for checking status of the high frequency RC oscillator.
#define HIGH_FREQUENCY_RC_OSC_STABLE    (SLEEP & 0x20)


// Macro for setting power mode
#define SET_POWER_MODE(mode)                   \
   do {                                        \
      if(mode == 0)        { SLEEP &= ~0x03; } \
      else if (mode == 3)  { SLEEP |= 0x03;  } \
      else { SLEEP &= ~0x03; SLEEP |= mode;  } \
      PCON |= 0x01;                            \
      asm("NOP");                              \
   }while (0)


// Where _mode_ is one of
#define POWER_MODE_0  0x00  // Clock oscillators on, voltage regulator on
#define POWER_MODE_1  0x01  // 32.768 KHz oscillator on, voltage regulator on
#define POWER_MODE_2  0x02  // 32.768 KHz oscillator on, voltage regulator off
#define POWER_MODE_3  0x03  // All clock oscillators off, voltage regulator off

// Macro for setting the 32 KHz clock source
#define SET_32KHZ_CLOCK_SOURCE(source) \
   do {                                \
      if( source ) {                   \
         CLKCON |= 0x80;               \
      } else {                         \
         CLKCON &= ~0x80;              \
      }                                \
   } while (0)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久三级| 色婷婷综合激情| 欧美区视频在线观看| 亚洲妇女屁股眼交7| 欧美蜜桃一区二区三区| 色婷婷久久久亚洲一区二区三区| 国产伦理精品不卡| 成人欧美一区二区三区| 欧美日韩aaaaaa| 欧美亚洲动漫另类| 亚洲h在线观看| 在线电影国产精品| 国产精品第13页| 亚洲欧洲成人av每日更新| 欧美激情一区二区三区| 色一情一乱一乱一91av| 五月婷婷久久丁香| 欧美专区在线观看一区| 欧美亚洲动漫另类| 污片在线观看一区二区| 欧美日韩成人综合| 亚洲一级在线观看| 日韩午夜电影av| 一本色道久久综合亚洲精品按摩| 成人av在线看| 久久中文字幕电影| 欧美性生活影院| 国产在线播精品第三| 国产91丝袜在线播放| 日韩精品一级二级| 亚洲天堂2016| 国产欧美一区视频| 26uuu亚洲综合色| 中文无字幕一区二区三区 | 亚洲一区二区三区四区中文字幕| 亚洲福利一二三区| 国产精品主播直播| 秋霞国产午夜精品免费视频| 亚洲蜜桃精久久久久久久| 中文字幕免费不卡| 亚洲aⅴ怡春院| 国产高清在线精品| 国产日韩欧美麻豆| 成人av免费在线| 国模大尺度一区二区三区| 五月婷婷另类国产| www.激情成人| 91美女片黄在线| 91免费小视频| 久久久久综合网| 国产精品三级av| 男女激情视频一区| 日本丶国产丶欧美色综合| 日本韩国精品一区二区在线观看| 欧美不卡在线视频| 亚洲精品在线观看视频| 国产三级精品三级| 麻豆精品视频在线观看| 国产精品一区不卡| 欧美一区二区三区四区视频 | 亚洲一区二区av在线| 一区二区成人在线| 在线观看三级视频欧美| 懂色av中文一区二区三区| 欧美日韩免费在线视频| 9191久久久久久久久久久| 99国产精品久久久| 欧美一区二区三区四区高清| 国产人伦精品一区二区| 欧美色偷偷大香| 综合网在线视频| 99久久久久免费精品国产| 欧美国产精品专区| 丁香一区二区三区| 久久久五月婷婷| 免费成人美女在线观看| 欧美一级免费观看| 美女网站一区二区| 欧美不卡123| 国产一区二区三区在线观看免费视频| 91麻豆精品国产自产在线| 日韩高清国产一区在线| 久久99国产精品久久99果冻传媒| 粉嫩久久99精品久久久久久夜| 日韩网站在线看片你懂的| 日韩黄色免费网站| 日韩一区二区视频| 激情成人午夜视频| 色婷婷久久久亚洲一区二区三区| 日韩一区二区在线观看| 国产精品一区二区在线观看网站| 26uuu精品一区二区 | 色婷婷久久久综合中文字幕| 亚洲丝袜精品丝袜在线| 在线视频一区二区三| 五月天视频一区| 制服丝袜国产精品| 国产乱码精品一区二区三区av | 青青青爽久久午夜综合久久午夜| 91麻豆精品91久久久久同性| 久久99国产精品久久99果冻传媒| 国产视频在线观看一区二区三区| 夜色激情一区二区| 欧美日韩免费高清一区色橹橹| 日韩福利视频导航| 国产清纯白嫩初高生在线观看91| 一本久久精品一区二区| 婷婷久久综合九色综合伊人色| 26uuu精品一区二区在线观看| 成人美女在线视频| 久久久久久久精| 99久久伊人网影院| 婷婷六月综合亚洲| 国产精品国产三级国产a| 欧美性猛交xxxx黑人交| 久久爱www久久做| 日韩美一区二区三区| 日本在线不卡视频一二三区| 国产亚洲1区2区3区| 欧美久久一二三四区| 丁香婷婷综合网| 日韩精品每日更新| 亚洲欧洲精品一区二区精品久久久 | 欧美日韩情趣电影| 成人高清视频免费观看| 日韩在线卡一卡二| 国产精品久久一卡二卡| 5月丁香婷婷综合| 91亚洲男人天堂| 国产精品一区久久久久| 视频一区二区三区入口| 18欧美亚洲精品| 久久色在线观看| 777a∨成人精品桃花网| 91小视频免费看| 国产99久久久国产精品潘金| 日本午夜一区二区| 亚洲永久精品大片| 成人免费在线播放视频| 久久久久久综合| 欧美成人a在线| 欧美一区二区精品在线| 欧美最猛性xxxxx直播| 99久久精品免费精品国产| 国产精品一区不卡| 国产一区二区成人久久免费影院 | 亚洲三级在线看| 亚洲韩国一区二区三区| 欧美一区二区三区思思人| 不卡的电影网站| 丰满亚洲少妇av| 国产98色在线|日韩| 国产一区二区三区四区五区美女 | 国产欧美日韩不卡免费| 久久亚洲春色中文字幕久久久| 日韩一卡二卡三卡| 精品国产一区二区精华| 精品久久久久久无| 久久影视一区二区| 中文字幕精品三区| 中文av字幕一区| 亚洲啪啪综合av一区二区三区| 国产精品国产三级国产有无不卡 | 天天色天天操综合| 日韩电影在线看| 玖玖九九国产精品| 精品在线视频一区| 成人少妇影院yyyy| 色哟哟日韩精品| 欧美视频一区在线| 日韩一区二区三区在线视频| 亚洲精品一区二区三区福利| 久久精品免费在线观看| 国产精品乱码久久久久久| 成人欧美一区二区三区小说| 亚洲成av人片一区二区| 久草精品在线观看| 成人深夜福利app| 欧美亚洲国产bt| 久久久久国产一区二区三区四区 | 久久精品欧美一区二区三区不卡| 中文字幕在线观看一区二区| 亚洲视频一区二区免费在线观看| 丝袜美腿亚洲色图| 国产精品一区二区免费不卡| 国产99精品国产| 色综合天天综合色综合av| 亚洲综合自拍偷拍| 亚洲国产视频a| 极品美女销魂一区二区三区| eeuss鲁片一区二区三区在线看| 欧美日精品一区视频| 欧美大白屁股肥臀xxxxxx| 日本一区二区三区高清不卡| 亚洲国产aⅴ成人精品无吗| 国产一区视频网站| 欧美伦理电影网| 国产精品免费免费| 免费看黄色91| 欧美视频在线观看一区|