#ifndef PUREPHONE_BSP_LPM_HPP #define PUREPHONE_BSP_LPM_HPP #include #include namespace bsp { class LowPowerMode { public: enum class CpuFrequency { Level_1, // 12 MHz Level_2, // 24 MHz Level_3, // 66 MHz Level_4, // 132 MHz Level_5, // 264 MHz Level_6 // 528 MHz }; LowPowerMode() = default; virtual ~LowPowerMode() = default; static std::optional> Create(); virtual int32_t PowerOff() = 0; virtual int32_t Reboot() = 0; virtual void SetCpuFrequency(CpuFrequency freq) = 0; [[nodiscard]] CpuFrequency GetCurrentFrequency() const noexcept; protected: CpuFrequency currentFrequency = CpuFrequency::Level_6; }; } // namespace bsp #endif //PUREPHONE_BSP_LPM_HPP