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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? config.h

?? CC2510 timer1 PWM輸出2M波形
?? H
?? 第 1 頁 / 共 5 頁
字號(hào):
      else if (mode == 3)  { SLEEP |= 0x03;  } \
      else { SLEEP &= ~0x03; SLEEP |= mode;  } \
      PCON |= 0x01;                            \
      asm("NOP");                              \
   }while (0)


// Where _mode_ is one of
#define POWER_MODE_0  0x00  // Clock oscillators on, voltage regulator on
#define POWER_MODE_1  0x01  // 32.768 KHz oscillator on, voltage regulator on
#define POWER_MODE_2  0x02  // 32.768 KHz oscillator on, voltage regulator off
#define POWER_MODE_3  0x03  // All clock oscillators off, voltage regulator off

// Macro for setting the 32 KHz clock source
#define SET_32KHZ_CLOCK_SOURCE(source) \
   do {                                \
      if( source ) {                   \
         CLKCON |= 0x80;               \
      } else {                         \
         CLKCON &= ~0x80;              \
      }                                \
   } while (0)

// 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); \
        SLEEP |= 0x04;                \
      }                               \
      else {                          \
        SLEEP &= ~0x04;               \
        while(!XOSC_STABLE);          \
        asm("NOP");                   \
        CLKCON &= ~0x47;              \
        SLEEP |= 0x04;                \
      }                               \
   }while (0)


// Macro for setting the main clock division,
#define SET_MAIN_CLOCK_SPEED(frequency)   \
   do {                                   \
        CLKCON = ((CLKCON & ~0x07) | (frequency & 0x07));     \
   }while (0)

// where frequency is one of
#define MHZ_26          0x00
#define MHZ_13          0x01
#define MHZ_6_5         0x02
#define MHZ_3_25        0x03
#define MHZ_1_62        0x04
#define MHZ_0_81        0x05
#define MHZ_0_40        0x06
#define MHZ_0_20        0x07


/******************************************************************************
*******************           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.

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


// 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 timer 2. The values for the counter,
*      prescaler and tick period is calculated and written to the corresponding
*      registers.
*
* Parameters:
*
* @param  UINT32 period
*         Period of the timer in u-seconds.
* @param  UINT8* cnt
*         The value written to T2CT (counter). This value is returned to enable
*         a fast setup (without calculation) using the SET_TIMER2_COUNTER.
* @param  UINT8* presc
*         The value written to T2PR (prescaler). This value is returned to enable
*         a fast setup (without calculation) using the SET_TIMER2_PRESCALER.
*
* @return BOOL
          Returns FALSE if period is too large, TRUE otherwise.
*
******************************************************************************/


#define TIMER2_INIT()  \
   do {                \
      T2CTL = 0x00;    \
      T2CT = 0x00;     \
      T2PR = 0x00;     \
   } while (0)

#define TIMER2_SET_COUNTER(counter)     do{ T2CT = counter; }while(0)
#define TIMER2_SET_PRESCALER(prescaler) do{ T2PR = prescaler; }while(0)
#define TIMER2_SET_TICK_PERIOD(tick)    do{ T2CTL = ((T2CTL & ~0x03) | tick); }while(0)
#define TIMER2_ENABLE_INTERRUPT()       do{ T2CTL |= 0x10; }while(0)
#define TIMER2_DISABLE_INTERRUPT()      do{ T2CTL &= ~0x10; }while(0)
#define TIMER2_CLEAR_EXPIRED()          do{ T2CTL &= ~0x40; }while(0)
#define TIMER2_EXPIRED                  (T2CTL & 0x40)
#define TIMER2_SET_MODE(mode)           (T2CTL  = (mode) ? T2CTL|0x04  : T2CTL&~0x04)

#define TIMER2_USE_REG  FALSE
#define TIMER2_FREE     TRUE

/******************************************************************************
* @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.
*
******************************************************************************/

