# psppower.h File Reference

Go to the source code of this file.

## Defines

#define | PSP_POWER_CB_POWER_SWITCH 0x80000000
| Power callback flags.
#define | PSP_POWER_CB_HOLD_SWITCH 0x40000000
#define | PSP_POWER_CB_STANDBY 0x00080000
#define | PSP_POWER_CB_RESUME_COMPLETE 0x00040000
#define | PSP_POWER_CB_RESUMING 0x00020000
#define | PSP_POWER_CB_SUSPENDING 0x00010000
#define | PSP_POWER_CB_AC_POWER 0x00001000
#define | PSP_POWER_CB_BATTERY_LOW 0x00000100
#define | PSP_POWER_CB_BATTERY_EXIST 0x00000080
#define | PSP_POWER_CB_BATTPOWER 0x0000007F

## Typedefs

typedef void(* | powerCallback_t )(int unknown, int powerInfo)
| Power Callback Function Definition.

## Functions

int | scePowerRegisterCallback (int slot, SceUID cbid)
| Register Power Callback Function.
int | scePowerIsPowerOnline (void)
| Check if unit is plugged in.
int | scePowerIsBatteryExist (void)
| Check if a battery is present.
int | scePowerIsBatteryCharging (void)
| Check if the battery is charging.
int | scePowerGetBatteryChargingStatus (void)
| Get the status of the battery charging.
int | scePowerIsLowBattery (void)
| Check if the battery is low.
int | scePowerGetBatteryLifePercent (void)
| Get battery life as integer percent.
int | scePowerGetBatteryLifeTime (void)
| Get battery life as time.
int | scePowerGetBatteryTemp (void)
| Get temperature of the battery.
int | scePowerGetBatteryElec (void)
| unknown? - crashes PSP in usermode
int | scePowerGetBatteryVolt (void)
| Get battery volt level.
int | scePowerSetCpuClockFrequency (int cpufreq)
| Set CPU Frequency.
int | scePowerSetBusClockFrequency (int busfreq)
| Set Bus Frequency.
int | scePowerGetCpuClockFrequency (void)
| Alias for scePowerGetCpuClockFrequencyInt.
int | scePowerGetCpuClockFrequencyInt (void)
| Get CPU Frequency as Integer.
float | scePowerGetCpuClockFrequencyFloat (void)
| Get CPU Frequency as Float.
int | scePowerGetBusClockFrequency (void)
| Alias for scePowerGetBusClockFrequencyInt.
int | scePowerGetBusClockFrequencyInt (void)
| Get Bus fequency as Integer.
float | scePowerGetBusClockFrequencyFloat (void)
| Get Bus frequency as Float.
int | scePowerSetClockFrequency (int cpufreq, int ramfreq, int busfreq)
| Set Clock Frequencies.
int | scePowerLock (int unknown)
| Lock power switch.
int | scePowerUnlock (int unknown)
| Unlock power switch.
int | scePowerTick (int unknown)
| Generate a power tick, preventing unit from powering off and turning off display.
int | scePowerGetIdleTimer (void)
| Get Idle timer.
int | scePowerIdleTimerEnable (int unknown)
| Enable Idle timer.
int | scePowerIdleTimerDisable (int unknown)
| Disable Idle timer.

## Define Documentation

#define PSP_POWER_CB_AC_POWER 0x00001000

#define PSP_POWER_CB_BATTERY_EXIST 0x00000080

#define PSP_POWER_CB_BATTERY_LOW 0x00000100

#define PSP_POWER_CB_BATTPOWER 0x0000007F

#define PSP_POWER_CB_HOLD_SWITCH 0x40000000

#define PSP_POWER_CB_POWER_SWITCH 0x80000000

| Power callback flags.

#define PSP_POWER_CB_RESUME_COMPLETE 0x00040000

#define PSP_POWER_CB_RESUMING 0x00020000

#define PSP_POWER_CB_STANDBY 0x00080000

#define PSP_POWER_CB_SUSPENDING 0x00010000

## Typedef Documentation

typedef void(* powerCallback_t)(int unknown, int powerInfo)

