pspsdk-1.0+beta2
psppower.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
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  * $Id: psppower.h 2433 2008-10-15 10:00:27Z iwn $
14  */
15 #ifndef __POWER_H__
16 #define __POWER_H__
17 
18 #include <pspkerneltypes.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
27  /*indicates the power switch it pushed, putting the unit into suspend mode*/
28 #define PSP_POWER_CB_POWER_SWITCH 0x80000000
29 /*indicates the hold switch is on*/
30 #define PSP_POWER_CB_HOLD_SWITCH 0x40000000
31 /*what is standby mode?*/
32 #define PSP_POWER_CB_STANDBY 0x00080000
33 /*indicates the resume process has been completed (only seems to be triggered when another event happens)*/
34 #define PSP_POWER_CB_RESUME_COMPLETE 0x00040000
35 /*indicates the unit is resuming from suspend mode*/
36 #define PSP_POWER_CB_RESUMING 0x00020000
37 /*indicates the unit is suspending, seems to occur due to inactivity*/
38 #define PSP_POWER_CB_SUSPENDING 0x00010000
39 /*indicates the unit is plugged into an AC outlet*/
40 #define PSP_POWER_CB_AC_POWER 0x00001000
41 /*indicates the battery charge level is low*/
42 #define PSP_POWER_CB_BATTERY_LOW 0x00000100
43 /*indicates there is a battery present in the unit*/
44 #define PSP_POWER_CB_BATTERY_EXIST 0x00000080
45 /*unknown*/
46 #define PSP_POWER_CB_BATTPOWER 0x0000007F
47 
51 /* All */
52 #define PSP_POWER_TICK_ALL 0
53 /* Suspend */
54 #define PSP_POWER_TICK_SUSPEND 1
55 /* Display */
56 #define PSP_POWER_TICK_DISPLAY 6
57 
64 typedef void (*powerCallback_t)(int unknown, int powerInfo);
65 
74 int scePowerRegisterCallback(int slot, SceUID cbid);
75 
83 int scePowerUnregisterCallback(int slot);
84 
90 int scePowerIsPowerOnline(void);
91 
97 int scePowerIsBatteryExist(void);
98 
104 int scePowerIsBatteryCharging(void);
105 
110 
116 int scePowerIsLowBattery(void);
117 
124 
131 
135 int scePowerGetBatteryTemp(void);
136 
140 int scePowerGetBatteryElec(void);
141 
145 int scePowerGetBatteryVolt(void);
146 
151 int scePowerSetCpuClockFrequency(int cpufreq);
152 
157 int scePowerSetBusClockFrequency(int busfreq);
158 
164 
170 
176 
182 
188 
194 
208 int scePowerSetClockFrequency(int pllfreq, int cpufreq, int busfreq);
209 
220 int scePowerLock(int unknown);
221 
229 int scePowerUnlock(int unknown);
230 
239 int scePowerTick(int type);
240 
245 int scePowerGetIdleTimer(void);
246 
252 int scePowerIdleTimerEnable(int unknown);
253 
259 int scePowerIdleTimerDisable(int unknown);
260 
266 int scePowerRequestStandby(void);
267 
273 int scePowerRequestSuspend(void);
274 
275 
276 #ifdef __cplusplus
277 }
278 #endif
279 
280 #endif