PDK API Guide for J721E
TIMER_MGR Functions

Introduction

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

Functions

uint32_t CSL_timermgrGetRevision (const CSL_TimermgrCfg *pCfg)
 Return revision of the timer_mgr module. More...
 
uint32_t CSL_timermgrGetMaxTimers (const CSL_TimermgrCfg *pCfg)
 Return maximum number of timers available or being monitored. More...
 
int32_t CSL_timermgrSetMaxTimers (CSL_TimermgrCfg *pCfg, uint32_t maxTimers)
 Sets the maximum number of timers to be monitored. More...
 
int32_t CSL_timermgrSetTimerCnt (CSL_TimermgrCfg *pCfg, uint32_t timerNum, uint32_t timerCnt)
 Sets the counter value for a specific timer. More...
 
int32_t CSL_timermgrSetTimerEnable (CSL_TimermgrCfg *pCfg, uint32_t timerNum, bool bEnable)
 Enable or disable a specific timer. More...
 
int32_t CSL_timermgrEnableAllTimers (CSL_TimermgrCfg *pCfg)
 Enables all timers. More...
 
void CSL_timermgrSetEnable (CSL_TimermgrCfg *pCfg, bool bEnable)
 Enable or disable the timer_mgr. More...
 
int32_t CSL_timermgrIsTimerExpired (CSL_TimermgrCfg *pCfg, uint32_t timerNum)
 Return expiration status for a timer. More...
 
uint32_t CSL_timermgrGetExpiredTimers (CSL_TimermgrCfg *pCfg, uint32_t *pExpiredTimerNums)
 Return a list of expired timers. More...
 
int32_t CSL_timermgrTouchTimer (CSL_TimermgrCfg *pCfg, uint32_t timerNum)
 Touch a timer. More...
 
uint32_t CSL_timermgrGetCurrCnt (const CSL_TimermgrCfg *pCfg)
 Return the current timer_mgr counter value. More...
 
int32_t CSL_timermgrSetEventIdx (CSL_TimermgrCfg *pCfg, uint32_t timerNum, uint32_t eventIdx)
 Set the event index for a timer. More...
 
int32_t CSL_timermgrGetEventIdx (CSL_TimermgrCfg *pCfg, uint32_t timerNum)
 Get the event index for a timer. More...
 
int32_t CSL_timermgrEnableAutoReset (CSL_TimermgrCfg *pCfg, uint32_t timerNum, bool bEnable)
 Enable or disable the auto reset function for a timer. More...
 

Function Documentation

◆ CSL_timermgrGetRevision()

uint32_t CSL_timermgrGetRevision ( const CSL_TimermgrCfg pCfg)

Return revision of the timer_mgr module.

This function returns the contents of the timer_mgr revision register. Consult the timer_mgr module documentation for a description of the contents of the revision register.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
Returns
The 32-bit revision register is returned.

◆ CSL_timermgrGetMaxTimers()

uint32_t CSL_timermgrGetMaxTimers ( const CSL_TimermgrCfg pCfg)

Return maximum number of timers available or being monitored.

This function returns the maximum number of timers available or being monitored.

If this function is called before the CSL_timermgrSetMaxTimers function is called, the default maximum number of timers available is returned. Otherwise, the maxTimers value specified in the CSL_timermgrSetMaxTimers function call is returned.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
Returns
Maximum number of timers available or being monitored

◆ CSL_timermgrSetMaxTimers()

int32_t CSL_timermgrSetMaxTimers ( CSL_TimermgrCfg pCfg,
uint32_t  maxTimers 
)

Sets the maximum number of timers to be monitored.

This function sets the maximum number of timers to be monitored. All timer numbers >= to this value will be ignored by the timer_mgr.

This function will only operate when the timer_mgr is disabled. It is intended to be called during initial timer_mgr configuration.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
maxTimers[IN] Max number of timers to monitor
Returns
0 = Success -1 = Error: maxTimer is greater than that supported by the timer_mgr, or the timer_mgr is currently enabled

◆ CSL_timermgrSetTimerCnt()

int32_t CSL_timermgrSetTimerCnt ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum,
uint32_t  timerCnt 
)

Sets the counter value for a specific timer.

This function sets the counter value for the specified timer.

This function is intended to be called during initial configuration of the timer_mgr (before it is enabled). It can be called during timer_mgr operation to change an active timer's counter value, but more commonly the CSL_timermgrTouchTimer function should be called to reload the timer's counter value.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
timerCnt[IN] Counter value
Returns
0 = Success -1 = Error: timerNum is greater than that configured in the timer_mgr

