9 #include "../sf/service.h"
10 #include "../kernel/event.h"
41 Result psmGetBatteryChargePercentage(
u32 *out);
44 Result psmGetRawBatteryChargePercentage(
double *out);
45 Result psmIsEnoughPowerSupplied(
bool *out);
46 Result psmGetBatteryAgePercentage(
double *out);
PsmBatteryVoltageState
Definition: psm.h:19
@ PsmBatteryVoltageState_NeedsShutdown
Power state should transition to shutdown.
Definition: psm.h:20
@ PsmBatteryVoltageState_NeedsSleep
Power state should transition to sleep.
Definition: psm.h:21
@ PsmBatteryVoltageState_Normal
Everything is normal.
Definition: psm.h:23
@ PsmBatteryVoltageState_NoPerformanceBoost
Performance boost modes cannot be entered.
Definition: psm.h:22
Service * psmGetServiceSession(void)
Gets the Service object for the actual psm service session.
Result psmUnbindStateChangeEvent(PsmSession *s)
Cleanup version of psmBindStateChangeEvent. Must be called by the user once the PsmSession is done be...
void psmExit(void)
Exit psm.
PsmChargerType
Definition: psm.h:12
@ PsmChargerType_NotSupported
No common supported USB-PD modes.
Definition: psm.h:16
@ PsmChargerType_LowPower
Lower power supported USB-PD mode.
Definition: psm.h:15
@ PsmChargerType_Unconnected
No charger.
Definition: psm.h:13
@ PsmChargerType_EnoughPower
Full supported power.
Definition: psm.h:14
Result psmWaitStateChangeEvent(PsmSession *s, u64 timeout)
Wait on the Event setup by psmBindStateChangeEvent.
Result psmInitialize(void)
Initialize psm.
Result psmBindStateChangeEvent(PsmSession *s, bool ChargerType, bool PowerSupply, bool BatteryVoltage)
Wrapper func which opens a PsmSession and handles event setup.
Kernel-mode event structure.
Definition: event.h:13
IPsmSession.
Definition: psm.h:27
Event StateChangeEvent
autoclear=false
Definition: psm.h:29
Service object structure.
Definition: service.h:14
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21