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:

SceSysconForDriver_stub



Functions

 VITASDK_BUILD_ASSERT_EQ (0x80, SceSysconPacket)
 
 VITASDK_BUILD_ASSERT_EQ (0xC, SceSysconDebugHandlers)
 
int ksceSysconWaitInitialized (void)
 Waits until the syscon is initialized. More...
 
int ksceSysconCmdExec (SceSysconPacket *packet, unsigned int flags)
 Execute synchronously a syscon packet. More...
 
int ksceSysconCmdExecAsync (SceSysconPacket *packet, unsigned int flags, SceSysconCmdExecAsyncCallback cb, void *argp)
 Execute asynchronously a syscon packet. More...
 
int ksceSysconCmdSync (SceSysconPacket *packet, int noWait)
 Wait for the currently queued syscon packets to be executed, or check if any are in the queue. More...
 
int ksceSysconSetPowerMode (int type, int mode)
 Reset the device. More...
 
int ksceSysconReadCommand (unsigned short cmd, void *buffer, SceSize size)
 
int ksceSysconSendCommand (unsigned short cmd, const void *buffer, SceSize size)
 
int ksceSysconSetDebugHandlers (const SceSysconDebugHandlers *handlers)
 Set the debug handlers. More...
 
int ksceSysconCtrlLED (int led, int enable)
 Turn a LED on or off. More...
 
int ksceSysconCtrlRMRPower (int power)
 Set the memory stick power. More...
 
int ksceSysconCtrlSdPower (int power)
 Set the SD power. More...
 
int ksceSysconCtrlHdmiCecPower (int power)
 Set the ADV7533 HDMI CEC power. More...
 
int ksceSysconCtrlManualChargeMode (int)
 
int ksceSysconEnableHibernateIO (int)
 
int ksceSysconIduModeClear (void)
 
int ksceSysconIduModeSet (void)
 
int ksceSysconIsDownLoaderMode (void)
 
int ksceSysconLogStart (void)
 
int ksceSysconLogStartWaiting (void)
 
int ksceSysconLogReadData (unsigned short, void *buff, SceSize size)
 
int ksceSysconShowModeClear (void)
 
int ksceSysconShowModeSet (void)
 
int ksceSysconGetBaryonVersion (void)
 Get the baryon version. More...
 
unsigned long long ksceSysconGetBaryonTimestamp ()
 Get the baryon timestamp. More...
 
int ksceSysconGetBatteryCalibData (int *, int *, int *, int *)
 
int ksceSysconGetHardwareInfo (void)
 
int ksceSysconGetHardwareInfo2 (int *, int *, int *)
 
int ksceSysconGetLogInfo (int *)
 
int ksceSysconGetManualChargeMode (int *)
 
int ksceSysconGetManufacturesStatus (int *)
 
int ksceSysconGetTemperatureLog (int *)
 
int ksceSysconGetUsbDetStatus (int *)
 
int ksceSysconClearTemperatureLog (int)
 
int ksceSysconBeginConfigstorageTransaction (void)
 
int ksceSysconCommitConfigstorageTransaction (void)
 
int ksceSysconEndConfigstorageTransaction (void)
 
int ksceSysconLoadConfigstorageScript (unsigned short, const void *buff, SceSize size)
 
int ksceSysconVerifyConfigstorageScript (unsigned short, const void *buff, SceSize size)
 
int ksceSysconSetAlarmCallback (SceSysconCallback callback, void *argp)
 Set the alarm callback, that will be ran when the alarm timer is passed. More...
 
int ksceSysconSetLowBatteryCallback (SceSysconCallback callback, void *argp)
 Set the low battery callback, that will be ran when the battery is low. More...
 
int ksceSysconSetThermalAlertCallback (SceSysconCallback callback, void *argp)
 Set the thermal alert callback, that will be ran when the temperature reaches a critical point. More...
 
int ksceSysconGetControlsInfo (SceUInt32 *ctrl)
 Get physics button control info. More...
 

Typedefs

typedef int(* SceSysconCmdExecAsyncCallback) (SceSysconPacket *packet, void *argp)
 
typedef void(* SceSysconCallback) (int enable, void *argp)
 

Macros

