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

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

?? hal.h

?? 本代碼 實現了 zigbee協議的物理層與MAC層
?? H
?? 第 1 頁 / 共 5 頁
字號:

   TIMERx_INIT();
   BOOL halSetTimerxPeriod(period);
   TIMERx_RUN(TRUE);

where x is the timer number. Please see the function / macro in question for
details.

All timers can generate interrupts. The configuration of interrupts is not
included in the HAL.

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


/******************************************************************************
* @fn  halSetTimer1Period
*
* @brief
*      This function sets up timer 1 to run with a given period. If _period_ is
*      set to 0, maximum period length will be used. The first time the timer
*      is used the macro TIMER1_INIT() should be run to clear all settings. The
*      timer is started and stopped with the macro TIMER1_RUN(TRUE / FALSE).
*
* Parameters:
*
* @param  DWORD	 period
*         The desired timer period in u-seconds.
*
* @return WORD
*         The timer value written to the register if the configuration was
*         successful and 0 if the period could not be achieved. This return
*         value can be used for determining pulse widths when the timer is
*         used in PWM mode.
*
******************************************************************************/
WORD halSetTimer1Period(DWORD period);


// Macro for initialising timer 1. Resets all involved registers and disables
// all interrupt masks.
#define TIMER1_INIT()   \
   do {                 \
      T1CTL  = 0x00;    \
      T1CCTL0 = 0x00;   \
      T1CCTL1 = 0x00;   \
      T1CCTL2 = 0x00;   \
      TIMIF &= ~0x40;   \
   } while (0)

// Macro for configuring a channel of timer 1 for PWM. Channel may be
// either 1 or 2.
#define TIMER1_PWM_CONFIG(channel)               \
   do {                                          \
      T1CCTL##channel## = 0x24;                  \
      if(PERCFG&0x40) {                          \
         if(channel == 0x01){                    \
            IO_FUNC_PORT_PIN(1,1,IO_FUNC_PERIPH);\
         }                                       \
         else {                                  \
            IO_FUNC_PORT_PIN(1,0,IO_FUNC_PERIPH);\
         }                                       \
      }                                          \
      else {                                     \
         if(channel == 0x01){                    \
            IO_FUNC_PORT_PIN(0,3,IO_FUNC_PERIPH);\
         }                                       \
         else {                                  \
            IO_FUNC_PORT_PIN(0,4,IO_FUNC_PERIPH);\
         }                                       \
      }                                          \
   } while(0)

// Macro for changing the pulse length of a timer in PWM mode. The value is
// not scaled and the user must verify that it is correct. _channel_ is the
// channel (1 or 2) configured for PWM operation, whereas _value_ is the
// 16 bit word giving the pulse length. This argument should be shorter than
// or equal to the value returned from the function halSetTimer1Period(...).
#define TIMER1_SET_PWM_PULSE_LENGTH(channel, value) \
   do {                                             \
      T1CC##channel##L = (BYTE)value;               \
      T1CC##channel##H = (BYTE)(value >> 8);        \
   } while(0)


// Macro for configuring a channel of timer 1 for capture.
#define TIMER1_CAPTURE_CHANNEL(channel, edge)      \
   do {                                            \
      T1CCTL ##channel = edge;                     \
      if(PERCFG&0x40) {                            \
         if(channel == 0x01){                      \
            IO_FUNC_PORT_PIN(1,1,IO_FUNC_PERIPH);  \
         }                                         \
         else {                                    \
            IO_FUNC_PORT_PIN(1,0,IO_FUNC_PERIPH);  \
         }                                         \
      }                                            \
      else {                                       \
         if(channel == 0x01){                      \
            IO_FUNC_PORT_PIN(0,3,IO_FUNC_PERIPH);  \
         }                                         \
         else {                                    \
            IO_FUNC_PORT_PIN(0,4,IO_FUNC_PERIPH);  \
         }                                         \
      }                                            \
   } while(0)

