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

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

?? hal.h

?? 能在TI出的ZIGBEE射頻芯片CC2430上運行的語音程序
?? H
?? 第 1 頁 / 共 5 頁
字號:
        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){                                              \
         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.
******************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级片在线看| 国产精品福利一区| 国产精品国产精品国产专区不蜜| 一区二区三区久久| 国产一区二区三区在线观看免费视频 | 国产成人免费在线视频| 欧美午夜不卡视频| 亚洲视频一二三| 成人污视频在线观看| 精品少妇一区二区三区视频免付费| 自拍偷拍欧美激情| 国产成人h网站| 亚洲精品一区在线观看| 日本大胆欧美人术艺术动态| 91福利区一区二区三区| 中文字幕一区二区三区在线播放| 毛片基地黄久久久久久天堂| 欧美日韩精品一区二区三区四区 | 天天综合天天做天天综合| 粉嫩蜜臀av国产精品网站| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲成av人片在www色猫咪| 91成人网在线| 亚洲一区二区高清| 在线观看一区日韩| 一区二区三区四区av| 91天堂素人约啪| 亚洲天堂中文字幕| 成人午夜视频福利| 亚洲免费观看高清完整版在线观看 | 99久久综合国产精品| 欧美国产日韩a欧美在线观看| 国内精品视频一区二区三区八戒| 欧美一区二区三区人| 奇米影视在线99精品| 3751色影院一区二区三区| 视频一区二区欧美| 日韩午夜激情视频| 日本道精品一区二区三区| 亚洲人成小说网站色在线| 91麻豆swag| 亚洲一级在线观看| 日韩免费成人网| 国产一区视频导航| 国产精品传媒入口麻豆| 色素色在线综合| 日韩在线卡一卡二| 亚洲一卡二卡三卡四卡五卡| 在线成人免费观看| 老司机免费视频一区二区三区| 精品粉嫩超白一线天av| 高清不卡一区二区在线| 亚洲手机成人高清视频| 欧美日韩亚洲综合一区二区三区 | 成人欧美一区二区三区在线播放| 欧美自拍丝袜亚洲| 蜜臀av在线播放一区二区三区| 国产视频不卡一区| 欧美性猛交xxxx黑人交| 开心九九激情九九欧美日韩精美视频电影 | 国产一区二区三区在线观看精品 | 色婷婷综合久久久中文一区二区 | 精品一区二区免费| 中文字幕日韩精品一区| 欧洲一区二区av| 国产盗摄视频一区二区三区| 亚洲精品视频免费观看| 精品国产三级a在线观看| 91蜜桃网址入口| 狠狠色伊人亚洲综合成人| 亚洲卡通欧美制服中文| 精品国精品国产尤物美女| 一本久久综合亚洲鲁鲁五月天| 毛片基地黄久久久久久天堂| 中文字幕一区二区视频| 欧美一区二区黄色| 色8久久精品久久久久久蜜| 国产乱码字幕精品高清av| 亚洲国产日韩a在线播放性色| 久久久久国色av免费看影院| 91精品国产色综合久久不卡电影| 成人动漫一区二区在线| 另类综合日韩欧美亚洲| 亚洲综合精品久久| 1区2区3区精品视频| 日韩一区二区三区在线视频| 欧美在线免费播放| 成人午夜伦理影院| 国产精品一区二区久久不卡| 蜜臀av性久久久久蜜臀aⅴ | 欧美曰成人黄网| 成人app在线观看| 久草精品在线观看| 蜜臀精品一区二区三区在线观看 | 亚洲美腿欧美偷拍| 国产欧美日韩激情| 久久奇米777| 日韩久久久久久| 欧美夫妻性生活| 欧美日韩国产首页| 欧美日韩国产综合草草| 欧美性生活影院| 在线影视一区二区三区| 色综合天天综合网天天狠天天| 成人三级在线视频| 国产不卡在线播放| 粉嫩嫩av羞羞动漫久久久| 国产mv日韩mv欧美| 不卡免费追剧大全电视剧网站| 成人午夜免费av| 99vv1com这只有精品| 99久久精品国产导航| 一本一本大道香蕉久在线精品 | 久久久久久久久久美女| 欧美xfplay| 亚洲精品在线观| 中文字幕av一区二区三区免费看 | 精品国产欧美一区二区| 日韩一二三四区| 久久综合九色综合97婷婷女人 | 6080午夜不卡| 日韩欧美在线1卡| 精品国产一二三区| 国产精品色呦呦| 亚洲黄色片在线观看| 亚洲国产精品天堂| 免费观看日韩av| 国产资源精品在线观看| 成人午夜视频福利| 色综合久久综合中文综合网| 欧美日韩午夜在线| 精品国产一区二区三区久久影院| 国产视频不卡一区| 一区二区三区在线视频播放| 天堂影院一区二区| 国产精品系列在线观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国v精品久久久网| 91丨九色丨国产丨porny| 色综合久久66| 日韩欧美电影一二三| 国产精品美女久久久久aⅴ| 亚洲人成影院在线观看| 日韩av不卡一区二区| 成人性生交大片免费看中文网站| 欧美优质美女网站| 欧美xingq一区二区| 亚洲情趣在线观看| 韩国女主播一区| 欧美三电影在线| 久久久久国产精品人| 一区二区三区四区在线播放| 麻豆视频一区二区| 99国产精品视频免费观看| 日韩欧美另类在线| 亚洲制服欧美中文字幕中文字幕| 麻豆国产精品777777在线| 色伊人久久综合中文字幕| 日韩精品一区二区三区在线观看| 一色桃子久久精品亚洲| 久久99久国产精品黄毛片色诱| 色综合中文综合网| 99视频精品免费视频| 日韩视频在线观看一区二区| 中文字幕在线不卡一区二区三区 | 国产.欧美.日韩| 91精品国产一区二区三区| 日韩理论片一区二区| 精一区二区三区| 欧美日韩国产大片| 亚洲欧美自拍偷拍| 国产一区二区三区四| 91精品国产综合久久久久久久久久| 亚洲欧美另类小说视频| 国产91精品一区二区麻豆亚洲| 日韩欧美国产一区二区三区| 一区二区三区美女视频| 99热99精品| 国产精品国产三级国产专播品爱网| 韩国成人福利片在线播放| 欧美一级二级在线观看| 亚洲成人av中文| 欧美亚洲自拍偷拍| 一区二区三区欧美视频| 色天天综合色天天久久| 最近中文字幕一区二区三区| 国产成人福利片| 中文字幕av不卡| 国产成人精品aa毛片| 国产色产综合产在线视频| 加勒比av一区二区| 亚洲精品在线观看网站| 极品少妇xxxx偷拍精品少妇| 日韩免费高清电影| 久久成人精品无人区| 日韩视频免费观看高清完整版在线观看 | 韩国午夜理伦三级不卡影院| 日韩三级视频中文字幕| 免费亚洲电影在线| 精品理论电影在线观看|