vitasdk
Documentation of the vitasdk

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceSystimerForDriver_stub



Functions

 VITASDK_BUILD_ASSERT_EQ (4, SceSysTimerId)
 
SceSysTimerId ksceKernelSysTimerAlloc (SceSysTimerType timerType)
 Allocate one of the system's timers. More...
 
int ksceKernelSysTimerFree (SceSysTimerId timerId)
 Free an allocated system timer. More...
 
int ksceKernelSysTimerStartCount (SceSysTimerId timerId)
 Start a timer. More...
 
int ksceKernelSysTimerStopCount (SceSysTimerId timerId)
 Stop a timer. More...
 
int ksceKernelSysTimerSetClockSource (SceSysTimerId timerId, SceSysTimerClockSource clockSource, SceUInt8 prescaleFactor)
 Configure the source clock signal for a timer. More...
 
int ksceKernelSysTimerSetInterval (SceSysTimerId timerId, SceKernelSysClock interval)
 Set the timer interval. More...
 
int ksceKernelSysTimerSetHandler (SceSysTimerId timerId, SceSysTimerCallback callback, SceUInt32 targetCPU, void *pUserData)
 Set the interrupt callback handler for the timer. More...
 
int ksceKernelSysTimerGetCount (SceSysTimerId timerId, SceKernelSysClock *pCount)
 Get the timer count value. More...
 
int ksceKernelSysTimerSetCount (SceSysTimerId timerId, SceKernelSysClock count)
 Set the timer count value. More...
 
int ksceKernelSysTimerResetCount (SceSysTimerId timerId)
 Reset the timer count. More...
 

Typedefs

typedef SceInt32 SceSysTimerId
 
typedef void(* SceSysTimerCallback) (SceSysTimerId timer, void *pUserData)
 

Typedef Documentation

◆ SceSysTimerId

◆ SceSysTimerCallback

typedef void(* SceSysTimerCallback) (SceSysTimerId timer, void *pUserData)

Enumeration Type Documentation

◆ SceSysTimerType

Enumerator
SCE_SYSTIMER_TYPE_LONG 

64-bit timer

SCE_SYSTIMER_TYPE_WORD 

32-bit timer

◆ SceSysTimerClockSource

Enumerator
SCE_SYSTIMER_CLOCK_SOURCE_SYS 

190/222MHz Frequency. Controlled by kscePower[Get|Set]SysClockFrequency

SCE_SYSTIMER_CLOCK_SOURCE_48MHZ 

48MHz Frequency. Used by GpuEs4 and Threadmgr timers

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ()

VITASDK_BUILD_ASSERT_EQ ( ,
SceSysTimerId   
)

◆ ksceKernelSysTimerAlloc()

SceSysTimerId ksceKernelSysTimerAlloc ( SceSysTimerType  timerType)

Allocate one of the system's timers.

Parameters
timerType- One of SceSysTimerType.
Returns
The id of the new timer on success, < 0 on error.

◆ ksceKernelSysTimerFree()

int ksceKernelSysTimerFree ( SceSysTimerId  timerId)

Free an allocated system timer.

Parameters
timerId- The timer to free.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerStartCount()

int ksceKernelSysTimerStartCount ( SceSysTimerId  timerId)

Start a timer.

Parameters
timerId- The target timer.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerStopCount()

int ksceKernelSysTimerStopCount ( SceSysTimerId  timerId)

Stop a timer.

Parameters
timerId- The target timer.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerSetClockSource()

int ksceKernelSysTimerSetClockSource ( SceSysTimerId  timerId,
SceSysTimerClockSource  clockSource,
SceUInt8  prescaleFactor 
)

Configure the source clock signal for a timer.

The final input clock is determined as such:
inputClock = sourceClock / (prescaleFactor + 1)
Parameters
timerId- The target timer.
clockSource- The source of the clock signal.
prescaleFactor- The prescale factor applied to the clock signal.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerSetInterval()

int ksceKernelSysTimerSetInterval ( SceSysTimerId  timerId,
SceKernelSysClock  interval 
)

Set the timer interval.

The interval determines the count at which the timer will overflow to 0, and an interrupt will be fired.

Parameters
timerId- The target timer.
interval- The timer interval.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerSetHandler()

int ksceKernelSysTimerSetHandler ( SceSysTimerId  timerId,
SceSysTimerCallback  callback,
SceUInt32  targetCPU,
void *  pUserData 
)

Set the interrupt callback handler for the timer.

Parameters
timerId- The target timer.
callback- The callback function.
targetCPU- The CPU cores the interrupt can be handled from.
pUserData- User data to be passed to the callback.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerGetCount()

int ksceKernelSysTimerGetCount ( SceSysTimerId  timerId,
SceKernelSysClock pCount 
)

Get the timer count value.

Parameters
timerId- The target timer.
pCount- The variable to store the count to.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerSetCount()

int ksceKernelSysTimerSetCount ( SceSysTimerId  timerId,
SceKernelSysClock  count 
)

Set the timer count value.

Parameters
timerId- The target timer.
count- The count to set.
Returns
0 on success, < 0 on error.

◆ ksceKernelSysTimerResetCount()

int ksceKernelSysTimerResetCount ( SceSysTimerId  timerId)

Reset the timer count.

Parameters
timerId- The target timer.
Returns
0 on success, < 0 on error.