![]() |
NANO103 BSP V3.01.004
The Board Support Package for Nano103 Series
|
Macros | |
#define | TIMER_SET_CMP_VALUE(timer, u32Value) |
This macro is used to set new Timer compared value. More... | |
#define | TIMER_SET_PRESCALE_VALUE(timer, u32Value) |
This macro is used to set new Timer prescale value. More... | |
#define | TIMER_IS_ACTIVE(timer) |
This macro is used to check if specify Timer is inactive or active. More... | |
Functions | |
__STATIC_INLINE void | TIMER_Start (TIMER_T *timer) |
This function is used to start Timer counting. More... | |
__STATIC_INLINE void | TIMER_Stop (TIMER_T *timer) |
This function is used to stop Timer counting. More... | |
__STATIC_INLINE void | TIMER_EnableWakeup (TIMER_T *timer) |
This function is used to enable the Timer wake-up function. More... | |
__STATIC_INLINE void | TIMER_DisableWakeup (TIMER_T *timer) |
This function is used to disable the Timer wake-up function. More... | |
__STATIC_INLINE void | TIMER_EnableCaptureDebounce (TIMER_T *timer) |
This function is used to enable the capture pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_DisableCaptureDebounce (TIMER_T *timer) |
This function is used to disable the capture pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_EnableEventCounterDebounce (TIMER_T *timer) |
This function is used to enable the counter pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_DisableEventCounterDebounce (TIMER_T *timer) |
This function is used to disable the counter pin detection de-bounce function. More... | |
__STATIC_INLINE void | TIMER_EnableInt (TIMER_T *timer) |
This function is used to enable the Timer time-out interrupt function. More... | |
__STATIC_INLINE void | TIMER_DisableInt (TIMER_T *timer) |
This function is used to disable the Timer time-out interrupt function. More... | |
__STATIC_INLINE void | TIMER_EnableCaptureInt (TIMER_T *timer) |
This function is used to enable the Timer capture trigger interrupt function. More... | |
__STATIC_INLINE void | TIMER_DisableCaptureInt (TIMER_T *timer) |
This function is used to disable the Timer capture trigger interrupt function. More... | |
__STATIC_INLINE uint32_t | TIMER_GetIntFlag (TIMER_T *timer) |
This function indicates Timer time-out interrupt occurred or not. More... | |
__STATIC_INLINE void | TIMER_ClearIntFlag (TIMER_T *timer) |
This function clears the Timer time-out interrupt flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCaptureIntFlag (TIMER_T *timer) |
This function indicates Timer capture interrupt occurred or not. More... | |
__STATIC_INLINE void | TIMER_ClearCaptureIntFlag (TIMER_T *timer) |
This function clears the Timer capture interrupt flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetWakeupFlag (TIMER_T *timer) |
This function indicates Timer has waked up system or not. More... | |
__STATIC_INLINE void | TIMER_ClearWakeupFlag (TIMER_T *timer) |
This function clears the Timer wakeup interrupt flag. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCaptureData (TIMER_T *timer) |
This function gets the Timer capture data. More... | |
__STATIC_INLINE uint32_t | TIMER_GetCounter (TIMER_T *timer) |
This function reports the current timer counter value. More... | |
uint32_t | TIMER_Open (TIMER_T *timer, uint32_t u32Mode, uint32_t u32Freq) |
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. More... | |
void | TIMER_Close (TIMER_T *timer) |
This API stops Timer counting and disable the Timer interrupt function. More... | |
int32_t | TIMER_Delay (TIMER_T *timer, uint32_t u32Usec) |
This API is used to create a delay loop for u32usec micro seconds. More... | |
void | TIMER_EnableCapture (TIMER_T *timer, uint32_t u32CapMode, uint32_t u32Edge) |
This API is used to enable timer capture function with specified mode and capture edge. More... | |
void | TIMER_DisableCapture (TIMER_T *timer) |
This API is used to disable the Timer capture function. More... | |
void | TIMER_EnableEventCounter (TIMER_T *timer, uint32_t u32Edge) |
This function is used to enable the Timer counter function with specify detection edge. More... | |
void | TIMER_DisableEventCounter (TIMER_T *timer) |
This API is used to disable the Timer event counter function. More... | |
uint32_t | TIMER_GetModuleClock (TIMER_T *timer) |
This API is used to get the clock frequency of Timer. More... | |
void | TIMER_ResetCounter (TIMER_T *timer) |
This function is used to reset the Timer counter value. More... | |
void | TIMER_EnableFreqCounter (TIMER_T *timer, uint32_t u32DropCount, uint32_t u32Timeout, uint32_t u32EnableInt) |
This function is used to enable the Timer frequency counter function. More... | |
void | TIMER_DisableFreqCounter (TIMER_T *timer) |
This function is used to disable the Timer frequency counter function. More... | |
void | TIMER_SetTriggerSource (TIMER_T *timer, uint32_t u32Src) |
This function is used to select the interrupt source used to trigger other modules. More... | |
void | TIMER_SetTriggerTarget (TIMER_T *timer, uint32_t u32Mask) |
This function is used to set modules trigger by timer interrupt. More... | |
#define TIMER_IS_ACTIVE | ( | timer | ) |
#define TIMER_SET_CMP_VALUE | ( | timer, | |
u32Value | |||
) |
#define TIMER_SET_PRESCALE_VALUE | ( | timer, | |
u32Value | |||
) |
__STATIC_INLINE void TIMER_ClearCaptureIntFlag | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_ClearIntFlag | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_ClearWakeupFlag | ( | TIMER_T * | timer | ) |
void TIMER_Close | ( | TIMER_T * | timer | ) |
int32_t TIMER_Delay | ( | TIMER_T * | timer, |
uint32_t | u32Usec | ||
) |
This API is used to create a delay loop for u32usec micro seconds.
[in] | timer | The base address of Timer module |
[in] | u32Usec | Delay period in micro seconds with 10 usec every step. Valid values are between 10~1000000 (10 micro second ~ 1 second) |
0 | Success, target delay time reached |
TIMER_TIMEOUT_ERR | Delay function execute failed due to timer stop working |
Definition at line 91 of file timer.c.
void TIMER_DisableCapture | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_DisableCaptureDebounce | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_DisableCaptureInt | ( | TIMER_T * | timer | ) |
void TIMER_DisableEventCounter | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_DisableEventCounterDebounce | ( | TIMER_T * | timer | ) |
void TIMER_DisableFreqCounter | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_DisableInt | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_DisableWakeup | ( | TIMER_T * | timer | ) |
void TIMER_EnableCapture | ( | TIMER_T * | timer, |
uint32_t | u32CapMode, | ||
uint32_t | u32Edge | ||
) |
This API is used to enable timer capture function with specified mode and capture edge.
[in] | timer | The base address of Timer module |
[in] | u32CapMode | Timer capture mode. Could be |
[in] | u32Edge | Timer capture edge. Possible values are |
__STATIC_INLINE void TIMER_EnableCaptureDebounce | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_EnableCaptureInt | ( | TIMER_T * | timer | ) |
void TIMER_EnableEventCounter | ( | TIMER_T * | timer, |
uint32_t | u32Edge | ||
) |
This function is used to enable the Timer counter function with specify detection edge.
[in] | timer | The base address of Timer module |
[in] | u32Edge | Detection edge of counter pin. Could be ether |
__STATIC_INLINE void TIMER_EnableEventCounterDebounce | ( | TIMER_T * | timer | ) |
void TIMER_EnableFreqCounter | ( | TIMER_T * | timer, |
uint32_t | u32DropCount, | ||
uint32_t | u32Timeout, | ||
uint32_t | u32EnableInt | ||
) |
This function is used to enable the Timer frequency counter function.
[in] | timer | The base address of Timer module. Can be TIMER0 or TIMER2 |
[in] | u32DropCount | Set the event needs to drop before starting to measure event frequency. Valid value is between 0~0xFF |
[in] | u32Timeout | Set the timeout value before stop the frequency counter. No matter timer has sufficient sample count or not. The unit is timer clock and valid range is between 2~0xFFFFFF. Input 0 or 1 means disable timeout function. |
[in] | u32EnableInt | Enable interrupt assertion after capture complete or not. Valid values are TRUE and FALSE |
This function is used to calculate input event frequency. After enable this function, a pair of timers, TIMER0 and TIMER1, or TIMER2 and TIMER3 will be configured for this function. The mode used to calculate input event frequency is mentioned as "Inter Timer Trigger Mode" in Technical Reference Manual
__STATIC_INLINE void TIMER_EnableInt | ( | TIMER_T * | timer | ) |
__STATIC_INLINE void TIMER_EnableWakeup | ( | TIMER_T * | timer | ) |
__STATIC_INLINE uint32_t TIMER_GetCaptureData | ( | TIMER_T * | timer | ) |
__STATIC_INLINE uint32_t TIMER_GetCaptureIntFlag | ( | TIMER_T * | timer | ) |
__STATIC_INLINE uint32_t TIMER_GetCounter | ( | TIMER_T * | timer | ) |
__STATIC_INLINE uint32_t TIMER_GetIntFlag | ( | TIMER_T * | timer | ) |
uint32_t TIMER_GetModuleClock | ( | TIMER_T * | timer | ) |
This API is used to get the clock frequency of Timer.
[in] | timer | The base address of Timer module |
Definition at line 220 of file timer.c.
__STATIC_INLINE uint32_t TIMER_GetWakeupFlag | ( | TIMER_T * | timer | ) |
uint32_t TIMER_Open | ( | TIMER_T * | timer, |
uint32_t | u32Mode, | ||
uint32_t | u32Freq | ||
) |
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.
[in] | timer | The base address of Timer module |
[in] | u32Mode | Operation mode. Possible options are |
[in] | u32Freq | Target working frequency |
Definition at line 42 of file timer.c.
void TIMER_ResetCounter | ( | TIMER_T * | timer | ) |
void TIMER_SetTriggerSource | ( | TIMER_T * | timer, |
uint32_t | u32Src | ||
) |
This function is used to select the interrupt source used to trigger other modules.
[in] | timer | The base address of Timer module |
[in] | u32Src | Selects the interrupt source to trigger other modules. Could be: |
void TIMER_SetTriggerTarget | ( | TIMER_T * | timer, |
uint32_t | u32Mask | ||
) |
This function is used to set modules trigger by timer interrupt.
[in] | timer | The base address of Timer module |
[in] | u32Mask | The mask of modules (ADC ,PDMA and PWM) trigger by timer. Is the combination of |
__STATIC_INLINE void TIMER_Start | ( | TIMER_T * | timer | ) |