/**
* [url=home.php?mod=space&uid=247401]@brief[/url] Open Timer with Operate Mode and Frequency
*
* @param[in] timer The pointer of the specified Timer module. It could be TIMER0, TIMER1, TIMER2, TIMER3.
* @param[in] u32Mode Operation mode. Possible options are
* - \ref TIMER_ONESHOT_MODE
* - \ref TIMER_PERIODIC_MODE
* - \ref TIMER_TOGGLE_MODE
* - \ref TIMER_CONTINUOUS_MODE
* @param[in] u32Freq Target working frequency
*
* [url=home.php?mod=space&uid=266161]@return[/url] Real timer working frequency
*
* [url=home.php?mod=space&uid=1543424]@Details[/url] This API is used to configure timer to operate in specified mode and frequency.
* If timer cannot work in target frequency, a closest frequency will be chose and returned.
* [url=home.php?mod=space&uid=536309]@NOTE[/url] After calling this API, Timer is \b NOT running yet. But could start timer running be calling
* \ref TIMER_Start macro or program registers directly.
*/
uint32_t TIMER_Open(TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq)
还有这三个参数的意义,第一个选择定时器,第二个模式,就是单次,周期,开关,连续。。。。
第三个是指前面配置的中期内触发几次,如果按照例子中默认的是定时1S,那么这里设置为1,就是1S触发一次,如果是2,那么一秒内平均触发两次,就是2Hz |