◆ CSL_timermgrSetTimerEnable()

int32_t CSL_timermgrSetTimerEnable ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum,
bool  bEnable 
)

Enable or disable a specific timer.

This function enables or disables the specified timer.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
bEnable[IN] true = enable timer, false = disable it
Returns
0 = Success -1 = Error: timerNum is greater than that configured in the timer_mgr

◆ CSL_timermgrEnableAllTimers()

int32_t CSL_timermgrEnableAllTimers ( CSL_TimermgrCfg pCfg)

Enables all timers.

This function enables all timers (0..CSL_timermgrGetMaxTimers) that are currently configured in the timer_mgr.

This function will only operate when the timer_mgr is disabled. It is intended to be called during initial timer_mgr configuration.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
Returns
0 = Success -1 = Error: timerNum is greater than that configured in the timer_mgr

◆ CSL_timermgrSetEnable()

void CSL_timermgrSetEnable ( CSL_TimermgrCfg pCfg,
bool  bEnable 
)

Enable or disable the timer_mgr.

This function enables or disables the timer_mgr.

Before enabling the timer_mgr, you must set the maximum number of timers to be used (see CSL_timermgrSetMaxTimers), set the counter values for the desired timers (see CSL_timermgrSetTimerCnt), and enable desired timers (see CSL_timermgrSetTimerEnable and CSL_timermgrEnableAllTimers).

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
bEnable[IN] true = enable timer_mgr, false = disable it
Returns
None

◆ CSL_timermgrIsTimerExpired()

int32_t CSL_timermgrIsTimerExpired ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum 
)

Return expiration status for a timer.

This function returns the expiration status for the specified timer.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
Returns
0 = Success (timer is not expired) 1 = Success (timer is expired) -1 = Error: timerNum is greater than that configured in the timer_mgr

◆ CSL_timermgrGetExpiredTimers()

uint32_t CSL_timermgrGetExpiredTimers ( CSL_TimermgrCfg pCfg,
uint32_t *  pExpiredTimerNums 
)

Return a list of expired timers.

This function returns an array of timer numbers corresponding to the timers that have expired.

Note that the array must be large enough to contain the maximum number of timers configured via the CSL_timermgrSetMaxTimers function.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
pExpiredTimerNums[OUT] Pointer to an array where expired timer numbers are returned
Returns
The number of expired timers is returned. This value is used to determine the valid values in the array.

◆ CSL_timermgrTouchTimer()

int32_t CSL_timermgrTouchTimer ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum 
)

Touch a timer.

This function is used to touch (reload the count value) of the specified timer.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
Returns
0 = Success -1 = Error: timerNum is greater than that configured in the timer_mgr

◆ CSL_timermgrGetCurrCnt()

uint32_t CSL_timermgrGetCurrCnt ( const CSL_TimermgrCfg pCfg)

Return the current timer_mgr counter value.

This function returns the current timer_mgr counter value.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
Returns
The current timer_mgr counter value is returned.

◆ CSL_timermgrSetEventIdx()

int32_t CSL_timermgrSetEventIdx ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum,
uint32_t  eventIdx 
)

Set the event index for a timer.

This function is used to set the event index for the specified timer.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
eventIdx[IN] Event index
Returns
0 = Success -1 = Error: timerNum is greater than that configured in the timer_mgr

◆ CSL_timermgrGetEventIdx()

int32_t CSL_timermgrGetEventIdx ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum 
)

Get the event index for a timer.

This function is used to get the event index for the specified timer.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
Returns
-1 = Error: timerNum is greater than that configured in the timer_mgr Otherwise, the event index for the specified timer is returned

◆ CSL_timermgrEnableAutoReset()

int32_t CSL_timermgrEnableAutoReset ( CSL_TimermgrCfg pCfg,
uint32_t  timerNum,
bool  bEnable 
)

Enable or disable the auto reset function for a timer.

This function enables or disables the auto reset function for the specified timer.

Parameters
pCfg[IN] Pointer to the CSL_TimermgrCfg structure
timerNum[IN] Timer number (0..CSL_timermgrGetMaxTimers)
bEnable[IN] true = enable auto reset, false = disable it
Returns
0 = Success -1 = Error: timerNum is greater than that configured in the timer_mgr -2 = This feature is not available in the timermgr being used