PDK API Guide for J721E
|
TimerP interface
Files | |
file | TimerP.h |
Timer interface for the RTOS Porting Interface. | |
Data Structures | |
struct | TimerP_FreqHz |
Frequency-in-hertz struct. More... | |
struct | TimerP_Params |
Basic TimerP Parameters. More... | |
Functions | |
TimerP_Handle | TimerP_create (int32_t id, TimerP_Fxn tickFxn, const TimerP_Params *timerParams) |
Function to create a timer object. More... | |
TimerP_Status | TimerP_delete (TimerP_Handle timerHandle) |
Function to delete a timer. More... | |
TimerP_Status | TimerP_setPeriodMicroSecs (TimerP_Handle timerHandle, uint32_t microsecs) |
Function to set timer period specified in micro seconds A best-effort method will be used to set the period register. There might be a slight rounding error based on resolution of timer period register. If the timer frequency cannot support the requested period, i.e. the timer period register cannot support the requested period, then this function returns false. TimerP_setPeriodMicroSecs() invokes TimerP_stop() prior to setting the period and leaves the timer in the stopped state. More... | |
void | TimerP_Params_init (TimerP_Params *timerParams) |
Initialize params structure to default values. More... | |
TimerP_Status | TimerP_start (TimerP_Handle timerHandle) |
Function to start a timer. More... | |
TimerP_Status | TimerP_stop (TimerP_Handle timerHandle) |
Function to stop a timer. More... | |
TimerP_Status | TimerP_ClearInterrupt (TimerP_Handle timerHandle) |
Function to clear the interrupt of the timer. More... | |
uint64_t | TimerP_getTimeInUsecs (void) |
Typedefs | |
typedef void * | TimerP_Handle |
Opaque client reference to an instance of a TimerP. More... | |
typedef void(* | TimerP_Fxn) (uintptr_t arg) |
Prototype for a TimerP function. More... | |
Enumerations | |
enum | TimerP_Status { TimerP_OK = 0, TimerP_FAILURE = (-(int32_t) 1), TimerP_NOT_AVAILABLE = (-(int32_t) 2), TimerP_BAD_INT_NUM = (-(int32_t) 3), TimerP_ISR_HOOK_ERR = (-(int32_t) 4) } |
Status codes for TimerP APIs. More... | |
enum | TimerP_PeriodType { TimerP_PeriodType_MICROSECS, TimerP_PeriodType_COUNTS } |
Timer period units for TimerP APIs. More... | |
enum | TimerP_RunMode { TimerP_RunMode_CONTINUOUS, TimerP_RunMode_ONESHOT } |
Timer runtime modes for TimerP APIs. More... | |
enum | TimerP_StartMode { TimerP_StartMode_AUTO, TimerP_StartMode_USER } |
Timer start modes for TimerP APIs. More... | |
enum | TimerP_Timer64Mode { TimerP_Timer64Mode_64BITGPTIMER, TimerP_Timer64Mode_UNCHAINED, TimerP_Timer64Mode_CHAINED } |
Timer mode for 64 bit timers (KeyStone devices) More... | |
enum | TimerP_Timer64Half { TimerP_Timer64Half_LOWER, TimerP_Timer64Half_UPPER, TimerP_Timer64Half_DEFAULT } |
Timer half when 64 bit timer is split into two 32 bit timer (Keystone devices) More... | |
Macros | |
#define | TimerP_ANY (~(uint32_t)0u) |
#define | TimerP_MAX_PERIOD ((uint32_t)0xffffffffu) |
#define | TimerP_USE_DEFAULT (-(int32_t)1) |
#define TimerP_ANY (~(uint32_t)0u) |
Const used to specify any timer
#define TimerP_MAX_PERIOD ((uint32_t)0xffffffffu) |
Max value of Timer period for PeriodType_COUNTS
#define TimerP_USE_DEFAULT (-(int32_t)1) |
Use default values as provided by the OSAL package
typedef void* TimerP_Handle |
Opaque client reference to an instance of a TimerP.
A TimerP_Handle returned from the TimerP_create represents that instance. and then is used in the other instance based functions (e.g. TimerP_start, TimerP_stop, etc.).
typedef void(* TimerP_Fxn) (uintptr_t arg) |
Prototype for a TimerP function.
enum TimerP_Status |
enum TimerP_PeriodType |
enum TimerP_RunMode |
enum TimerP_StartMode |
enum TimerP_Timer64Mode |
enum TimerP_Timer64Half |
TimerP_Handle TimerP_create | ( | int32_t | id, |
TimerP_Fxn | tickFxn, | ||
const TimerP_Params * | timerParams | ||
) |
Function to create a timer object.
id | Timer Id |
tickFxn | Function that runs upon timer expiry |
timerParams | Pointer to the instance configuration parameters. NULL denotes to use the default parameters. The TimerP default parameters are noted in TimerP_Params_init. |
TimerP_Status TimerP_delete | ( | TimerP_Handle | timerHandle | ) |
Function to delete a timer.
timerHandle | A TimerP_Handle returned from TimerP_create |
TimerP_Status TimerP_setPeriodMicroSecs | ( | TimerP_Handle | timerHandle, |
uint32_t | microsecs | ||
) |
Function to set timer period specified in micro seconds A best-effort method will be used to set the period register. There might be a slight rounding error based on resolution of timer period register. If the timer frequency cannot support the requested period, i.e. the timer period register cannot support the requested period, then this function returns false. TimerP_setPeriodMicroSecs() invokes TimerP_stop() prior to setting the period and leaves the timer in the stopped state.
timerHandle | A TimerP_Handle returned from TimerP_create |
microsecs | time in micro seconds |
void TimerP_Params_init | ( | TimerP_Params * | timerParams | ) |
Initialize params structure to default values.
The default parameters are:
timerParams | Pointer to the instance configuration parameters. |
TimerP_Status TimerP_start | ( | TimerP_Handle | timerHandle | ) |
Function to start a timer.
timerHandle | A TimerP_Handle returned from TimerP_create |
TimerP_Status TimerP_stop | ( | TimerP_Handle | timerHandle | ) |
Function to stop a timer.
timerHandle | A TimerP_Handle returned from TimerP_create |
TimerP_Status TimerP_ClearInterrupt | ( | TimerP_Handle | timerHandle | ) |
Function to clear the interrupt of the timer.
timerHandle | A TimerP_Handle returned from TimerP_create |
uint64_t TimerP_getTimeInUsecs | ( | void | ) |