#define SCE_SYSCON_PACKET_TX_CMD_LO   0
 
#define SCE_SYSCON_PACKET_TX_CMD_HI   1
 
#define SCE_SYSCON_PACKET_TX_LENGTH   2
 
#define SCE_SYSCON_PACKET_TX_DATA(i)   (3 + (i))
 
#define SCE_SYSCON_PACKET_RX_STATUS_LO   0
 
#define SCE_SYSCON_PACKET_RX_STATUS_HI   1
 
#define SCE_SYSCON_PACKET_RX_LENGTH   2
 
#define SCE_SYSCON_PACKET_RX_RESULT   3
 
#define SCE_SYSCON_PACKET_RX_DATA(i)   (4 + (i))
 

Data Structure Documentation

◆ SceSysconPacket

struct SceSysconPacket

Data Fields

struct SceSysconPacketnext
 
unsigned int status
 
SceUID semaId
 
unsigned int unk
 
unsigned char tx [32]
 
unsigned char rx [32]
 
unsigned int unk1 [4]
 
int(* callback )(struct SceSysconPacket *packet, void *argp)
 
void * argp
 
unsigned int time
 
unsigned int unk2 [5]
 

◆ SceSysconDebugHandlers

struct SceSysconDebugHandlers

A set of debug handlers for syscon, that you can set in ksceSysconSetDebugHandlers().

Data Fields

int size
 Structure size (probably, unused). More...
 
void(* start )(SceSysconPacket *packet)
 Callback ran right before running a packet, with a pointer to it passed as the first argument. More...
 
void(* end )(SceSysconPacket *packet)
 Callback ran right after finishing running a packet, with a pointer to it passed as the first argument. More...
 

Macro Definition Documentation

◆ SCE_SYSCON_PACKET_TX_CMD_LO

#define SCE_SYSCON_PACKET_TX_CMD_LO   0

◆ SCE_SYSCON_PACKET_TX_CMD_HI

#define SCE_SYSCON_PACKET_TX_CMD_HI   1

◆ SCE_SYSCON_PACKET_TX_LENGTH

#define SCE_SYSCON_PACKET_TX_LENGTH   2

◆ SCE_SYSCON_PACKET_TX_DATA

#define SCE_SYSCON_PACKET_TX_DATA (   i)    (3 + (i))

◆ SCE_SYSCON_PACKET_RX_STATUS_LO

#define SCE_SYSCON_PACKET_RX_STATUS_LO   0

◆ SCE_SYSCON_PACKET_RX_STATUS_HI

#define SCE_SYSCON_PACKET_RX_STATUS_HI   1

◆ SCE_SYSCON_PACKET_RX_LENGTH

#define SCE_SYSCON_PACKET_RX_LENGTH   2

◆ SCE_SYSCON_PACKET_RX_RESULT

#define SCE_SYSCON_PACKET_RX_RESULT   3

◆ SCE_SYSCON_PACKET_RX_DATA

#define SCE_SYSCON_PACKET_RX_DATA (   i)    (4 + (i))

Typedef Documentation

◆ SceSysconCmdExecAsyncCallback

typedef int(* SceSysconCmdExecAsyncCallback) (SceSysconPacket *packet, void *argp)

◆ SceSysconCallback

typedef void(* SceSysconCallback) (int enable, void *argp)

Enumeration Type Documentation

◆ SceSysconCmd

Enumerator
SCE_SYSCON_CMD_RESET_DEVICE 

◆ SceSysconResetType

Enumerator
SCE_SYSCON_RESET_TYPE_POWEROFF 
SCE_SYSCON_RESET_TYPE_SUSPEND 
SCE_SYSCON_RESET_TYPE_COLD_RESET 
SCE_SYSCON_RESET_TYPE_SOFT_RESET 

◆ SceSysconControl

