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

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

?? hal_org.h

?? zigbee 2004協議棧
?? H
?? 第 1 頁 / 共 5 頁
字號:
// Where _source_ is one of
#define CRYSTAL 0x00
#define RC      0x01

// Macro for setting the main clock oscillator source,
//turns off the clock source not used
//changing to XOSC will take approx 150 us
#define SET_MAIN_CLOCK_SOURCE(source) \
   do {                               \
      if(source) {                    \
        CLKCON |= 0x40;               \
        while(!HIGH_FREQUENCY_RC_OSC_STABLE); \
        if(TICKSPD == 0){             \
          CLKCON |= 0x08;             \
        }                             \
        SLEEP |= 0x04;                \
      }                               \
      else {                          \
        SLEEP &= ~0x04;               \
        while(!XOSC_STABLE);          \
        asm("NOP");                   \
        CLKCON &= ~0x47;              \
        SLEEP |= 0x04;                \
      }                               \
   }while (0)



/******************************************************************************
*******************           Timer macros/functions        *******************
*******************************************************************************
General:
The timers/counters can be configured in a number of ways. The following
functions allow basic configuration of the timers as interrupt timers,
pulse width modulators (PWM) and capture timers. Other uses require manual
configuration of the timers/counters.

Generally 3 steps are nescessary to start a timer:

   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){                                              \

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产黄人亚洲片| 99久久99久久免费精品蜜臀| 国产一区二区三区综合| 亚洲图片自拍偷拍| 色综合一区二区三区| 欧美精品一区视频| 国产成人欧美日韩在线电影| 欧美国产精品专区| 九色综合国产一区二区三区| 一区二区三区中文字幕在线观看| 亚洲靠逼com| 麻豆成人91精品二区三区| 一本大道久久a久久综合婷婷| 日韩一区二区三| 午夜精品久久久| 一本色道久久综合亚洲精品按摩| 国产欧美日韩视频一区二区| 麻豆成人综合网| 欧美丰满一区二区免费视频| 亚洲午夜在线视频| 在线免费一区三区| 一区二区三区在线观看国产| 99视频有精品| 亚洲色图在线播放| www.久久精品| 国产精品传媒视频| 成人看片黄a免费看在线| 欧美国产精品v| 国产不卡视频一区二区三区| 国产亚洲精品bt天堂精选| 精品在线视频一区| 久久美女艺术照精彩视频福利播放 | 老司机精品视频线观看86| 欧美美女网站色| 亚洲mv在线观看| 欧美日韩国产美女| 午夜不卡av免费| 欧美二区乱c少妇| 日本午夜精品视频在线观看| 欧美一级电影网站| 精品一区二区三区的国产在线播放| 欧美一区二区三区四区高清| 麻豆国产91在线播放| 久久一区二区三区国产精品| 国产精品综合av一区二区国产馆| 久久九九影视网| 99精品黄色片免费大全| 一区二区在线观看免费视频播放| 欧美日韩中文另类| 97超碰欧美中文字幕| 亚洲一区二区综合| 欧美日韩mp4| 亚洲国产aⅴ成人精品无吗| 国产一区二区精品久久91| 在线中文字幕一区二区| 欧美日韩国产影片| 欧美一区二区三区在线视频| 日韩精品中文字幕一区 | 亚洲精品在线观看网站| 国产色产综合色产在线视频| 亚洲国产日韩a在线播放性色| 成人av先锋影音| 亚洲免费色视频| 欧美一级国产精品| 高潮精品一区videoshd| 亚洲综合色噜噜狠狠| 精品国产亚洲在线| 一本到一区二区三区| 奇米精品一区二区三区在线观看 | 国产精品综合一区二区| 老司机精品视频一区二区三区| 亚洲成a人v欧美综合天堂下载 | 午夜婷婷国产麻豆精品| 免费高清成人在线| 国产日韩欧美a| 日韩精品一区二区三区视频在线观看| 国产一区二区三区av电影| 国产无遮挡一区二区三区毛片日本| 中文字幕一区二区三区视频| 一区二区三区在线播放| 国产成人精品影视| 欧美日韩日日夜夜| 一区二区三区在线观看网站| 国产麻豆视频精品| 日韩精品最新网址| 国产大陆精品国产| 亚洲一区中文在线| 亚洲精品久久久蜜桃| 成人av电影在线| 亚洲一区二区影院| 欧美日本一区二区三区四区| 国产成人99久久亚洲综合精品| 日韩一级成人av| 99久久免费视频.com| 日韩理论片在线| 欧美精品第一页| 日韩国产精品久久久久久亚洲| 91首页免费视频| 亚洲免费av观看| 国产欧美日韩另类视频免费观看| 成人高清在线视频| 亚洲国产精品ⅴa在线观看| 久久国产精品72免费观看| 在线观看www91| 国产精品国产精品国产专区不蜜 | 欧美日本乱大交xxxxx| 夜夜嗨av一区二区三区四季av| 99久久er热在这里只有精品66| 成人性视频免费网站| 亚洲高清久久久| 久久久.com| 色狠狠av一区二区三区| 国产福利一区在线| 国产欧美一区二区三区在线老狼| 91色porny在线视频| 美女视频黄免费的久久 | 在线观看视频一区| 国产黄色91视频| 国产麻豆精品theporn| 久久国产视频网| 久久99久久精品欧美| 国产一区二区影院| 成人手机电影网| 福利视频网站一区二区三区| 成人av手机在线观看| 99精品国产91久久久久久| 色综合久久88色综合天天6| 日本精品一级二级| 欧美日韩亚洲高清一区二区| 欧美日韩高清一区二区三区| 欧美一区二区三区免费| 久久亚洲综合av| 国产精品无遮挡| 亚洲日本一区二区三区| 香蕉成人伊视频在线观看| 免费不卡在线视频| 国产成人精品免费网站| 色综合 综合色| 日韩欧美第一区| 中文成人av在线| 亚洲国产精品久久艾草纯爱| 麻豆国产精品777777在线| 成人精品高清在线| 欧美性大战久久| 精品动漫一区二区三区在线观看| 中文在线一区二区| 亚洲国产精品久久人人爱蜜臀| 久久99精品国产麻豆婷婷| 成人黄页在线观看| 欧美剧情片在线观看| 久久综合给合久久狠狠狠97色69| 一色桃子久久精品亚洲| 天天色图综合网| 丰满少妇久久久久久久| 欧美老年两性高潮| 国产精品久久网站| 蜜桃av一区二区在线观看| 一本久久a久久免费精品不卡| 日韩美女一区二区三区四区| 亚洲精品国产一区二区精华液| 日本成人在线网站| 91麻豆自制传媒国产之光| 久久久久久久久一| 日韩高清一区二区| 一本大道综合伊人精品热热| 久久久久久久性| 奇米一区二区三区| 日本精品一区二区三区高清| 久久久99精品免费观看不卡| 日本伊人午夜精品| 欧美色综合网站| 亚洲欧美日韩国产成人精品影院| 久久国产精品99久久人人澡| 色婷婷综合久久久久中文一区二区| 久久久久久久久久久久久久久99| 午夜av电影一区| 色诱亚洲精品久久久久久| 日本一区二区三级电影在线观看| 美腿丝袜在线亚洲一区| 欧美日韩一区二区在线观看| 成人免费在线视频| 国产精品一二三区在线| 日韩免费性生活视频播放| 性做久久久久久| 色欧美88888久久久久久影院| 国产欧美日韩综合| 国产一区二区三区免费播放| 日韩欧美国产不卡| 麻豆91精品91久久久的内涵| 欧美日韩一区二区欧美激情| 一区二区三区在线观看欧美| 91麻豆福利精品推荐| 亚洲视频一二三区| 92国产精品观看| 亚洲码国产岛国毛片在线| 日本乱码高清不卡字幕| 一区二区激情小说| 91成人免费网站| 午夜国产精品影院在线观看| 欧美三级资源在线|