mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Add enum for PsmBatteryVoltageState
This commit is contained in:
parent
94dc8f75f9
commit
27936900d0
@ -13,12 +13,19 @@ typedef enum {
|
|||||||
ChargerType_Usb = 2 ///< Other USB-C chargers
|
ChargerType_Usb = 2 ///< Other USB-C chargers
|
||||||
} ChargerType;
|
} ChargerType;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
PsmBatteryVoltageState_NeedsShutdown = 0, ///< Power state should transition to shutdown
|
||||||
|
PsmBatteryVoltageState_NeedsSleep = 1, ///< Power state should transition to sleep
|
||||||
|
PsmBatteryVoltageState_NoPerformanceBoost = 2, ///< Performance boost modes cannot be entered
|
||||||
|
PsmBatteryVoltageState_Normal = 3, ///< Everything is normal
|
||||||
|
} PsmBatteryVoltageState;
|
||||||
|
|
||||||
Result psmInitialize(void);
|
Result psmInitialize(void);
|
||||||
void psmExit(void);
|
void psmExit(void);
|
||||||
|
|
||||||
Result psmGetBatteryChargePercentage(u32 *out);
|
Result psmGetBatteryChargePercentage(u32 *out);
|
||||||
Result psmGetChargerType(ChargerType *out);
|
Result psmGetChargerType(ChargerType *out);
|
||||||
Result psmGetBatteryVoltageState(u32 *out);
|
Result psmGetBatteryVoltageState(PsmBatteryVoltageState *out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Wrapper func which handles event setup.
|
* @brief Wrapper func which handles event setup.
|
||||||
|
@ -95,8 +95,13 @@ Result psmGetChargerType(ChargerType *out) {
|
|||||||
return _psmGetOutU32(1, out);
|
return _psmGetOutU32(1, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result psmGetBatteryVoltageState(u32 *out) {
|
Result psmGetBatteryVoltageState(PsmBatteryVoltageState *out) {
|
||||||
return _psmGetOutU32(12, out);
|
u32 state;
|
||||||
|
Result rc = _psmGetOutU32(12, &state);
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
*out = (PsmBatteryVoltageState)state;
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Result _psmOpenSession(Service* out) {
|
static Result _psmOpenSession(Service* out) {
|
||||||
|
Loading…
Reference in New Issue
Block a user