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

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

?? hal.h

?? zigbee無線網絡源碼包
?? 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一区二区三区免费野_久草精品视频
91精品国产一区二区| 国产日产欧美一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲欧美一区二区三区久本道91| 自拍偷拍亚洲综合| 亚洲免费观看高清| 亚洲一区二区欧美日韩 | 一区二区不卡在线播放| 亚洲高清不卡在线| 久久精品国产久精国产爱| 高清日韩电视剧大全免费| 精品国产一二三| 亚洲国产精品尤物yw在线观看| 石原莉奈一区二区三区在线观看| 成人综合激情网| 一道本成人在线| 亚洲欧美色一区| 欧美日韩在线直播| 久久精品国产秦先生| 日韩免费高清av| 国产一区二区三区黄视频 | 久久久久久久久伊人| 国产精品456| 亚洲风情在线资源站| 精品国产精品一区二区夜夜嗨| 国产精品一区三区| 亚洲第一主播视频| 久久一二三国产| 欧美曰成人黄网| 99久久99久久精品国产片果冻| 亚洲一区二三区| 国产日韩视频一区二区三区| 精品视频一区 二区 三区| 国内精品久久久久影院一蜜桃| 亚洲天堂福利av| 欧美精品v日韩精品v韩国精品v| 国产美女一区二区| 91网站黄www| 岛国一区二区在线观看| 成人午夜电影网站| 91丨九色丨黑人外教| 91麻豆福利精品推荐| 欧美美女视频在线观看| 日韩一区二区三区免费观看| 中文字幕av一区二区三区高| 久久超碰97中文字幕| 亚洲精品菠萝久久久久久久| 国产欧美一区二区精品仙草咪 | 成人一级视频在线观看| 久久99久久久久久久久久久| 丝袜亚洲另类欧美| 天天综合色天天综合色h| 亚洲精品国产一区二区精华液 | 久久婷婷国产综合精品青草| 日韩天堂在线观看| 69堂亚洲精品首页| 欧美日产国产精品| 91精品国产综合久久久蜜臀粉嫩 | 不卡一区二区在线| 成人性生交大合| 97精品电影院| 欧美精品乱人伦久久久久久| 欧美午夜一区二区三区免费大片| 欧美日韩免费高清一区色橹橹 | 91精品国产91综合久久蜜臀| 欧美mv日韩mv国产| 亚洲欧美一区二区视频| 亚洲国产成人av网| 国产99久久久国产精品| 91视频精品在这里| 精品少妇一区二区三区| 国产精品色一区二区三区| 一区二区三区不卡在线观看| 日本三级亚洲精品| av电影一区二区| 日韩你懂的在线播放| 国产精品久久久久久福利一牛影视 | 播五月开心婷婷综合| 欧美疯狂性受xxxxx喷水图片| 久久久久久久久久久久电影 | 一区在线观看视频| 日韩电影在线免费| 成人手机电影网| 26uuu亚洲综合色| 亚瑟在线精品视频| 91免费国产视频网站| 久久精品亚洲国产奇米99| 亚洲一区二区三区在线| 丁香六月综合激情| 精品国产乱子伦一区| 日本怡春院一区二区| 91成人看片片| 一区二区视频在线| a级精品国产片在线观看| 国产女人aaa级久久久级 | 国产精品久久久久aaaa| 国产精品亚洲视频| 26uuu精品一区二区| 麻豆精品一二三| 日韩欧美电影一二三| 日本最新不卡在线| 91麻豆精品国产自产在线| 午夜精品久久久久久久 | 成人黄色777网| 自拍偷在线精品自拍偷无码专区| av亚洲精华国产精华精华| 国产精品女主播在线观看| 91麻豆视频网站| 午夜亚洲国产au精品一区二区| 欧美精品第1页| 紧缚奴在线一区二区三区| 久久精品视频在线看| 91免费看`日韩一区二区| 亚洲午夜在线电影| 精品国产123| 91片在线免费观看| 亚洲一二三区不卡| 精品国产一区二区精华| 成人免费视频caoporn| 性感美女久久精品| 精品成人在线观看| 欧美在线看片a免费观看| 麻豆专区一区二区三区四区五区| 国产精品嫩草影院av蜜臀| 色婷婷激情久久| 国产成人免费在线视频| 亚洲一区二区在线免费看| 久久青草国产手机看片福利盒子 | 日本高清视频一区二区| 国产中文字幕精品| 亚洲一区二区成人在线观看| 精品欧美一区二区在线观看| 欧美最新大片在线看| 国产ts人妖一区二区| 麻豆成人av在线| 亚洲成人动漫一区| 亚洲精品第1页| 国产精品国产自产拍高清av| 久久亚洲一区二区三区四区| 91精品国产综合久久久蜜臀图片| 色综合久久久久久久| www.综合网.com| 成人免费高清视频| 国产a级毛片一区| 国产成人一区二区精品非洲| 韩国一区二区在线观看| 免费人成在线不卡| 久久精品噜噜噜成人88aⅴ| 天天影视涩香欲综合网| 亚洲18女电影在线观看| 亚洲第一主播视频| 日本免费新一区视频| 日韩国产欧美在线视频| 蜜桃视频在线一区| 九色|91porny| 成人国产精品免费观看动漫| 成人亚洲一区二区一| 色婷婷av一区| 91精品国产综合久久福利软件| 91精品国产综合久久福利软件 | 不卡在线视频中文字幕| 99综合电影在线视频| 欧美视频完全免费看| 欧美日韩在线三区| 精品欧美乱码久久久久久1区2区| 精品国偷自产国产一区| 国产精品久久久99| 亚洲国产精品一区二区久久 | 欧美区视频在线观看| 久久欧美中文字幕| 曰韩精品一区二区| 精品一区二区三区不卡| 成人h版在线观看| 欧美一级夜夜爽| 中文字幕日韩精品一区| 日韩电影在线观看电影| 成人黄色在线网站| 欧美大片国产精品| 亚洲黄色尤物视频| 国产精品一区一区三区| 欧美日韩综合色| 国产欧美日韩三区| 免费欧美高清视频| 欧美日韩国产精选| **欧美大码日韩| 成人一区二区三区中文字幕| 欧美一二三四在线| 亚洲aⅴ怡春院| 色女孩综合影院| 亚洲人成网站影音先锋播放| 国产一区999| 久久久精品日韩欧美| 精一区二区三区| 日韩精品一区二区三区蜜臀| 亚洲va欧美va国产va天堂影院| 欧美日精品一区视频| 亚洲成人一二三| 日韩欧美一区二区不卡| 人人爽香蕉精品| 久久久99精品久久|