// 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)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲va欧美va人人爽| 亚洲三级免费电影| 91在线播放网址| 日韩精品福利网| 欧美国产禁国产网站cc| 91精品国产综合久久久久久| 国产成人av电影在线| 日韩国产欧美在线播放| 亚洲柠檬福利资源导航| 久久精品亚洲麻豆av一区二区| 欧美日韩中文另类| 久久综合丝袜日本网| 欧美性生交片4| 99久久国产综合精品麻豆| 精品一区二区三区在线观看国产| 亚洲精品va在线观看| 国产精品美女久久久久久2018| 日韩一区二区三区av| 精品视频色一区| 99re这里只有精品首页| 懂色av一区二区三区蜜臀| 看电影不卡的网站| 日日夜夜免费精品| 亚洲国产精品视频| 亚洲影院在线观看| 亚洲欧洲成人精品av97| 国产精品美女久久久久久| 国产亚洲综合色| xf在线a精品一区二区视频网站| 51精品久久久久久久蜜臀| 欧美亚洲禁片免费| 欧美日韩免费一区二区三区| 色婷婷久久99综合精品jk白丝| av福利精品导航| 不卡的av在线| 99久久精品一区二区| 99re6这里只有精品视频在线观看| 国产91精品一区二区麻豆亚洲| 国产精华液一区二区三区| 国产酒店精品激情| 国产麻豆成人精品| 国产成人免费在线视频| 福利一区福利二区| 成人综合在线视频| www.成人在线| 91成人免费电影| 欧美天天综合网| 宅男噜噜噜66一区二区66| 91精品国产色综合久久不卡蜜臀 | 国产精品亚洲一区二区三区妖精| 极品少妇xxxx偷拍精品少妇| 国产福利一区二区三区在线视频| 国产曰批免费观看久久久| 国产**成人网毛片九色| www.久久久久久久久| 色久综合一二码| 欧美精品自拍偷拍动漫精品| 91精品国产色综合久久ai换脸 | 亚洲一区二区欧美日韩 | 天涯成人国产亚洲精品一区av| 亚洲午夜久久久久久久久久久| 国产99久久久精品| 日本韩国精品一区二区在线观看| 色94色欧美sute亚洲13| 69精品人人人人| 久久色在线视频| 国产精品亲子伦对白| 亚洲国产综合在线| 精品一区二区精品| 93久久精品日日躁夜夜躁欧美| 色婷婷精品久久二区二区蜜臀av| 在线播放日韩导航| 国产三级欧美三级| 亚洲精品成人精品456| 视频一区二区三区在线| 国产一区二区三区综合| av亚洲精华国产精华精| 欧美日韩视频在线第一区| 精品国产91亚洲一区二区三区婷婷| 国产夜色精品一区二区av| 亚洲精品一二三四区| 久久av老司机精品网站导航| av中文字幕不卡| 7777精品久久久大香线蕉| 国产精品区一区二区三| 日本中文一区二区三区| 不卡电影免费在线播放一区| 欧美精品一级二级三级| 欧美激情在线免费观看| 日韩精品电影一区亚洲| 成人午夜视频免费看| 欧美一二三区在线观看| 亚洲视频一区二区在线| 久久99精品久久久久久国产越南| 日本久久电影网| 国产欧美一区在线| 午夜国产精品一区| 99综合电影在线视频| 日韩欧美www| 亚洲成人免费av| 成人福利视频网站| 日韩一级精品视频在线观看| 一区二区三区中文字幕电影| 国产一区二区在线看| 欧美日本高清视频在线观看| 国产亚洲成av人在线观看导航 | 精品卡一卡二卡三卡四在线| 一区二区三区中文字幕电影| 粉嫩绯色av一区二区在线观看| 欧美高清激情brazzers| 亚洲色图在线看| 成人免费毛片高清视频| 久久久久国产精品麻豆| 久久精品久久久精品美女| 欧美日韩精品一区二区三区四区| 亚洲视频一区二区免费在线观看| 高潮精品一区videoshd| 国产三级三级三级精品8ⅰ区| 日韩国产欧美在线播放| 欧美视频三区在线播放| 亚洲综合激情另类小说区| 成人中文字幕在线| 国产精品色呦呦| 久久天堂av综合合色蜜桃网| 日本不卡视频一二三区| 欧美视频一区二| 亚洲成人综合在线| 欧美日韩在线免费视频| 一区二区三区在线看| 91污在线观看| 日韩一区欧美一区| 色综合天天综合狠狠| 日韩理论片在线| 日本精品一区二区三区高清 | 日韩欧美国产一二三区| 婷婷激情综合网| 欧美一区午夜视频在线观看| 日本大胆欧美人术艺术动态| 在线不卡欧美精品一区二区三区| 日韩av午夜在线观看| 欧美一级高清大全免费观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩欧美综合在线| 国产一区亚洲一区| 国产欧美视频一区二区三区| 国产99精品在线观看| 国产精品三级av| 色8久久精品久久久久久蜜| 亚洲国产wwwccc36天堂| 4hu四虎永久在线影院成人| 久久99国产精品麻豆| 久久久国产精品麻豆| 色综合中文字幕| 亚洲成人自拍偷拍| 欧美一级淫片007| 国产精品伊人色| 国产精品国产三级国产三级人妇 | 日韩国产在线观看一区| 久久在线观看免费| av在线不卡电影| 亚洲电影一区二区三区| 精品剧情在线观看| 99久久综合99久久综合网站| 亚洲成人1区2区| 久久综合九色综合97_久久久| 成人午夜大片免费观看| 亚洲一区二区四区蜜桃| 日韩视频在线你懂得| 成人永久aaa| 偷拍自拍另类欧美| 久久久精品国产99久久精品芒果 | 在线播放一区二区三区| 国产成人亚洲综合a∨婷婷 | 国产suv精品一区二区883| |精品福利一区二区三区| 欧美日韩视频在线第一区 | 午夜电影网一区| 国产亚洲一本大道中文在线| 欧美亚洲国产一区二区三区| 国产一区二区三区在线观看精品| 亚洲欧洲一区二区三区| 91精品国产91久久久久久最新毛片| 国产成人免费在线视频| 丝袜美腿一区二区三区| 国产精品亲子乱子伦xxxx裸| 欧美一区二区三区免费观看视频| 波多野结衣中文一区| 成+人+亚洲+综合天堂| 日韩精品成人一区二区在线| 国产精品国产三级国产aⅴ中文| 欧美一区二区三区在线观看 | 99久久精品国产网站| 美国欧美日韩国产在线播放| 中文字幕亚洲区| 久久在线观看免费| 91精品中文字幕一区二区三区| av电影在线观看一区| 国产一二精品视频| 无码av免费一区二区三区试看| 国产精品白丝在线|