~aleteoryx/muditaos

ref: ec56afc93393af6c84ba69a2cf9c5ca5d0b83cf2 muditaos/module-bsp/board/rt1051/bsp/lpm/RT1051LPM.hpp -rw-r--r-- 847 bytes
ec56afc9 — Maciej-Mudita [EGD-5381] Add Low Power Drivers 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#ifndef PUREPHONE_RT1051LPM_HPP
#define PUREPHONE_RT1051LPM_HPP

#include "bsp/lpm/bsp_lpm.hpp"
#include "drivers/gpio/DriverGPIO.hpp"
#include "CpuFreqLPM.hpp"

namespace bsp
{
    inline constexpr uint8_t OscillatorReadyCounterValue{127};

    class RT1051LPM : public LowPowerMode
    {
      public:
        RT1051LPM();
        int32_t PowerOff() override final;
        int32_t Reboot() override final;
        void SetCpuFrequency(CpuFrequency freq) final;
        void SwitchOscillatorSource(OscillatorSource source) final;

      private:
        std::shared_ptr<drivers::DriverGPIO> gpio;
        std::unique_ptr<bsp::CpuFreqLPM> CpuFreq;
    };

} // namespace bsp

#endif // PUREPHONE_RT1051LPM_HPP