[ion/f730] Under-drive stop mode

This commit is contained in:
Ruben Dashyan
2019-01-14 16:45:40 +01:00
parent ad9d89a756
commit 6ef35fc634
2 changed files with 13 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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;