Add support for changing the DS and DSi battery level

The DS battery level is configured via the SPI Power Management Device,
and the DSi's is configured via the I2C BPTWL. Add support for changing
these registers and add the "Power Management" dialog in the UI.
This commit is contained in:
Rayyan Ansari
2022-02-18 15:32:46 +00:00
committed by Arisotura
parent c3adf6f606
commit 2569c67a13
16 changed files with 1360 additions and 0 deletions

View File

@ -19,11 +19,28 @@
#ifndef DSI_I2C_H
#define DSI_I2C_H
#include "types.h"
namespace DSi_BPTWL
{
u8 GetBootFlag();
bool GetBatteryCharging();
void SetBatteryCharging(bool charging);
enum
{
batteryLevel_Critical = 0x0,
batteryLevel_AlmostEmpty = 0x1,
batteryLevel_Low = 0x3,
batteryLevel_Half = 0x7,
batteryLevel_ThreeQuarters = 0xB,
batteryLevel_Full = 0xF
};
u8 GetBatteryLevel();
void SetBatteryLevel(u8 batteryLevel);
}
namespace DSi_I2C