This module define's generic APIs to configure and control a timer Depending on the SOC there can be different timer implementation's
For more details and example usage, see Timer
Timer is used by Clock to generate system ticks.
Currently below timer implementations are supported
- DM Timer (AM64x, AM243x)
- RTI Timer (AM263x, AM273x, AWR294x)
◆ TIME_IN_MICRO_SECONDS
#define TIME_IN_MICRO_SECONDS (1000000U) |
Macro defines the time in micro seconds
◆ MAX_TIMER_COUNT_VALUE
#define MAX_TIMER_COUNT_VALUE (0xFFFFFFFFU) |
Macro defines the maximum timer count value
◆ TIME_IN_MILLI_SECONDS
#define TIME_IN_MILLI_SECONDS (1000U) |
Macro defines the time in milli seconds
◆ TIME_IN_NANO_SECONDS
#define TIME_IN_NANO_SECONDS (1000000000U) |
Macro defines the time in nano seconds
◆ TIMERP_SHIFT_BY_EIGHT
#define TIMERP_SHIFT_BY_EIGHT (8U) |
Macro defines the shift by eight
◆ MAX_NUMBER_OF_CYCLES
#define MAX_NUMBER_OF_CYCLES (0xFFFFFFFFU) |
Macro defines the maximum number of cycles
◆ MAX_NUMBER_OF_COUNT
#define MAX_NUMBER_OF_COUNT (0xFFFFFFFFU) |
Macro defines the maximum number of count
◆ TimerP_Params_init()
Set default value for TimerP_Params.
- Parameters
-
params | [out] timer parameters initalized to default |
◆ TimerP_setup()
Setup timer but does not start it.
- Parameters
-
baseAddr | [in] HW timer base addresss |
params | [in] timer parameters |
◆ TimerP_start()
void TimerP_start |
( |
uint32_t |
baseAddr | ) |
|
Start timer.
- Parameters
-
baseAddr | [in] HW timer base addresss |
◆ TimerP_stop()
void TimerP_stop |
( |
uint32_t |
baseAddr | ) |
|
Stop timer.
- Parameters
-
baseAddr | [in] HW timer base addresss |
◆ TimerP_getCount()
uint32_t TimerP_getCount |
( |
uint32_t |
baseAddr | ) |
|
Get timer current count.
- Parameters
-
baseAddr | [in] HW timer base addresss |
- Returns
- current timer count value
◆ TimerP_getReloadCount()
uint32_t TimerP_getReloadCount |
( |
uint32_t |
baseAddr | ) |
|
Get timer reload count.
- Parameters
-
baseAddr | [in] HW timer base addresss |
- Returns
- reload count value
◆ TimerP_clearOverflowInt()
void TimerP_clearOverflowInt |
( |
uint32_t |
baseAddr | ) |
|
Clear timer overflow interrupt.
- Parameters
-
baseAddr | [in] HW timer base addresss |
◆ TimerP_isOverflowed()
uint32_t TimerP_isOverflowed |
( |
uint32_t |
baseAddr | ) |
|
Check if timer is overflowed.
- Note
- make sure to clear overflow status TimerP_clearOverflowInt
- Parameters
-
baseAddr | [in] HW timer base addresss |