uOFW
Reverse engineered PSP kernel 6.60.
Loading...
Searching...
No Matches
Typedefs | Functions
System Timer Module

Typedefs

typedef s32(* SceSTimerCb) (s32 timerId, u32 count, void *common, u32)
 

Functions

s32 sceSTimerAlloc (void)
 
s32 sceSTimerFree (s32 timerId)
 
s32 sceSTimerStartCount (s32 timerId)
 
s32 sceSTimerGetCount (s32 timerId, s32 *count)
 
s32 sceSTimerResetCount (s32 timerId)
 
s32 sceSTimerStopCount (s32 timerId)
 
s32 sceSTimerSetPrscl (s32 timerId, s32 numerator, s32 denominator)
 
s32 sceSTimerSetHandler (s32 timerId, s32 compareValue, SceSTimerCb timeUpHandler, void *common)
 
s32 sceSTimerSetTMCY (s32 timerId, s32 arg1)
 

Detailed Description

Hardware timer management.

Typedef Documentation

◆ SceSTimerCb

typedef s32(* SceSTimerCb) (s32 timerId, u32 count, void *common, u32)

The time-up handler used by sceSTimerSetHandler().
When the hardware timer counter register matches the comparison value that was set by sceSTimerSetHandler(), the time-up handler is called.

When the value returned by the time-up handler is not equal to -1, timer
counting is stopped and the timer is set to "not in use".

The following arguments don't need to be used in the time-up routine.

Parameters
timerIDThe ID of the timer this time-up handler belongs to.
countCounter value.
commonPass the common argument specified in sceSTimerSetHandler().
unkUnknown.

Typically returns -1.

Function Documentation

◆ sceSTimerAlloc()

s32 sceSTimerAlloc ( void  )

Obtain a hardware timer. Cannot be called from an interrupt handler.

Returns
The timer id (greater than or equal to 0) on success.

◆ sceSTimerFree()

s32 sceSTimerFree ( s32  timerId)

Return the hardware timer that was obtained by sceSTimerAlloc().
Cannot be called from an interrupt handler.

Parameters
timerIdThe ID of the timer to return.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerStartCount()

s32 sceSTimerStartCount ( s32  timerId)

Start hardware timer counting. The timer is set to "in use" state.

Parameters
timerIdThe ID of the timer to start counting.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerGetCount()

s32 sceSTimerGetCount ( s32  timerId,
s32 *  count 
)

Read the current value of hardware timer's counter register.

Parameters
timerIdThe ID of the timer to obtain the timer counter value from.
countA pointer where the obtained counter value will be stored into.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerResetCount()

s32 sceSTimerResetCount ( s32  timerId)

Reset the hardware timer's counter register to 0.

Parameters
timerIdThe ID of the timer to reset its counter.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerStopCount()

s32 sceSTimerStopCount ( s32  timerId)

Stop the hardware timer counting and set the timer's state to "not in use".

Parameters
timerIdThe ID of the timer to stop its counting.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerSetPrscl()

s32 sceSTimerSetPrscl ( s32  timerId,
s32  numerator,
s32  denominator 
)

Set the prescale of a hardware timer. It can be only set on timers which are in the "not in use" state.
The input signal is divided into the resulting ratio. The ratio has to be less than 1/11.

Parameters
timerIdThe ID of the timer to set the prescale.
numeratorThe numerator of the prescale. Must not be 0.
denominatorThe denominator of the prescale. Must not be 0.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerSetHandler()

s32 sceSTimerSetHandler ( s32  timerId,
s32  compareValue,
SceSTimerCb  timeUpHandler,
void *  common 
)

Set the comparison value and the time-up handler of the hardware timer counter register.
The hardware timer counter register begins counting up from zero. If the counter register matches
the comparison value, an interrupt occurs, the counter register is returned to zero, and counting
continues. The time-up handler is called via this interrupt.

Parameters
timerIdThe ID of the timer to set the compare value and time-up handler.
compareValueThe count comparison value. Should not be greater 4194303 (~1/10 seconds) and less than 0.
timeUpHandlerSpecify the time-up handler that is called when count matches the comparison value.
Pass null to delete a registered time-up handler. This will also stop the hardware timer
counting.
commonPointer to memory common between time-up handler and general routines.
Returns
SCE_ERROR_OK on success.

◆ sceSTimerSetTMCY()

s32 sceSTimerSetTMCY ( s32  timerId,
s32  arg1 
)

Unknown purpose.

Parameters
timerIdThe ID of the timer.
arg1Unknown. Should not be less than 0 and greater 4194304.
Returns
SCE_ERROR_OK on success.