Enumerator
SCE_SYSCON_CTRL_UP 
SCE_SYSCON_CTRL_RIGHT 
SCE_SYSCON_CTRL_DOWN 
SCE_SYSCON_CTRL_LEFT 
SCE_SYSCON_CTRL_TRIANGLE 
SCE_SYSCON_CTRL_CIRCLE 
SCE_SYSCON_CTRL_CROSS 
SCE_SYSCON_CTRL_SQUARE 
SCE_SYSCON_CTRL_SELECT 
SCE_SYSCON_CTRL_LTRIGGER 
SCE_SYSCON_CTRL_RTRIGGER 
SCE_SYSCON_CTRL_START 
SCE_SYSCON_CTRL_PSBUTTON 
SCE_SYSCON_CTRL_POWER 
SCE_SYSCON_CTRL_VOLUP 
SCE_SYSCON_CTRL_VOLDOWN 
SCE_SYSCON_CTRL_HEADPHONE 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/2]

VITASDK_BUILD_ASSERT_EQ ( 0x80  ,
SceSysconPacket   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/2]

VITASDK_BUILD_ASSERT_EQ ( 0xC  ,
SceSysconDebugHandlers   
)

◆ ksceSysconWaitInitialized()

int ksceSysconWaitInitialized ( void  )

Waits until the syscon is initialized.

Returns
0 on success.

◆ ksceSysconCmdExec()

int ksceSysconCmdExec ( SceSysconPacket packet,
unsigned int  flags 
)

Execute synchronously a syscon packet.

Parameters
packetThe packet to execute. Its tx member needs to be initialized.
flagsThe packet flags. Check SceSysconPacketFlags.
Returns
0 on success.

◆ ksceSysconCmdExecAsync()

int ksceSysconCmdExecAsync ( SceSysconPacket packet,
unsigned int  flags,
SceSysconCmdExecAsyncCallback  cb,
void *  argp 
)

Execute asynchronously a syscon packet.

Parameters
packetThe packet to execute. Its tx member needs to be initialized.
flagsThe packet flags. Check SceSysconPacketFlags.
callbackThe packet callback. Check the callback member of SceSysconPacket.
argpThe second argument that will be passed to the callback when executed.
Returns
0 on success.

◆ ksceSysconCmdSync()

int ksceSysconCmdSync ( SceSysconPacket packet,
int  noWait 
)

Wait for the currently queued syscon packets to be executed, or check if any are in the queue.

Parameters
packetThe packet you want to check or wait for, or NULL if you want to check or wait for all the currently running packets.
noWaitSet to 1 if you just want to check the packet status, or 0 if you want the function to return only when the packet queue is empty.
Returns
1 if packets are still running (and noWait was set to 1), 0 on success, < 0 otherwise.

◆ ksceSysconSetPowerMode()

int ksceSysconSetPowerMode ( int  type,
int  mode 
)

Reset the device.

Parameters
typeThe reset type value, one of SceSysconResetType.
modeThe resetting mode (?).
Returns
0 on success.

◆ ksceSysconReadCommand()

int ksceSysconReadCommand ( unsigned short  cmd,
void *  buffer,
SceSize  size 
)

◆ ksceSysconSendCommand()

int ksceSysconSendCommand ( unsigned short  cmd,
const void *  buffer,
SceSize  size 
)

◆ ksceSysconSetDebugHandlers()

int ksceSysconSetDebugHandlers ( const SceSysconDebugHandlers handlers)

Set the debug handlers.

Returns
0.

◆ ksceSysconCtrlLED()

int ksceSysconCtrlLED ( int  led,
int  enable 
)

Turn a LED on or off.

Parameters
ledThe LED id.
enableSet this value to 1 if you want the LED to turn on, or 0 if you want it to turn off.
Returns
0 on success.

◆ ksceSysconCtrlRMRPower()

int ksceSysconCtrlRMRPower ( int  power)

Set the memory stick power.

Parameters
powerThe new power value.
Returns
0 on success.

◆ ksceSysconCtrlSdPower()

int ksceSysconCtrlSdPower ( int  power)

Set the SD power.

Parameters
powerThe new power value.
Returns
0 on success.

◆ ksceSysconCtrlHdmiCecPower()

int ksceSysconCtrlHdmiCecPower ( int  power)

Set the ADV7533 HDMI CEC power.

Parameters
powerThe new power value.
Returns
0 on success.

◆ ksceSysconCtrlManualChargeMode()

int ksceSysconCtrlManualChargeMode ( int  )

◆ ksceSysconEnableHibernateIO()

