PSPSDK 2024-12-24
Loading...
Searching...
No Matches
psppower.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * psppower.h - Prototypes for the scePower library.
7 *
8 * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9 * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10 * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11 * Copyright (c) 2005 David Perry <tias_dp@hotmail.com>
12 *
13 */
14#ifndef __POWER_H__
15#define __POWER_H__
16
17#include <pspkerneltypes.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
26 /*indicates the power switch it pushed, putting the unit into suspend mode*/
27#define PSP_POWER_CB_POWER_SWITCH 0x80000000
28/*indicates the hold switch is on*/
29#define PSP_POWER_CB_HOLD_SWITCH 0x40000000
30/*what is standby mode?*/
31#define PSP_POWER_CB_STANDBY 0x00080000
32/*indicates the resume process has been completed (only seems to be triggered when another event happens)*/
33#define PSP_POWER_CB_RESUME_COMPLETE 0x00040000
34/*indicates the unit is resuming from suspend mode*/
35#define PSP_POWER_CB_RESUMING 0x00020000
36/*indicates the unit is suspending, seems to occur due to inactivity*/
37#define PSP_POWER_CB_SUSPENDING 0x00010000
38/*indicates the unit is plugged into an AC outlet*/
39#define PSP_POWER_CB_AC_POWER 0x00001000
40/*indicates the battery charge level is low*/
41#define PSP_POWER_CB_BATTERY_LOW 0x00000100
42/*indicates there is a battery present in the unit*/
43#define PSP_POWER_CB_BATTERY_EXIST 0x00000080
44/*unknown*/
45#define PSP_POWER_CB_BATTPOWER 0x0000007F
46
50/* All */
51#define PSP_POWER_TICK_ALL 0
52/* Suspend */
53#define PSP_POWER_TICK_SUSPEND 1
54/* Display */
55#define PSP_POWER_TICK_DISPLAY 6
56
63typedef void (*powerCallback_t)(int unknown, int powerInfo);
64
74
83
90
97
104
109
116
123
130
137
144
151
156
161
166
172
178
184
190
196
202
208
214
229
240int scePowerLock(int unknown);
241
249int scePowerUnlock(int unknown);
250
260
266
272int scePowerIdleTimerEnable(int unknown);
273
280
287
294
295
296#ifdef __cplusplus
297}
298#endif
299
300#endif
int SceUID
UIDs are used to describe many different kernel objects.
Definition pspkerneltypes.h:24
int scePowerSetCpuClockFrequency(int cpufreq)
Set CPU Frequency.
int scePowerIsBatteryCharging(void)
Check if the battery is charging.
int scePowerGetBatteryLifeTime(void)
Get battery life as time.
int scePowerIsPowerOnline(void)
Check if unit is plugged in.
int scePowerGetBatteryLifePercent(void)
Get battery life as integer percent.
int scePowerGetIdleTimer(void)
Get Idle timer.
int scePowerIdleTimerEnable(int unknown)
Enable Idle timer.
void(* powerCallback_t)(int unknown, int powerInfo)
Power Callback Function Definition.
Definition psppower.h:63
int scePowerGetBusClockFrequencyInt(void)
Get Bus fequency as Integer.
int scePowerIsBatteryExist(void)
Check if a battery is present.
int scePowerTick(int type)
Generate a power tick, preventing unit from powering off and turning off display.
int scePowerUnlock(int unknown)
Unlock power switch.
int scePowerGetCpuClockFrequencyInt(void)
Get CPU Frequency as Integer.
int scePowerLock(int unknown)
Lock power switch.
int scePowerIsSuspendRequired(void)
Check if a suspend is required.
int scePowerGetBusClockFrequency(void)
Alias for scePowerGetBusClockFrequencyInt.
int scePowerSetClockFrequency(int pllfreq, int cpufreq, int busfreq)
Set Clock Frequencies.
int scePowerRequestSuspend(void)
Request the PSP to go into suspend.
int scePowerGetBatteryFullCapacity(void)
Returns battery full capacity.
float scePowerGetCpuClockFrequencyFloat(void)
Get CPU Frequency as Float.
int scePowerIdleTimerDisable(int unknown)
Disable Idle timer.
int scePowerUnregisterCallback(int slot)
Unregister Power Callback Function.
int scePowerGetBatteryVolt(void)
Get battery volt level.
int scePowerGetBatteryRemainCapacity(void)
Returns battery remaining capacity.
int scePowerSetBusClockFrequency(int busfreq)
Set Bus Frequency.
int scePowerRegisterCallback(int slot, SceUID cbid)
Register Power Callback Function.
int scePowerGetBatteryChargingStatus(void)
Get the status of the battery charging.
float scePowerGetBusClockFrequencyFloat(void)
Get Bus frequency as Float.
int scePowerGetBatteryTemp(void)
Get temperature of the battery.
int scePowerGetBatteryElec(void)
unknown? - crashes PSP in usermode
int scePowerIsLowBattery(void)
Check if the battery is low.
int scePowerRequestStandby(void)
Request the PSP to go into standby.
int scePowerGetCpuClockFrequency(void)
Alias for scePowerGetCpuClockFrequencyInt.
struct _uidControlBlock * type
Definition pspsysmem_kernel.h:2
float x
Definition psptypes.h:0