PDK API Guide for J721E
TimerP.h File Reference

Introduction

Timer interface for the RTOS Porting Interface.

============================================================================

The TimerP module can be used to create a timer (that is, to mark a timer for use) and configure it to call a tickFxn when the timer expires.

The timer can be configured as a one-shot or a continuous mode timer. The period can be specified in timer counts or microseconds. The timer interrupt always uses the Hwi dispatcher. The Timer tickFxn runs in the context of a Hwi thread. The Timer module automatically creates a

Hwi instance for the timer interrupt.

Go to the source code of this file.

Data Structures

struct  TimerP_FreqHz
 Frequency-in-hertz struct. More...
 
struct  TimerP_Params
 Basic TimerP Parameters. More...
 

Macros

#define TimerP_ANY   (~(uint32_t)0u)
 
#define TimerP_MAX_PERIOD   ((uint32_t)0xffffffffu)
 
#define TimerP_USE_DEFAULT   (-(int32_t)1)
 

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

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)