~aleteoryx/muditaos

ref: f16a18d9357699fef061bfa6a00206195bc4ea8e muditaos/module-bsp/board/rt1051/puretx/hal/battery_charger/BatteryCharger.hpp -rw-r--r-- 879 bytes
f16a18d9 — Marcin Smoczyński [BH-860] Decouple charger driver from system 4 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <hal/battery_charger/AbstractBatteryCharger.hpp>

namespace hal::battery
{
    class BatteryCharger : public AbstractBatteryCharger
    {
      public:
        explicit BatteryCharger(AbstractBatteryCharger::BatteryChargerEvents &eventsHandler);
        void init(xQueueHandle queueBatteryHandle, xQueueHandle queueChargerDetect) final;
        void deinit() final;
        void processStateChangeNotification(std::uint8_t notification) final;
        void setChargingCurrentLimit(std::uint8_t chargerType) final;
        int getBatteryVoltage() final;

      private:
        void checkBatteryChargerInterrupts();

        AbstractBatteryCharger::BatteryChargerEvents &eventsHandler;
    };
} // namespace hal::battery