mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 09:40:07 +01:00
[ion/f730] Under-drive stop mode
This commit is contained in:
@@ -20,8 +20,10 @@ void Ion::Power::suspend(bool checkIfPowerKeyReleased) {
|
||||
}
|
||||
Device::shutdownPeripherals(isLEDActive);
|
||||
|
||||
PWR.CR()->setLPDS(true); // Turn the regulator off. Takes longer to wake up.
|
||||
PWR.CR()->setFPDS(true); // Put the flash to sleep. Takes longer to wake up.
|
||||
PWR.CR1()->setLPDS(true); // Turn the regulator off. Takes longer to wake up.
|
||||
PWR.CR1()->setFPDS(true); // Put the flash to sleep. Takes longer to wake up.
|
||||
PWR.CR1()->setLPUDS(true);
|
||||
PWR.CR1()->setUDEN(PWR::CR1::UnderDrive::Enable);
|
||||
CM4.SCR()->setSLEEPDEEP(!isLEDActive);
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -5,15 +5,22 @@
|
||||
|
||||
class PWR {
|
||||
public:
|
||||
class CR : Register32 {
|
||||
class CR1 : Register32 {
|
||||
public:
|
||||
enum class UnderDrive {
|
||||
Disable = 0,
|
||||
Enable = 3
|
||||
};
|
||||
REGS_BOOL_FIELD(LPDS, 0);
|
||||
REGS_BOOL_FIELD(PPDS, 1);
|
||||
REGS_BOOL_FIELD(FPDS, 9);
|
||||
REGS_BOOL_FIELD(LPUDS, 10);
|
||||
REGS_BOOL_FIELD(MRUDS, 11);
|
||||
REGS_FIELD_W(UDEN, UnderDrive, 19, 18);
|
||||
};
|
||||
|
||||
constexpr PWR() {};
|
||||
REGS_REGISTER_AT(CR, 0x00);
|
||||
REGS_REGISTER_AT(CR1, 0x00);
|
||||
private:
|
||||
constexpr uint32_t Base() const {
|
||||
return 0x40007000;
|
||||
|
||||
Reference in New Issue
Block a user