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

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

?? hal_org.h

?? ZIGBEE2006協議棧
?? 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一区二区三区免费野_久草精品视频
国产成人一区在线| 欧美影院一区二区| 欧洲亚洲国产日韩| 国产亚洲午夜高清国产拍精品 | 欧美亚洲国产一区二区三区| 日韩精品一区二区在线观看| 亚洲老妇xxxxxx| 激情深爱一区二区| 9191精品国产综合久久久久久| 久久精品亚洲国产奇米99| 日韩有码一区二区三区| 色婷婷综合五月| 中文字幕欧美国产| 精品在线一区二区| 欧美影院精品一区| 中文字幕的久久| 性做久久久久久免费观看欧美| 黄色日韩网站视频| 国产一区二区在线看| www.亚洲精品| 欧美群妇大交群中文字幕| 国产精品久久久久四虎| 99久久99久久精品国产片果冻| 欧美日韩一区二区欧美激情| 久久亚洲私人国产精品va媚药| 亚洲免费观看高清完整| 国产一区二区三区在线观看免费 | 99在线热播精品免费| 欧美老女人第四色| 亚洲欧洲99久久| 激情国产一区二区| 欧美乱熟臀69xxxxxx| 亚洲色图在线看| 国产精品一区二区在线观看网站| 欧美色图片你懂的| 亚洲欧美另类小说| av午夜一区麻豆| 欧美韩国日本一区| 午夜精品久久久久久久久久久| 爽好多水快深点欧美视频| 丁香亚洲综合激情啪啪综合| 在线一区二区三区做爰视频网站| 精品国产电影一区二区| 亚洲男同性恋视频| 国产成人精品亚洲777人妖| 91精品国产欧美一区二区18| 一色桃子久久精品亚洲| 另类调教123区| 91成人国产精品| 中文字幕中文字幕一区二区| 韩国女主播成人在线| 日韩午夜电影av| 亚洲第一久久影院| 成人av免费网站| 欧美一区二区网站| 国产精品福利一区| 久久99国产精品久久99果冻传媒| 884aa四虎影成人精品一区| 国产精品亲子乱子伦xxxx裸| 免费观看日韩电影| 久久久美女毛片| 粉嫩av一区二区三区在线播放| 国产欧美一区二区在线| 国产成人自拍网| 国产精品麻豆网站| 国产伦精品一区二区三区视频青涩 | 欧美久久高跟鞋激| 天天影视色香欲综合网老头| 日韩丝袜美女视频| 69堂精品视频| 免费看欧美美女黄的网站| 精品毛片乱码1区2区3区| 国产在线视视频有精品| 欧美国产1区2区| 成人91在线观看| 一区二区三区免费| 91精品国产91久久久久久一区二区| 日韩高清在线一区| 久久久久久久国产精品影院| 国产成人综合视频| 亚洲在线视频一区| 欧美一级欧美三级在线观看 | 亚洲欧美在线视频| 欧美午夜精品一区二区蜜桃| 三级亚洲高清视频| 欧美精品一区二区三区蜜桃| 成人久久18免费网站麻豆| 又紧又大又爽精品一区二区| 制服丝袜亚洲精品中文字幕| 国产酒店精品激情| 一区二区三区精品视频在线| 欧美一区二区三区免费视频| 成人涩涩免费视频| 日韩和欧美的一区| 久久精品一区八戒影视| 欧美性xxxxxxxx| 国产不卡高清在线观看视频| 亚洲第一搞黄网站| 国产精品午夜在线| 欧美妇女性影城| av色综合久久天堂av综合| 日本欧洲一区二区| 久久久久久久国产精品影院| 在线视频国内自拍亚洲视频| 男人操女人的视频在线观看欧美| 日本一区二区综合亚洲| 欧美日韩国产系列| 国产精品一区二区在线观看网站| 亚洲欧美日韩在线播放| 制服.丝袜.亚洲.另类.中文 | 日韩视频国产视频| 欧美性受xxxx黑人xyx性爽| 国产露脸91国语对白| 视频一区在线播放| 亚洲欧美日韩国产综合在线| 久久久亚洲国产美女国产盗摄| 一本色道久久综合亚洲精品按摩| 国产高清一区日本| 另类的小说在线视频另类成人小视频在线| 亚洲另类在线一区| 国产精品三级久久久久三级| 精品91自产拍在线观看一区| 欧美高清视频不卡网| 欧美天堂一区二区三区| av一二三不卡影片| 波多野结衣中文字幕一区二区三区 | 依依成人综合视频| 国产女同互慰高潮91漫画| 欧美mv日韩mv国产| 欧美日韩国产精品成人| 欧美日韩综合一区| 欧美日韩免费视频| 在线视频观看一区| 欧美综合天天夜夜久久| 顶级嫩模精品视频在线看| 国产在线国偷精品免费看| 首页综合国产亚洲丝袜| 亚洲免费观看视频| 国产精品高潮呻吟| 亚洲国产成人av网| 亚洲国产精品久久一线不卡| 亚洲一区在线观看视频| 亚洲制服欧美中文字幕中文字幕| 一区二区欧美精品| 亚洲国产综合色| 首页综合国产亚洲丝袜| 蜜桃视频免费观看一区| 久久99国产精品久久| 国产成人在线影院| 99精品视频一区| 欧美专区日韩专区| 欧美一区二区在线免费观看| 日韩美女在线视频| 国产日韩欧美综合在线| 成人免费在线视频观看| 亚洲人成影院在线观看| 亚洲成人动漫av| 黄色资源网久久资源365| 丁香一区二区三区| 欧美撒尿777hd撒尿| 日韩丝袜美女视频| 中文字幕av在线一区二区三区| 亚洲欧洲一区二区在线播放| 玉足女爽爽91| 一区二区三区四区不卡视频 | 国产麻豆欧美日韩一区| 国产91在线观看丝袜| 99久久精品费精品国产一区二区| 欧美亚洲高清一区二区三区不卡| 制服.丝袜.亚洲.中文.综合| 久久久欧美精品sm网站| 亚洲一区二区三区四区五区中文| 蜜臀av一级做a爰片久久| 粉嫩一区二区三区在线看| 国产99久久久久久免费看农村| jvid福利写真一区二区三区| 欧美亚洲一区二区在线| 日韩一区二区麻豆国产| 久久久99久久| 一区二区三区色| 免费观看30秒视频久久| 色域天天综合网| 2020国产精品自拍| 亚洲午夜电影网| 粉嫩一区二区三区性色av| 欧美日韩mp4| 中文字幕av一区二区三区高| 亚洲成a人片在线观看中文| 国产精品1区2区| 91精品国产福利在线观看| 综合欧美一区二区三区| 精品伊人久久久久7777人| 欧美丝袜丝交足nylons| 中文字幕一区免费在线观看| 奇米精品一区二区三区在线观看 | 秋霞电影一区二区| 91麻豆免费在线观看| 国产校园另类小说区| 六月丁香婷婷色狠狠久久| 精品视频123区在线观看|