~aleteoryx/muditaos

ref: be057d28d438c76acfa50ffb6fac9b751d41d3de muditaos/module-bsp/drivers/pll/DriverPLL.hpp -rw-r--r-- 985 bytes
be057d28 — wojtekrzepecki [EGD 4449] display backlight (#1120) 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#ifndef PUREPHONE_DRIVERPLL_HPP
#define PUREPHONE_DRIVERPLL_HPP

#include <memory>

namespace drivers
{

    enum class PLLInstances
    {
        OSC_24M,
        PLL1_ARM,
        PLL2_PFD2,
        PLL3,
        PLL3_PFD0,
        PLL3_PFD1,
        PLL3_PFD2,
        PLL4_Audio,
        COUNT
    };

    struct DriverPLLParams
    {};

    class DriverPLL
    {
      public:
        static std::shared_ptr<DriverPLL> Create(const PLLInstances inst, const DriverPLLParams &params);

        DriverPLL(const DriverPLLParams &params) : parameters(params)
        {}

        virtual ~DriverPLL()
        {}

      protected:
        const DriverPLLParams parameters;

      private:
        static std::weak_ptr<DriverPLL> singleton[static_cast<uint32_t>(PLLInstances ::COUNT)];
    };

} // namespace drivers

#endif // PUREPHONE_DRIVERPLL_HPP