vitasdk
Documentation of the vitasdk
syscon.h
Go to the documentation of this file.
1
6#ifndef _PSP2KERN_SYSCON_H_
7#define _PSP2KERN_SYSCON_H_
8
10#include <psp2kern/types.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define SCE_SYSCON_PACKET_TX_CMD_LO 0
17#define SCE_SYSCON_PACKET_TX_CMD_HI 1
18#define SCE_SYSCON_PACKET_TX_LENGTH 2
19#define SCE_SYSCON_PACKET_TX_DATA(i) (3 + (i))
20
21#define SCE_SYSCON_PACKET_RX_STATUS_LO 0
22#define SCE_SYSCON_PACKET_RX_STATUS_HI 1
23#define SCE_SYSCON_PACKET_RX_LENGTH 2
24#define SCE_SYSCON_PACKET_RX_RESULT 3
25#define SCE_SYSCON_PACKET_RX_DATA(i) (4 + (i))
26
30
37
38typedef struct SceSysconPacket {
40 unsigned int status;
42 unsigned int unk;
43 unsigned char tx[32];
44 unsigned char rx[32];
45 unsigned int unk1[4];
46 int (*callback)(struct SceSysconPacket *packet, void *argp);
47 void *argp;
48 unsigned int time;
49 unsigned int unk2[5];
52
54typedef struct SceSysconDebugHandlers {
56 int size;
58 void (*start)(SceSysconPacket *packet);
60 void (*end)(SceSysconPacket *packet);
63
64typedef int (*SceSysconCmdExecAsyncCallback)(SceSysconPacket *packet, void *argp);
65
66typedef void (*SceSysconCallback)(int enable, void *argp);
67
74
83int ksceSysconCmdExec(SceSysconPacket *packet, unsigned int flags);
84
96
105int ksceSysconCmdSync(SceSysconPacket *packet, int noWait);
106
115int ksceSysconSetPowerMode(int type, int mode);
116
117int ksceSysconReadCommand(unsigned short cmd, void *buffer, SceSize size);
118int ksceSysconSendCommand(unsigned short cmd, const void *buffer, SceSize size);
119
126
135int ksceSysconCtrlLED(int led, int enable);
136
145
154
163
165
167
171
174int ksceSysconLogReadData(unsigned short, void *buff, SceSize size);
175
178
185
191unsigned long long ksceSysconGetBaryonTimestamp();
192
193int ksceSysconGetBatteryCalibData(int *, int *, int *, int *);
195int ksceSysconGetHardwareInfo2(int *, int *, int *);
201
203
207int ksceSysconLoadConfigstorageScript(unsigned short, const void *buff, SceSize size);
208int ksceSysconVerifyConfigstorageScript(unsigned short, const void *buff, SceSize size);
209
219
229
239
259
268
269#ifdef __cplusplus
270}
271#endif
272
273#endif /* _PSP2KERN_SYSCON_H_ */
274
#define VITASDK_BUILD_ASSERT_EQ(__size__, __name__)
Definition build_utils.h:13
uint8_t type
0 = read?, 1 = write?, 2 = feature?, 3 = ?
Definition bt.h:2
void * buffer
Definition bt.h:6
SceSize size
struct size(variable size)
Definition debug.h:0
int flags
Event flags.
Definition debug.h:3
int ksceSysconLogStart(void)
int ksceSysconGetHardwareInfo(void)
void * argp
Definition syscon.h:47
int ksceSysconEndConfigstorageTransaction(void)
int ksceSysconSetDebugHandlers(const SceSysconDebugHandlers *handlers)
Set the debug handlers.
int ksceSysconSetLowBatteryCallback(SceSysconCallback callback, void *argp)
Set the low battery callback, that will be ran when the battery is low.
int ksceSysconGetHardwareInfo2(int *, int *, int *)
int ksceSysconCtrlLED(int led, int enable)
Turn a LED on or off.
int ksceSysconGetControlsInfo(SceUInt32 *ctrl)
Get physics button control info.
int ksceSysconBeginConfigstorageTransaction(void)
unsigned int unk
Definition syscon.h:42
unsigned int status
Definition syscon.h:40
void(* end)(SceSysconPacket *packet)
Callback ran right after finishing running a packet, with a pointer to it passed as the first argumen...
Definition syscon.h:60
void(* start)(SceSysconPacket *packet)
Callback ran right before running a packet, with a pointer to it passed as the first argument.
Definition syscon.h:58
unsigned char rx[32]
Definition syscon.h:44
int ksceSysconCtrlSdPower(int power)
Set the SD power.
int ksceSysconWaitInitialized(void)
Waits until the syscon is initialized.
int ksceSysconCmdSync(SceSysconPacket *packet, int noWait)
Wait for the currently queued syscon packets to be executed, or check if any are in the queue.
int ksceSysconSendCommand(unsigned short cmd, const void *buffer, SceSize size)
int ksceSysconGetUsbDetStatus(int *)
int ksceSysconGetTemperatureLog(int *)
int ksceSysconCtrlRMRPower(int power)
Set the memory stick power.
int ksceSysconIsDownLoaderMode(void)
int ksceSysconCtrlManualChargeMode(int)
int ksceSysconClearTemperatureLog(int)
int ksceSysconGetBaryonVersion(void)
Get the baryon version.
int ksceSysconSetAlarmCallback(SceSysconCallback callback, void *argp)
Set the alarm callback, that will be ran when the alarm timer is passed.
unsigned long long ksceSysconGetBaryonTimestamp()
Get the baryon timestamp.
int ksceSysconIduModeSet(void)
int(* callback)(struct SceSysconPacket *packet, void *argp)
Definition syscon.h:46
SceSysconControl
Definition syscon.h:240
int ksceSysconShowModeClear(void)
unsigned int time
Definition syscon.h:48
int ksceSysconCommitConfigstorageTransaction(void)
void(* SceSysconCallback)(int enable, void *argp)
Definition syscon.h:66
int ksceSysconLogStartWaiting(void)
SceSysconCmd
Definition syscon.h:27
SceUID semaId
Definition syscon.h:41
unsigned int unk2[5]
Definition syscon.h:49
int ksceSysconVerifyConfigstorageScript(unsigned short, const void *buff, SceSize size)
int ksceSysconGetManualChargeMode(int *)
unsigned char tx[32]
Definition syscon.h:43
int(* SceSysconCmdExecAsyncCallback)(SceSysconPacket *packet, void *argp)
Definition syscon.h:64
int ksceSysconGetLogInfo(int *)
int ksceSysconIduModeClear(void)
int ksceSysconCmdExec(SceSysconPacket *packet, unsigned int flags)
Execute synchronously a syscon packet.
int ksceSysconGetManufacturesStatus(int *)
int ksceSysconReadCommand(unsigned short cmd, void *buffer, SceSize size)
int ksceSysconCmdExecAsync(SceSysconPacket *packet, unsigned int flags, SceSysconCmdExecAsyncCallback cb, void *argp)
Execute asynchronously a syscon packet.
int ksceSysconShowModeSet(void)
int ksceSysconGetBatteryCalibData(int *, int *, int *, int *)
int ksceSysconEnableHibernateIO(int)
int size
Structure size (probably, unused).
Definition syscon.h:56
unsigned int unk1[4]
Definition syscon.h:45
int ksceSysconCtrlHdmiCecPower(int power)
Set the ADV7533 HDMI CEC power.
int ksceSysconSetThermalAlertCallback(SceSysconCallback callback, void *argp)
Set the thermal alert callback, that will be ran when the temperature reaches a critical point.
SceSysconResetType
Definition syscon.h:31
int ksceSysconSetPowerMode(int type, int mode)
Reset the device.
int ksceSysconLogReadData(unsigned short, void *buff, SceSize size)
struct SceSysconPacket * next
Definition syscon.h:39
int ksceSysconLoadConfigstorageScript(unsigned short, const void *buff, SceSize size)
@ SCE_SYSCON_CTRL_VOLDOWN
Definition syscon.h:256
@ SCE_SYSCON_CTRL_POWER
Definition syscon.h:254
@ SCE_SYSCON_CTRL_LEFT
Definition syscon.h:244
@ SCE_SYSCON_CTRL_RIGHT
Definition syscon.h:242
@ SCE_SYSCON_CTRL_CROSS
Definition syscon.h:247
@ SCE_SYSCON_CTRL_CIRCLE
Definition syscon.h:246
@ SCE_SYSCON_CTRL_START
Definition syscon.h:252
@ SCE_SYSCON_CTRL_PSBUTTON
Definition syscon.h:253
@ SCE_SYSCON_CTRL_UP
Definition syscon.h:241
@ SCE_SYSCON_CTRL_SQUARE
Definition syscon.h:248
@ SCE_SYSCON_CTRL_VOLUP
Definition syscon.h:255
@ SCE_SYSCON_CTRL_DOWN
Definition syscon.h:243
@ SCE_SYSCON_CTRL_TRIANGLE
Definition syscon.h:245
@ SCE_SYSCON_CTRL_SELECT
Definition syscon.h:249
@ SCE_SYSCON_CTRL_HEADPHONE
Definition syscon.h:257
@ SCE_SYSCON_CTRL_RTRIGGER
Definition syscon.h:251
@ SCE_SYSCON_CTRL_LTRIGGER
Definition syscon.h:250
@ SCE_SYSCON_CMD_RESET_DEVICE
Definition syscon.h:28
@ SCE_SYSCON_RESET_TYPE_COLD_RESET
Definition syscon.h:34
@ SCE_SYSCON_RESET_TYPE_POWEROFF
Definition syscon.h:32
@ SCE_SYSCON_RESET_TYPE_SUSPEND
Definition syscon.h:33
@ SCE_SYSCON_RESET_TYPE_SOFT_RESET
Definition syscon.h:35
A set of debug handlers for syscon, that you can set in ksceSysconSetDebugHandlers().
Definition syscon.h:54
Definition syscon.h:38
unsigned int SceSize
Definition types.h:56
int SceUID
UIDs are used to describe many different kernel objects.
Definition types.h:90
uint32_t SceUInt32
Definition types.h:45