1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/* automatically generated by rust-bindgen 0.68.1 */

#[allow(unused_imports)]
use crate::psp2common::types::*;
#[allow(unused_imports)]
use crate::psp2kern::types::*;
#[allow(unused_imports)]
use crate::vitasdk::build_utils::*;

pub const SCE_SYSCON_PACKET_TX_CMD_LO: u32 = 0;
pub const SCE_SYSCON_PACKET_TX_CMD_HI: u32 = 1;
pub const SCE_SYSCON_PACKET_TX_LENGTH: u32 = 2;
pub const SCE_SYSCON_PACKET_RX_STATUS_LO: u32 = 0;
pub const SCE_SYSCON_PACKET_RX_STATUS_HI: u32 = 1;
pub const SCE_SYSCON_PACKET_RX_LENGTH: u32 = 2;
pub const SCE_SYSCON_PACKET_RX_RESULT: u32 = 3;
pub mod SceSysconCmd {
    pub type Type = crate::ctypes::c_uint;
    pub const SCE_SYSCON_CMD_RESET_DEVICE: Type = 12;
}
pub mod SceSysconResetType {
    pub type Type = crate::ctypes::c_uint;
    pub const SCE_SYSCON_RESET_TYPE_POWEROFF: Type = 0;
    pub const SCE_SYSCON_RESET_TYPE_SUSPEND: Type = 1;
    pub const SCE_SYSCON_RESET_TYPE_COLD_RESET: Type = 2;
    pub const SCE_SYSCON_RESET_TYPE_SOFT_RESET: Type = 17;
}
#[repr(C)]
pub struct SceSysconPacket {
    pub next: *mut SceSysconPacket,
    pub status: crate::ctypes::c_uint,
    pub semaId: SceUID,
    pub unk: crate::ctypes::c_uint,
    pub tx: [crate::ctypes::c_uchar; 32usize],
    pub rx: [crate::ctypes::c_uchar; 32usize],
    pub unk1: [crate::ctypes::c_uint; 4usize],
    pub callback: ::core::option::Option<
        unsafe extern "C" fn(
            packet: *mut SceSysconPacket,
            argp: *mut crate::ctypes::c_void,
        ) -> crate::ctypes::c_int,
    >,
    pub argp: *mut crate::ctypes::c_void,
    pub time: crate::ctypes::c_uint,
    pub unk2: [crate::ctypes::c_uint; 5usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SceSysconDebugHandlers {
    pub size: crate::ctypes::c_int,
    pub start: ::core::option::Option<unsafe extern "C" fn(packet: *mut SceSysconPacket)>,
    pub end: ::core::option::Option<unsafe extern "C" fn(packet: *mut SceSysconPacket)>,
}
pub type SceSysconCmdExecAsyncCallback = ::core::option::Option<
    unsafe extern "C" fn(
        packet: *mut SceSysconPacket,
        argp: *mut crate::ctypes::c_void,
    ) -> crate::ctypes::c_int,
>;
pub type SceSysconCallback = ::core::option::Option<
    unsafe extern "C" fn(enable: crate::ctypes::c_int, argp: *mut crate::ctypes::c_void),
>;
extern "C" {
    pub fn ksceSysconWaitInitialized() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCmdExec(
        packet: *mut SceSysconPacket,
        flags: crate::ctypes::c_uint,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCmdExecAsync(
        packet: *mut SceSysconPacket,
        flags: crate::ctypes::c_uint,
        cb: SceSysconCmdExecAsyncCallback,
        argp: *mut crate::ctypes::c_void,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCmdSync(
        packet: *mut SceSysconPacket,
        noWait: crate::ctypes::c_int,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconSetPowerMode(
        type_: crate::ctypes::c_int,
        mode: crate::ctypes::c_int,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconReadCommand(
        cmd: crate::ctypes::c_ushort,
        buffer: *mut crate::ctypes::c_void,
        size: SceSize,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconSendCommand(
        cmd: crate::ctypes::c_ushort,
        buffer: *const crate::ctypes::c_void,
        size: SceSize,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconSetDebugHandlers(
        handlers: *const SceSysconDebugHandlers,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCtrlLED(
        led: crate::ctypes::c_int,
        enable: crate::ctypes::c_int,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCtrlRMRPower(power: crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCtrlSdPower(power: crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCtrlHdmiCecPower(power: crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCtrlManualChargeMode(arg1: crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconEnableHibernateIO(arg1: crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconIduModeClear() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconIduModeSet() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconIsDownLoaderMode() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconLogStart() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconLogStartWaiting() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconLogReadData(
        arg1: crate::ctypes::c_ushort,
        buff: *mut crate::ctypes::c_void,
        size: SceSize,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconShowModeClear() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconShowModeSet() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetBaryonVersion() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetBaryonTimestamp() -> crate::ctypes::c_ulonglong;
}
extern "C" {
    pub fn ksceSysconGetBatteryCalibData(
        arg1: *mut crate::ctypes::c_int,
        arg2: *mut crate::ctypes::c_int,
        arg3: *mut crate::ctypes::c_int,
        arg4: *mut crate::ctypes::c_int,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetHardwareInfo() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetHardwareInfo2(
        arg1: *mut crate::ctypes::c_int,
        arg2: *mut crate::ctypes::c_int,
        arg3: *mut crate::ctypes::c_int,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetLogInfo(arg1: *mut crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetManualChargeMode(arg1: *mut crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetManufacturesStatus(arg1: *mut crate::ctypes::c_int)
        -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetTemperatureLog(arg1: *mut crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconGetUsbDetStatus(arg1: *mut crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconClearTemperatureLog(arg1: crate::ctypes::c_int) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconBeginConfigstorageTransaction() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconCommitConfigstorageTransaction() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconEndConfigstorageTransaction() -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconLoadConfigstorageScript(
        arg1: crate::ctypes::c_ushort,
        buff: *const crate::ctypes::c_void,
        size: SceSize,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconVerifyConfigstorageScript(
        arg1: crate::ctypes::c_ushort,
        buff: *const crate::ctypes::c_void,
        size: SceSize,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconSetAlarmCallback(
        callback: SceSysconCallback,
        argp: *mut crate::ctypes::c_void,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconSetLowBatteryCallback(
        callback: SceSysconCallback,
        argp: *mut crate::ctypes::c_void,
    ) -> crate::ctypes::c_int;
}
extern "C" {
    pub fn ksceSysconSetThermalAlertCallback(
        callback: SceSysconCallback,
        argp: *mut crate::ctypes::c_void,
    ) -> crate::ctypes::c_int;
}
pub mod SceSysconControl {
    pub type Type = crate::ctypes::c_uint;
    pub const SCE_SYSCON_CTRL_UP: Type = 1;
    pub const SCE_SYSCON_CTRL_RIGHT: Type = 2;
    pub const SCE_SYSCON_CTRL_DOWN: Type = 4;
    pub const SCE_SYSCON_CTRL_LEFT: Type = 8;
    pub const SCE_SYSCON_CTRL_TRIANGLE: Type = 16;
    pub const SCE_SYSCON_CTRL_CIRCLE: Type = 32;
    pub const SCE_SYSCON_CTRL_CROSS: Type = 64;
    pub const SCE_SYSCON_CTRL_SQUARE: Type = 128;
    pub const SCE_SYSCON_CTRL_SELECT: Type = 256;
    pub const SCE_SYSCON_CTRL_LTRIGGER: Type = 512;
    pub const SCE_SYSCON_CTRL_RTRIGGER: Type = 1024;
    pub const SCE_SYSCON_CTRL_START: Type = 2048;
    pub const SCE_SYSCON_CTRL_PSBUTTON: Type = 4096;
    pub const SCE_SYSCON_CTRL_POWER: Type = 16384;
    pub const SCE_SYSCON_CTRL_VOLUP: Type = 65536;
    pub const SCE_SYSCON_CTRL_VOLDOWN: Type = 131072;
    pub const SCE_SYSCON_CTRL_HEADPHONE: Type = 134217728;
}
extern "C" {
    pub fn ksceSysconGetControlsInfo(ctrl: *mut SceUInt32) -> crate::ctypes::c_int;
}