// Where _edge_ is either
#define POS_EDGE 0x01  // Capture when a positive edge on the channel input is detected
#define NEG_EDGE 0x02  // Capture when a negative edge on the channel input is detected
#define ANY_EDGE 0x03  // Capture when either a positive or a negative edge on the
                       // channel input is detected.

// Macro for enabling or disabling overflow interrupts of timer 1.
#define TIMER1_ENABLE_OVERFLOW_INT(val) \
   (TIMIF =  (val) ? TIMIF | 0x40 : TIMIF & ~0x40)


/******************************************************************************
* @fn  halSetTimer2Period
*
* @brief
*      This function sets the period and overflow counter value of the MAC timer
*      (timer 2). The timer can be set up with 320 u-second periods according to
*      IEEE 802.15.4 or as a normal counter with 1 m-second period by using the
*      option TIMER2_MAC_TIMER or TIMER2_NORMAL_TIMER respectively. The value of
*      _period_ gives the number of periods (320 u-seconds or 1 m-seconds) to
*      generate a compare event. The timer is set up to compensate for any clock
*      division. The timer is also set up to be synchronised with the 32.768 KHz
*      clock when entering or leaving power mode 0. When starting synchronously
*      from power mode 1 or 2, the timer value is updated by adding the time
*      passed since PM 0 was left. This time is kept by the 32.768 KHz clock.
*      This way the time is kept as if the chip had been in power mode 0 the
*      whole time. The timer must be started with the macro
*      TIMER2_RUN(TRUE) or MAC_TIMER_RUN(TRUE). The macro TIMER2_INIT() should be
*      run in advance to reset all register values.
*
* Parameters:
*
* @param  BYTE	 mode
*         Determines which time period Timer 2 is to use. The period of Timer 2
*         is either 320 u-seconds (TIMER2_MAC_TIMER) or 1 m-second
*         (TIMER2_NORMAL_TIMER).
* @param  DWORD	 period
*         This value indicates how many periods (320 u-second or 1 m-second) to
*         pass before an overflow compare event is generated.
*
* @return BOOL
          Returns 0 if period is too large, 1 otherwise.
*
******************************************************************************/
BOOL halSetTimer2Period(BYTE mode, DWORD period);

// _options_ may be of the following:
#define TIMER2_MAC_TIMER    0x01  // Counts 320 u-second periods
#define TIMER2_NORMAL_TIMER 0x02  // Uses the timer as a normal timer with 1 m-second period.

// Macro for initialising timer 2
#define TIMER2_INIT()  \
   do {                \
      T2THD = 0x00;    \
      T2TLD = 0x00;    \
      T2CMP = 0x00;    \
      T2OF0 = 0x00;    \
      T2OF1 = 0x00;    \
      T2OF2 = 0x00;    \
      T2CAPHPH = 0x00; \
      T2CAPLPL = 0x00; \
      T2PEROF0 = 0x00; \
      T2PEROF1 = 0x00; \
      T2PEROF2 = 0x00; \
      T2CNF = 0x06;    \
   } while (0)

#define TIMER2_ENABLE_OVERFLOW_COMP_INT(val) (T2PEROF2 =  (val) ? T2PEROF2 | 0x20 : T2PEROF2 & ~0x20)


/******************************************************************************
* @fn  halSetTimer34Period
*
* @brief
*      This function sets the period of timer 3 or 4 according to the value of
*      _timer_. The two timers are identical. Clock division is used to fit the
*      desired period within the timer range. If the period is too short or too
*      long the function returns 0. If the period is successfully set, the
*      function returns the BYTE value written to the timer register. This
*      value can be used to set the pulse length if the timer is used for PWM.
*      If _period_ is set to 0, maximum timeout value will be used.
*
* Parameters:
*
* @param  BYTE	 timer
*         Indicates which timer to configure. Must be either 3 or 4
*         (0x03 or 0x04).
* @param  DWORD	 period - Describe value.
*         The desired period in microseconds.
*
* @return BYTE
*         The value written to the TxCC0 register. The timer is incremented up
*         to this value before the timer is reset. This value may be used to
*         set the pulse length in PWM mode.
*
******************************************************************************/
BYTE halSetTimer34Period(BYTE timer, DWORD period);
// Where _timer_ must be either 3 or 4