int ksceSysconEnableHibernateIO ( int  )

◆ ksceSysconIduModeClear()

int ksceSysconIduModeClear ( void  )

◆ ksceSysconIduModeSet()

int ksceSysconIduModeSet ( void  )

◆ ksceSysconIsDownLoaderMode()

int ksceSysconIsDownLoaderMode ( void  )

◆ ksceSysconLogStart()

int ksceSysconLogStart ( void  )

◆ ksceSysconLogStartWaiting()

int ksceSysconLogStartWaiting ( void  )

◆ ksceSysconLogReadData()

int ksceSysconLogReadData ( unsigned short  ,
void *  buff,
SceSize  size 
)

◆ ksceSysconShowModeClear()

int ksceSysconShowModeClear ( void  )

◆ ksceSysconShowModeSet()

int ksceSysconShowModeSet ( void  )

◆ ksceSysconGetBaryonVersion()

int ksceSysconGetBaryonVersion ( void  )

Get the baryon version.

Returns
The baryon version.

◆ ksceSysconGetBaryonTimestamp()

unsigned long long ksceSysconGetBaryonTimestamp ( )

Get the baryon timestamp.

Returns
The baryon timestamp.

◆ ksceSysconGetBatteryCalibData()

int ksceSysconGetBatteryCalibData ( int *  ,
int *  ,
int *  ,
int *   
)

◆ ksceSysconGetHardwareInfo()

int ksceSysconGetHardwareInfo ( void  )

◆ ksceSysconGetHardwareInfo2()

int ksceSysconGetHardwareInfo2 ( int *  ,
int *  ,
int *   
)

◆ ksceSysconGetLogInfo()

int ksceSysconGetLogInfo ( int *  )

◆ ksceSysconGetManualChargeMode()

int ksceSysconGetManualChargeMode ( int *  )

◆ ksceSysconGetManufacturesStatus()

int ksceSysconGetManufacturesStatus ( int *  )

◆ ksceSysconGetTemperatureLog()

int ksceSysconGetTemperatureLog ( int *  )

◆ ksceSysconGetUsbDetStatus()

int ksceSysconGetUsbDetStatus ( int *  )

◆ ksceSysconClearTemperatureLog()

int ksceSysconClearTemperatureLog ( int  )

◆ ksceSysconBeginConfigstorageTransaction()

int ksceSysconBeginConfigstorageTransaction ( void  )

◆ ksceSysconCommitConfigstorageTransaction()

int ksceSysconCommitConfigstorageTransaction ( void  )

◆ ksceSysconEndConfigstorageTransaction()

int ksceSysconEndConfigstorageTransaction ( void  )

◆ ksceSysconLoadConfigstorageScript()

int ksceSysconLoadConfigstorageScript ( unsigned short  ,
const void *  buff,
SceSize  size 
)

◆ ksceSysconVerifyConfigstorageScript()

int ksceSysconVerifyConfigstorageScript ( unsigned short  ,
const void *  buff,
SceSize  size 
)

◆ ksceSysconSetAlarmCallback()

int ksceSysconSetAlarmCallback ( SceSysconCallback  callback,
void *  argp 
)

Set the alarm callback, that will be ran when the alarm timer is passed.

Parameters
callbackThe callback function.
argpThe second argument that will be passed to the callback.
Returns
0.

◆ ksceSysconSetLowBatteryCallback()

int ksceSysconSetLowBatteryCallback ( SceSysconCallback  callback,
void *  argp 
)

Set the low battery callback, that will be ran when the battery is low.

Parameters
callbackThe callback function.
argpThe second argument that will be passed to the callback.
Returns
0.

◆ ksceSysconSetThermalAlertCallback()

int ksceSysconSetThermalAlertCallback ( SceSysconCallback  callback,
void *  argp 
)

Set the thermal alert callback, that will be ran when the temperature reaches a critical point.

Parameters
callbackThe callback function.
argpThe second argument that will be passed to the callback.
Returns
0.

◆ ksceSysconGetControlsInfo()

int ksceSysconGetControlsInfo ( SceUInt32 ctrl)

Get physics button control info.

Parameters
[out]ctrl- The pointer of physics button control info output
Returns
0 on success.