mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-26 18:07:30 -04:00
55 lines
848 B
C++
55 lines
848 B
C++
/*
|
|
* @file PowerManager.hpp
|
|
* @author Mateusz Piesta (mateusz.piesta@mudita.com)
|
|
* @date 12.09.19
|
|
* @brief
|
|
* @copyright Copyright (C) 2019 mudita.com
|
|
* @details
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PUREPHONE_POWERMANAGER_HPP
|
|
#define PUREPHONE_POWERMANAGER_HPP
|
|
|
|
#include <functional>
|
|
|
|
#include "bsp/lpm/bsp_lpm.hpp"
|
|
|
|
namespace sys {
|
|
|
|
class PowerManager{
|
|
|
|
public:
|
|
|
|
enum class Mode{
|
|
FullSpeed,
|
|
LowPowerRun,
|
|
LowPowerIdle,
|
|
Suspend
|
|
|
|
};
|
|
|
|
|
|
PowerManager();
|
|
~PowerManager();
|
|
|
|
int32_t Switch(const Mode mode);
|
|
int32_t PowerOff();
|
|
|
|
Mode GetCurrentMode(){return currentPowerMode;}
|
|
|
|
private:
|
|
|
|
std::unique_ptr<bsp::LowPowerMode> lowPowerControl;
|
|
|
|
Mode currentPowerMode = Mode ::FullSpeed;
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
#endif //PUREPHONE_POWERMANAGER_HPP
|