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

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

?? hal.h

?? 關于ZIGBEE的文章 有興趣可以
?? H
?? 第 1 頁 / 共 3 頁
字號:
/*
  V0.1 Initial Release   10/July/2006

*/

/*
Original hal.h file from Chipcon for CC2430 modified to include
only the functions needed by this stack and test code

*/



/******************************************************************************
*                                                                             *
*        **********                                                           *
*       ************                                                          *
*      ***        ***                                                         *
*     ***    ++    ***                                                        *
*     ***   +  +   ***                      CHIPCON                           *
*     ***   +                                                                 *
*     ***   +  +   ***                                                        *
*     ***    ++    ***                                                        *
*      ***        ***                                                         *
*       ************                                                          *
*        **********                                                           *
*                                                                             *
*******************************************************************************

Filename:     hal.h
Target:       cc2430
Author:       EFU/ KJA
Revised:      16/12-2005
Revision:     1.0

Description:
Hardware Abstraction Layer - Utility Library for CC2430, CC2431, CC1110 and CC2510.

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

#ifndef HAL_H
#define HAL_H
#include <stdio.h>
#include <string.h>
#include "compiler.h"
#include "ioCC2430.h"
#include "lrwpan_config.h"         //user configurations
#include "lrwpan_common_types.h"   //types common acrosss most files


//-----------------------------------------------------------------------------
// Common values
#ifndef FALSE
   #define FALSE 0
#endif

#ifndef TRUE
   #define TRUE 1
#endif

#ifndef NULL
   #define NULL 0
#endif

#ifndef HIGH
   #define HIGH 1
#endif

#ifndef LOW
   #define LOW 0
#endif

#define halIdle()              //do nothing in idle state

// Macros for configuring IO peripheral location:
// Example usage:
//   IO_PER_LOC_TIMER1_AT_PORT0_PIN234();
//   IO_PER_LOC_TIMER4_AT_PORT2_PIN03();
//   IO_PER_LOC_USART1_AT_PORT0_PIN2345();

#define IO_PER_LOC_TIMER1_AT_PORT0_PIN234() do { PERCFG = (PERCFG&~0x40)|0x00; } while (0)
#define IO_PER_LOC_TIMER1_AT_PORT1_PIN012() do { PERCFG = (PERCFG&~0x40)|0x40; } while (0)

#define IO_PER_LOC_TIMER3_AT_PORT1_PIN34()  do { PERCFG = (PERCFG&~0x20)|0x00; } while (0)
#define IO_PER_LOC_TIMER3_AT_PORT1_PIN67()  do { PERCFG = (PERCFG&~0x20)|0x20; } while (0)

#define IO_PER_LOC_TIMER4_AT_PORT1_PIN01()  do { PERCFG = (PERCFG&~0x10)|0x00; } while (0)
#define IO_PER_LOC_TIMER4_AT_PORT2_PIN03()  do { PERCFG = (PERCFG&~0x10)|0x10; } while (0)

#define IO_PER_LOC_SPI1_AT_PORT0_PIN2345()  do { PERCFG = (PERCFG&~0x08)|0x00; } while (0)
#define IO_PER_LOC_SPI1_AT_PORT1_PIN4567()  do { PERCFG = (PERCFG&~0x08)|0x08; } while (0)

#define IO_PER_LOC_SPI0_AT_PORT0_PIN2345()  do { PERCFG = (PERCFG&~0x04)|0x00; } while (0)
#define IO_PER_LOC_SPI0_AT_PORT1_PIN2345()  do { PERCFG = (PERCFG&~0x04)|0x04; } while (0)

#define IO_PER_LOC_UART1_AT_PORT0_PIN2345() do { PERCFG = (PERCFG&~0x02)|0x00; } while (0)
#define IO_PER_LOC_UART1_AT_PORT1_PIN4567() do { PERCFG = (PERCFG&~0x02)|0x02; } while (0)

#define IO_PER_LOC_UART0_AT_PORT0_PIN2345() do { PERCFG = (PERCFG&~0x01)|0x00; } while (0)
#define IO_PER_LOC_UART0_AT_PORT1_PIN2345() do { PERCFG = (PERCFG&~0x01)|0x01; } while (0)


// Actual MCU pin configuration:
//
// Peripheral I/O signal     Alt1       Alt2
// -------------------------------------------
// Timer1 channel0           P0.2       P1.2
// Timer1 channel1           P0.3       P1.1
// Timer1 channel2           P0.4       P1.0
// Timer3 channel0           P1.3       P1.6
// Timer3 channel1           P1.4       P1.7
// Timer4 channel0           P1.0       P2.0
// Timer4 channel1           P1.1       P2.3
// USART0 TXD/MOSI           P0.3       P1.5
// USART0 RXD/MISO           P0.2       P1.4
// USART0 RTS/SCK            P0.5       P1.3
// USART0 CTS/SS_N           P0.4       P1.2
// USART1 TXD/MOSI           P0.4       P1.6
// USART1 RXD/MISO           P0.5       P1.7
// USART1 RTS/SCK            P0.3       P1.5
// USART1 CTS/SS_N           P0.2       P1.4

// Macros for configuring IO direction:
// Example usage:
//   IO_DIR_PORT_PIN(0, 3, IO_IN);    // Set P0_3 to input
//   IO_DIR_PORT_PIN(2, 1, IO_OUT);   // Set P2_1 to output

#define IO_DIR_PORT_PIN(port, pin, dir)  \
   do {                                  \
      if (dir == IO_OUT)                 \
         P##port##DIR |= (0x01<<(pin));  \
      else                               \
         P##port##DIR &= ~(0x01<<(pin)); \
   }while(0)

// Where port={0,1,2}, pin={0,..,7} and dir is one of:
#define IO_IN   0
#define IO_OUT  1

// Macros for configuring IO input mode:
// Example usage:
//   IO_IMODE_PORT_PIN(0,0,IO_IMODE_PUD);
//   IO_IMODE_PORT_PIN(2,0,IO_IMODE_TRI);
//   IO_IMODE_PORT_PIN(1,3,IO_IMODE_PUD);

#define IO_IMODE_PORT_PIN(port, pin, imode) \
   do {                                     \
      if (imode == IO_IMODE_TRI)            \
         P##port##INP |= (0x01<<(pin));     \
      else                                  \
         P##port##INP &= ~(0x01<<(pin));    \
   } while (0)

// where imode is one of:
#define IO_IMODE_PUD  0 // Pull-up/pull-down
#define IO_IMODE_TRI  1 // Tristate

// Macro for configuring IO drive mode:
// Example usage:
//   IIO_PUD_PORT(0, IO_PULLUP);
//   IIO_PUD_PORT(1, IO_PULLDOWN);
//   IIO_PUD_PORT(2, IO_PULLUP);

#define IO_PUD_PORT(port, pud)        \
   do {                               \
      if (pud == IO_PULLDOWN)         \
         P2INP |= (0x01 << (port+5)); \
      else                            \
         P2INP &= ~(0x01 << (port+5));\
   } while (0)

#define IO_PULLUP          0
#define IO_PULLDOWN        1

// Macros for function select (General purpose I/O / Peripheral function):
// Example usage:
//   IO_FUNC_PORT0_PIN0(0, 0, IO_FUNC_PERIPH);
//   IO_FUNC_PORT0_PIN1(0, 1, IO_FUNC_GIO);
//   IO_FUNC_PORT2_PIN3(2, 3, IO_FUNC_PERIPH);

#define IO_FUNC_PORT_PIN(port, pin, func)  \
   do {                                    \
      if((port == 2) && (pin == 3)){       \
         if (func) {                       \
            P2SEL |= 0x02;                 \
         } else {                          \
            P2SEL &= ~0x02;                \
         }                                 \
      }                                    \
      else if((port == 2) && (pin == 4)){  \
         if (func) {                       \
            P2SEL |= 0x04;                 \
         } else {                          \
            P2SEL &= ~0x04;                \
         }                                 \
      }                                    \
      else{                                \
         if (func) {                       \
            P##port##SEL |= (0x01<<(pin)); \
         } else {                          \
            P##port##SEL &= ~(0x01<<(pin));\
        }                                  \
      }                                    \
   } while (0)

// where func is one of:
#define IO_FUNC_GIO     0 // General purpose I/O
#define IO_FUNC_PERIPH  1 // Peripheral function

// Macros for configuring the ADC input:
// Example usage:
//   IO_ADC_PORT0_PIN(0, IO_ADC_EN);
//   IO_ADC_PORT0_PIN(4, IO_ADC_DIS);
//   IO_ADC_PORT0_PIN(6, IO_ADC_EN);

#define IO_ADC_PORT0_PIN(pin, adcEn) \
   do {                              \
      if (adcEn)                     \
         ADCCFG |= (0x01<<pin);      \
      else                           \
         ADCCFG &= ~(0x01<<pin); }   \
   while (0)

// where adcEn is one of:
#define IO_ADC_EN           1 // ADC input enabled
#define IO_ADC_DIS          0 // ADC input disab

//from ChipCon
//#define CC2430_FLASH_SIZE 32
//#define CC2430_FLASH_SIZE 64
#define CC2430_FLASH_SIZE 128

#if (CC2430_FLASH_SIZE == 32)
#define IEEE_ADDRESS_ARRAY 0x7FF8
#elif (CC2430_FLASH_SIZE == 64) || (CC2430_FLASH_SIZE == 128)
#define IEEE_ADDRESS_ARRAY 0xFFF8
#endif


#define HAL_SUSPEND(x)         //dummy in uC, only needed for Win32

//Timer Support
//For the CC2430, we set the timer to exactly 1 tick per symbol
//assuming a clock frequency of 32MHZ, and 2.4GHz
#define SYMBOLS_PER_MAC_TICK()     1
#define SYMBOLS_TO_MACTICKS(x) (x/SYMBOLS_PER_MAC_TICK())   //every
#define MSECS_TO_MACTICKS(x)   (x*(LRWPAN_SYMBOLS_PER_SECOND/1000))
#define MACTIMER_MAX_VALUE 0x000FFFFF   //20 bit counter
#define halMACTimerNowDelta(x) ((halGetMACTimer()-(x))& MACTIMER_MAX_VALUE)
#define halMACTimerDelta(x,y) ((x-(y))& MACTIMER_MAX_VALUE)

/******************************************************************************
*******************       Interrupt functions/macros        *******************
******************************************************************************/

