psppower.h

Go to the documentation of this file.
00001 /*
00002  * PSP Software Development Kit - http://www.pspdev.org
00003  * -----------------------------------------------------------------------
00004  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
00005  *
00006  * psppower.h - Prototypes for the scePower library.
00007  *
00008  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
00009  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
00010  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
00011  * Copyright (c) 2005 David Perry <tias_dp@hotmail.com>
00012  *
00013  * $Id: psppower.h 2433 2008-10-15 10:00:27Z iwn $
00014  */
00015 #ifndef __POWER_H__
00016 #define __POWER_H__
00017 
00018 #include <pspkerneltypes.h>
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00027  /*indicates the power switch it pushed, putting the unit into suspend mode*/
00028 #define PSP_POWER_CB_POWER_SWITCH       0x80000000
00029 /*indicates the hold switch is on*/
00030 #define PSP_POWER_CB_HOLD_SWITCH        0x40000000
00031 /*what is standby mode?*/
00032 #define PSP_POWER_CB_STANDBY            0x00080000
00033 /*indicates the resume process has been completed (only seems to be triggered when another event happens)*/
00034 #define PSP_POWER_CB_RESUME_COMPLETE    0x00040000
00035 /*indicates the unit is resuming from suspend mode*/
00036 #define PSP_POWER_CB_RESUMING           0x00020000
00037 /*indicates the unit is suspending, seems to occur due to inactivity*/
00038 #define PSP_POWER_CB_SUSPENDING         0x00010000
00039 /*indicates the unit is plugged into an AC outlet*/
00040 #define PSP_POWER_CB_AC_POWER           0x00001000
00041 /*indicates the battery charge level is low*/
00042 #define PSP_POWER_CB_BATTERY_LOW        0x00000100
00043 /*indicates there is a battery present in the unit*/
00044 #define PSP_POWER_CB_BATTERY_EXIST      0x00000080
00045 /*unknown*/
00046 #define PSP_POWER_CB_BATTPOWER          0x0000007F
00047 
00051 /* All */
00052 #define PSP_POWER_TICK_ALL              0
00053 /* Suspend */
00054 #define PSP_POWER_TICK_SUSPEND  1
00055 /* Display */
00056 #define PSP_POWER_TICK_DISPLAY  6
00057 
00064 typedef void (*powerCallback_t)(int unknown, int powerInfo);
00065 
00074 int scePowerRegisterCallback(int slot, SceUID cbid);
00075 
00083 int scePowerUnregisterCallback(int slot);
00084 
00090 int scePowerIsPowerOnline(void);
00091 
00097 int scePowerIsBatteryExist(void);
00098 
00104 int scePowerIsBatteryCharging(void);
00105 
00109 int scePowerGetBatteryChargingStatus(void);
00110 
00116 int scePowerIsLowBattery(void);
00117 
00123 int scePowerGetBatteryLifePercent(void);
00124 
00130 int scePowerGetBatteryLifeTime(void);
00131 
00135 int scePowerGetBatteryTemp(void);
00136 
00140 int scePowerGetBatteryElec(void);
00141 
00145 int scePowerGetBatteryVolt(void);
00146 
00151 int scePowerSetCpuClockFrequency(int cpufreq);
00152 
00157 int scePowerSetBusClockFrequency(int busfreq);
00158 
00163 int scePowerGetCpuClockFrequency(void);
00164 
00169 int scePowerGetCpuClockFrequencyInt(void);
00170 
00175 float scePowerGetCpuClockFrequencyFloat(void);
00176 
00181 int scePowerGetBusClockFrequency(void);
00182 
00187 int scePowerGetBusClockFrequencyInt(void);
00188 
00193 float scePowerGetBusClockFrequencyFloat(void);
00194 
00208 int scePowerSetClockFrequency(int pllfreq, int cpufreq, int busfreq);
00209 
00220 int scePowerLock(int unknown);
00221 
00229 int scePowerUnlock(int unknown);
00230 
00239 int scePowerTick(int type);
00240 
00245 int scePowerGetIdleTimer(void);
00246 
00252 int scePowerIdleTimerEnable(int unknown);
00253 
00259 int scePowerIdleTimerDisable(int unknown);
00260 
00266 int scePowerRequestStandby(void);
00267 
00273 int scePowerRequestSuspend(void);
00274 
00275 
00276 #ifdef __cplusplus
00277 }
00278 #endif
00279 
00280 #endif