// Macro for initialising timer 3 or 4
#define TIMER34_INIT(timer)   \
   do {                       \
      T##timer##CTL   = 0x06; \
      T##timer##CCTL0 = 0x00; \
      T##timer##CC0   = 0x00; \
      T##timer##CCTL1 = 0x00; \
      T##timer##CC1   = 0x00; \
   } while (0)

//Macro for enabling overflow interrupt
#define TIMER34_ENABLE_OVERFLOW_INT(timer,val) \
   (T##timer##CTL =  (val) ? T##timer##CTL | 0x08 : T##timer##CTL & ~0x08)



// Macro for configuring channel 1 of timer 3 or 4 for PWM mode.
#define TIMER34_PWM_CONFIG(timer)                 \
   do{                                            \
      T##timer##CCTL1 = 0x24;                     \
      if(timer == 3){                             \
         if(PERCFG & 0x20) {                      \
            IO_FUNC_PORT_PIN(1,7,IO_FUNC_PERIPH); \
         }                                        \
         else {                                   \
            IO_FUNC_PORT_PIN(1,4,IO_FUNC_PERIPH); \
         }                                        \
      }                                           \
      else {                                      \
         if(PERCFG & 0x10) {                      \
             IO_FUNC_PORT_PIN(2,3,IO_FUNC_PERIPH);\
         }                                        \
         else {                                   \
            IO_FUNC_PORT_PIN(1,1,IO_FUNC_PERIPH); \
         }                                        \
      }                                           \
   } while(0)

// Macro for setting pulse length of the timer in PWM mode
#define TIMER34_SET_PWM_PULSE_LENGTH(timer, value) \
   do {                                            \
      T##timer##CC1 = (BYTE)value;                 \
   } while (0)


// Macro for setting timer 3 or 4 as a capture timer
#define TIMER34_CAPTURE_TIMER(timer,edge)          \
   do{                                             \
      T##timer##CCTL1 = edge;                      \
      if(timer == 3){                              \
         if(PERCFG & 0x20) {                       \
            IO_FUNC_PORT_PIN(1,7,IO_FUNC_PERIPH);  \
         }                                         \
         else {                                    \
             IO_FUNC_PORT_PIN(1,4,IO_FUNC_PERIPH); \
         }                                         \
      }                                            \
      else {                                       \
         if(PERCFG & 0x10) {                       \
            IO_FUNC_PORT_PIN(2,3,IO_FUNC_PERIPH);  \
         }                                         \
        else {                                     \
           IO_FUNC_PORT_PIN(1,1,IO_FUNC_PERIPH);   \
        }                                          \
     }                                             \
  }while(0)


// Macros for turning timers on or off
#define TIMER1_RUN(value)      (T1CTL = (value) ? T1CTL|0x02 : T1CTL&~0x03)
#define TIMER2_RUN(value)      (T2CNF  = (value) ? T2CNF|0x01  : T2CNF&~0x01)
#define MAC_TIMER_RUN(value)   do{ TIMER2_RUN(value); }while(0)  //MAC-timer == timer 2
#define TIMER3_RUN(value)      (T3CTL = (value) ? T3CTL|0x10 : T3CTL&~0x10)
#define TIMER4_RUN(value)      (T4CTL = (value) ? T4CTL|0x10 : T4CTL&~0x10)

// Macro for enabling/ disabling interrupts from the channels of timer 1, 3 or 4.
#define TIMER_CHANNEL_INTERRUPT_ENABLE(timer, channel, value) \
   do{                                                        \
      if(value){                                              \
         T##timer##CCTL##channel## |= 0x40;                   \
      } else {                                                \
         T##timer##CCTL##channel## &= ~0x40;                  \
      }                                                       \
   } while(0)



/******************************************************************************
*******************          Watch Dog Timer (WDT)          *******************
*******************************************************************************

The WDT may be used to prevent the unit from being trapped in a system
stalemate, i.e. an endless waiting state. The WDT must be reset before it times
out. If a timeout occurs, the system is reset.

The WDT can also be configured as a normal timer which generates interrupt at
each timeout. This must be configured manually.
******************************************************************************/

// Macro for setting the WDT timeout interval.
#define WDT_SET_TIMEOUT_PERIOD(timeout) \
   do {  WDCTL &= ~0x03; WDCTL |= timeout; } while (0)

// Where _timeout_ is one of
#define SEC_1          0x00     // after 1 second
#define M_SEC_250      0x01     // after 250 ms
#define M_SEC_15       0x02     // after 15 ms
#define M_SEC_2        0x03     // after 2 ms

// Macro for resetting the WDT. If this is not done before the WDT times out,
// the system is reset.
#define WDT_RESET() do {           \
   WDCTL = (WDCTL & ~0xF0) | 0xA0; \
   WDCTL = (WDCTL & ~0xF0) | 0x50; \
} while (0)