// Macros which simplify access to interrupt enables, interrupt flags and
// interrupt priorities. Increases code legibility.

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

#define INT_ON   1
#define INT_OFF  0
#define INT_SET  1
#define INT_CLR  0

// Global interrupt enables
#define INT_GLOBAL_ENABLE(on) EA=(!!on)
#define SAVE_AND_DISABLE_GLOBAL_INTERRUPT(x) {x=EA;EA=0;}
#define RESTORE_GLOBAL_INTERRUPT(x) EA=x
#define ENABLE_GLOBAL_INTERRUPT() INT_GLOBAL_ENABLE(INT_ON)
#define DISABLE_GLOBAL_INTERRUPT() INT_GLOBAL_ENABLE(INT_OFF)

#define DISABLE_ALL_INTERRUPTS() (IEN0 = IEN1 = IEN2 = 0x00)

#define INUM_RFERR 0
#define INUM_ADC   1
#define INUM_URX0  2
#define INUM_URX1  3
#define INUM_ENC   4
#define INUM_ST    5
#define INUM_P2INT 6
#define INUM_UTX0  7
#define INUM_DMA   8
#define INUM_T1    9
#define INUM_T2    10

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人丝袜高跟foot| 欧美系列日韩一区| 欧美日韩午夜影院| 久久精品亚洲精品国产欧美 | 久久 天天综合| 色香蕉久久蜜桃| 国产日韩欧美麻豆| 免费在线欧美视频| 欧美在线播放高清精品| 精品久久99ma| 五月开心婷婷久久| 日本高清视频一区二区| 国产精品亲子伦对白| 久久se这里有精品| 欧美日韩精品一区二区| 亚洲欧洲韩国日本视频| 国产高清无密码一区二区三区| 91农村精品一区二区在线| 26uuu国产电影一区二区| 日韩高清电影一区| 欧美日韩精品一区二区| 亚洲蜜臀av乱码久久精品蜜桃| 国产精品自拍网站| 久久久亚洲午夜电影| 蜜乳av一区二区| 欧美一区二区三区免费在线看| 亚洲国产sm捆绑调教视频| 色天使久久综合网天天| 日韩一区中文字幕| 91香蕉视频在线| 亚洲欧美日韩国产手机在线| 国产成人综合在线| 国产精品欧美一区二区三区| 成人综合激情网| 国产精品婷婷午夜在线观看| 懂色av一区二区三区免费观看 | 在线亚洲一区二区| 亚洲男女毛片无遮挡| 成a人片亚洲日本久久| 国产精品网站一区| 99国产精品久久久久久久久久 | 青青草国产精品亚洲专区无| 欧美男人的天堂一二区| 日韩国产高清在线| 日韩欧美三级在线| 国产高清一区日本| 亚洲视频电影在线| 欧美日韩国产高清一区| 秋霞午夜av一区二区三区| 欧美成人一区二区三区片免费 | 精品福利在线导航| 成人综合激情网| 亚洲精品v日韩精品| 欧美人与禽zozo性伦| 精品一区二区日韩| 国产精品久久看| 欧美午夜精品久久久久久孕妇 | 亚洲成人一区二区在线观看| 欧美裸体bbwbbwbbw| 精品在线播放午夜| 国产精品视频第一区| 欧美色综合久久| 经典一区二区三区| 亚洲欧美激情小说另类| 欧美美女网站色| 成人一级视频在线观看| 亚洲一区在线观看免费观看电影高清| 欧美日韩一区二区三区在线看| 麻豆精品在线看| 国产精品伦理在线| 91精品国产综合久久久蜜臀图片 | 国产喂奶挤奶一区二区三区| 99精品热视频| 免费成人小视频| 中文字幕一区av| 欧美一级欧美一级在线播放| 成人黄色免费短视频| 亚洲6080在线| 国产精品久久久久久久浪潮网站| 欧洲一区二区av| 国精品**一区二区三区在线蜜桃| 亚洲激情av在线| 国产亚洲福利社区一区| 欧美三级一区二区| 成人精品鲁一区一区二区| 调教+趴+乳夹+国产+精品| 国产精品免费网站在线观看| 69堂成人精品免费视频| eeuss鲁片一区二区三区在线观看| 日韩在线a电影| 亚洲天堂精品在线观看| 久久久影院官网| 日韩午夜中文字幕| 欧美日韩一区视频| 91黄色小视频| 国产99久久精品| 国模少妇一区二区三区| 三级不卡在线观看| 亚洲欧美日本在线| 国产精品久久久久久久久搜平片| 欧美电视剧在线观看完整版| 欧美无砖砖区免费| 色综合久久66| 99精品热视频| 91影院在线免费观看| 成人亚洲一区二区一| 国产在线一区观看| 久久99久久精品| 男女视频一区二区| 日韩和欧美一区二区| 一区二区三区**美女毛片| 中文字幕一区二区三中文字幕| 久久精品一区二区三区不卡牛牛| 日韩一卡二卡三卡国产欧美| 在线播放91灌醉迷j高跟美女| 欧美日韩中文精品| 欧美人妇做爰xxxⅹ性高电影| 91国偷自产一区二区三区观看 | 亚洲一级二级在线| 亚洲第四色夜色| 亚洲r级在线视频| 日韩精品三区四区| 日韩av电影天堂| 久久精品国产第一区二区三区| 免费一区二区视频| 韩国v欧美v亚洲v日本v| 国内精品在线播放| 成人免费电影视频| 色综合天天做天天爱| 91精品国产综合久久福利软件| 欧美三级一区二区| 日韩免费一区二区三区在线播放| 欧美成人vr18sexvr| 精品伦理精品一区| 国产精品卡一卡二| 亚洲一卡二卡三卡四卡无卡久久| 五月婷婷激情综合网| 激情综合网最新| 成人午夜av影视| 91首页免费视频| 欧美狂野另类xxxxoooo| 精品对白一区国产伦| 亚洲国产精品v| 亚洲主播在线播放| 精品一区二区三区av| 成人网男人的天堂| 欧美精品tushy高清| 久久久久9999亚洲精品| 樱花草国产18久久久久| 美国毛片一区二区| 91丝袜美腿高跟国产极品老师 | 3atv一区二区三区| 久久在线免费观看| 亚洲激情五月婷婷| 久草在线在线精品观看| 99久久精品国产观看| 欧美图片一区二区三区| wwwwww.欧美系列| 亚洲女同ⅹxx女同tv| 蜜乳av一区二区| 色av一区二区| 国产亚洲短视频| 偷拍日韩校园综合在线| av不卡在线观看| 欧美一区2区视频在线观看| 国产精品成人在线观看| 美女视频一区二区| 在线欧美日韩精品| 国产欧美va欧美不卡在线 | 国产精品人成在线观看免费| 视频一区二区三区中文字幕| 国产99久久久国产精品潘金网站| 91精品国产综合久久久久久久| 国产精品福利影院| 激情五月播播久久久精品| 欧美三级视频在线观看| 一色屋精品亚洲香蕉网站| 激情成人综合网| 9191国产精品| 亚洲成人av资源| 色av一区二区| 亚洲特级片在线| av电影天堂一区二区在线| 久久亚洲精华国产精华液| 亚洲成人免费在线观看| 97精品久久久久中文字幕| 国产精品麻豆欧美日韩ww| 国产电影一区二区三区| 日韩免费观看2025年上映的电影| 亚洲成国产人片在线观看| 色婷婷精品大在线视频| 一区二区三区四区蜜桃| 91麻豆免费视频| 国产精品高清亚洲| 成人av资源站| ...av二区三区久久精品| 粉嫩av一区二区三区在线播放| 久久久久国产精品人| 国产精品一区三区| 久久久久久久久岛国免费|