Power Callback Function Definition.

Parameters:

  | unknown | - unknown function, appears to cycle between 1,2 and 3
  | powerInfo | - combination of PSP_POWER_CB_ flags

## Function Documentation

int scePowerGetBatteryChargingStatus | ( | void |  | ) |

| Get the status of the battery charging.

int scePowerGetBatteryElec | ( | void |  | ) |

| unknown? - crashes PSP in usermode

int scePowerGetBatteryLifePercent | ( | void |  | ) |

Get battery life as integer percent.

Returns:
  battery charge percentage

int scePowerGetBatteryLifeTime | ( | void |  | ) |

| Get battery life as time.

int scePowerGetBatteryTemp | ( | void |  | ) |

| Get temperature of the battery.

int scePowerGetBatteryVolt | ( | void |  | ) |

| Get battery volt level.

int scePowerGetBusClockFrequency | ( | void |  | ) |

Alias for scePowerGetBusClockFrequencyInt.

Returns:
  frequency as int

float scePowerGetBusClockFrequencyFloat | ( | void |  | ) |

Get Bus frequency as Float.

Returns:
  frequency as float

int scePowerGetBusClockFrequencyInt | ( | void |  | ) |

Get Bus fequency as Integer.

Returns:
  frequency as int

int scePowerGetCpuClockFrequency | ( | void |  | ) |

Alias for scePowerGetCpuClockFrequencyInt.

Returns:
  frequency as int

float scePowerGetCpuClockFrequencyFloat | ( | void |  | ) |

Get CPU Frequency as Float.

Returns:
  frequency as float

int scePowerGetCpuClockFrequencyInt | ( | void |  | ) |

Get CPU Frequency as Integer.

Returns:
  frequency as int

int scePowerGetIdleTimer | ( | void |  | ) |

| Get Idle timer.

int scePowerIdleTimerDisable | ( | int | unknown | ) |

Disable Idle timer.

Parameters:

  | unknown | - pass 0

int scePowerIdleTimerEnable | ( | int | unknown | ) |

Enable Idle timer.

Parameters:

  | unknown | - pass 0

int scePowerIsBatteryCharging | ( | void |  | ) |

| Check if the battery is charging.

int scePowerIsBatteryExist | ( | void |  | ) |

| Check if a battery is present.

int scePowerIsLowBattery | ( | void |  | ) |

| Check if the battery is low.

int scePowerIsPowerOnline | ( | void |  | ) |

| Check if unit is plugged in.

int scePowerLock | ( | int | unknown | ) |

Lock power switch.

Note: if the power switch is toggled while locked it will fire immediately after being unlocked.

Parameters:

  | unknown | - pass 0

int scePowerRegisterCallback | ( | int | slot,
|  | SceUID | cbid
| ) |

Register Power Callback Function.

Parameters:

  | slot | - slot of the callback in the list
  | cbid | - callback id from calling sceKernelCreateCallback

int scePowerSetBusClockFrequency | ( | int | busfreq | ) |

Set Bus Frequency.

Parameters:

  | busfreq | - new BUS frequency, valid values are 1 - 167

int scePowerSetClockFrequency | ( | int | cpufreq,
|  | int | ramfreq,
|  | int | busfreq
| ) |

Set Clock Frequencies.

NOTE: Please use scePowerSetBusClockFrequency and scePowerSetCpuClockFrequency instead of this function for clock <= 222 and bus <= 111.

Parameters:

  | cpufreq | - cpu frequency, valid from 1-333
  | ramfreq | - ram frequency, valid from 1-333
  | busfreq | - bus frequency, valid from 1-166

int scePowerSetCpuClockFrequency | ( | int | cpufreq | ) |

Set CPU Frequency.

Parameters:

  | cpufreq | - new CPU frequency, valid values are 1 - 333

int scePowerTick | ( | int | unknown | ) |

Generate a power tick, preventing unit from powering off and turning off display.

Parameters:

  | unknown | - pass 0

int scePowerUnlock | ( | int | unknown | ) |

Unlock power switch.

Parameters:

  | unknown | - pass 0