// Macro for turning on the WDT
#define WDT_ENABLE()   WDCTL |= 0x08
#define WDT_DISABLE()  WDCTL &= ~0x08

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆专区一区二区三区四区五区| 另类小说一区二区三区| 日韩欧美美女一区二区三区| 成人av片在线观看| 久久国产夜色精品鲁鲁99| 亚洲美女免费视频| 中文字幕av一区二区三区| 在线播放一区二区三区| 91丨porny丨中文| 国产91综合网| 国产专区综合网| 天堂成人国产精品一区| 亚洲男同性恋视频| 中文字幕在线观看一区二区| 久久蜜桃香蕉精品一区二区三区| 欧美精品777| 欧美日韩精品二区第二页| 99re视频精品| av电影一区二区| 国产成人精品免费视频网站| 精品一区二区三区蜜桃| 免费不卡在线视频| 石原莉奈一区二区三区在线观看| 综合在线观看色| 综合欧美亚洲日本| 国产精品国产三级国产aⅴ无密码| 久久久久久久久久看片| 久久久久久久av麻豆果冻| 欧美变态tickling挠脚心| 欧美一级在线免费| 日韩免费高清视频| 日韩视频一区二区三区在线播放 | 香蕉加勒比综合久久| 亚洲女人****多毛耸耸8| 国产精品久久久久久久久免费相片| 国产亚洲精品免费| 亚洲国产精华液网站w| 国产精品全国免费观看高清| 中文乱码免费一区二区| 国产精品国产精品国产专区不片| 国产精品天美传媒| 中文字幕中文字幕在线一区| 综合自拍亚洲综合图不卡区| 亚洲精品网站在线观看| 亚洲免费av高清| 亚洲午夜日本在线观看| 婷婷激情综合网| 欧美日本一区二区三区四区| 欧美日韩国产另类不卡| 9191国产精品| 日韩三级免费观看| 国产视频一区二区三区在线观看| 中文字幕在线一区免费| 亚洲乱码国产乱码精品精可以看 | 欧美高清www午色夜在线视频| 欧美一区二区免费视频| www国产成人| 国产精品不卡一区二区三区| 一区二区三区精品在线| 免费看日韩精品| 国产一级精品在线| 色哦色哦哦色天天综合| 91麻豆精品国产无毒不卡在线观看| 日韩欧美一级二级三级久久久| 久久免费午夜影院| 亚洲免费av观看| 美女脱光内衣内裤视频久久网站 | www.欧美.com| 欧美日韩免费不卡视频一区二区三区| 日韩一区二区三区三四区视频在线观看| www国产成人免费观看视频 深夜成人网| 国产精品视频一二三区| 亚洲成a人片在线观看中文| 九九精品视频在线看| 99精品热视频| 日韩欧美专区在线| 中文字幕视频一区二区三区久| 天堂成人免费av电影一区| 国产精品一区二区免费不卡| 欧美揉bbbbb揉bbbbb| 精品国产乱码久久久久久牛牛| 国产精品对白交换视频| 免费欧美日韩国产三级电影| 99re在线视频这里只有精品| 日韩一区二区三区观看| 亚洲日本乱码在线观看| 九九九精品视频| 在线视频欧美区| 国产日韩一级二级三级| 婷婷丁香激情综合| 94色蜜桃网一区二区三区| 精品三级在线看| 亚洲国产日韩a在线播放性色| 国产精品综合久久| 91精品国产aⅴ一区二区| 亚洲欧洲日韩女同| 国产在线播精品第三| 777xxx欧美| 亚洲永久免费av| 99久久精品国产毛片| 亚洲精品一区二区三区影院| 亚洲一卡二卡三卡四卡无卡久久 | 91精品国产综合久久精品性色| 国产精品家庭影院| 国产成人日日夜夜| 精品国产免费一区二区三区四区| 亚洲va欧美va人人爽| aaa国产一区| 国产网站一区二区| 精品亚洲国内自在自线福利| 欧美日韩亚洲丝袜制服| 亚洲人一二三区| 成人妖精视频yjsp地址| 久久久综合网站| 国内精品视频一区二区三区八戒| 欧美一区二区三区播放老司机| 一区二区三区精密机械公司| 色综合久久综合网97色综合| 国产精品久久久爽爽爽麻豆色哟哟| 精一区二区三区| 精品日产卡一卡二卡麻豆| 六月丁香婷婷久久| 日韩丝袜美女视频| 久久精品99国产国产精| 日韩精品一区二区三区中文不卡| 午夜精品福利一区二区三区蜜桃| 欧美日韩精品一区二区三区| 性久久久久久久久| 4438x成人网最大色成网站| 日韩高清欧美激情| 91麻豆精品国产综合久久久久久| 午夜免费欧美电影| 56国语精品自产拍在线观看| 蜜臀av亚洲一区中文字幕| 欧美一区二区久久久| 理论片日本一区| 久久久精品日韩欧美| 国产精品亚洲а∨天堂免在线| 日本一区二区三区高清不卡| voyeur盗摄精品| 一区二区三区影院| 欧美日韩在线亚洲一区蜜芽| 午夜av一区二区三区| 欧美理论在线播放| 蜜桃91丨九色丨蝌蚪91桃色| 精品久久久久久久一区二区蜜臀| 国产一区二区三区av电影| 亚洲国产高清在线| 色综合欧美在线视频区| 天堂精品中文字幕在线| 欧美精品一区视频| av不卡在线播放| 日日摸夜夜添夜夜添亚洲女人| 日韩一区二区三区在线| 国产精品一品视频| 日韩毛片视频在线看| 欧美人妇做爰xxxⅹ性高电影 | 首页综合国产亚洲丝袜| 91精品国产91综合久久蜜臀| 国产成人日日夜夜| 一区二区三区中文字幕精品精品| 欧美精品在线观看播放| 国产一区二区三区蝌蚪| 亚洲色图在线看| 欧美一级一区二区| 岛国一区二区三区| 亚洲一区二区三区三| 久久一日本道色综合| 色一区在线观看| 极品美女销魂一区二区三区| 亚洲欧美综合色| 欧美一区二区三区视频在线| 粉嫩一区二区三区性色av| 亚洲国产综合色| 国产欧美一区在线| 欧美日韩一级视频| 国产成a人亚洲精| 日韩黄色免费电影| 亚洲国产精品av| 欧美高清性hdvideosex| 国产成人精品免费在线| 三级久久三级久久久| 中文字幕在线视频一区| 日韩一级免费观看| 色综合咪咪久久| 国产一区二区三区免费看| 亚洲大片精品永久免费| 中文子幕无线码一区tr| 欧美精品免费视频| 99视频精品全部免费在线| 久久精品国产在热久久| 亚洲精品网站在线观看| 国产日韩欧美精品在线| 4438成人网| 欧美最猛性xxxxx直播| 国产99久久久国产精品潘金| 日本91福利区| 亚洲国产wwwccc36天堂| 国产精品国产三级国产aⅴ入口| 欧美成人福利视频|