SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP202Channel.hpp
Go to the documentation of this file.
1
50#pragma once
51#include "AXP202Core.hpp"
52#include "../../PmicChannelBase.hpp"
53
62{
63public:
64 static constexpr uint8_t CHANNEL_COUNT = 7;
65
66 static constexpr uint8_t CH_DCDC2 = 0;
67 static constexpr uint8_t CH_DCDC3 = 1;
68 static constexpr uint8_t CH_LDO2 = 2;
69 static constexpr uint8_t CH_LDO3 = 3;
70 static constexpr uint8_t CH_LDO4 = 4;
71 static constexpr uint8_t CH_LDOio = 5;
72 static constexpr uint8_t CH_EXTEN = 6;
73
78 explicit AXP202Channel(AXP202Core &core);
79
80 ~AXP202Channel() = default;
81
88 bool enable(uint8_t channel, bool enable) override;
89
95 bool isEnabled(uint8_t channel) override;
96
114 bool setVoltage(uint8_t channel, uint16_t mV) override;
115
121 uint16_t getVoltage(uint8_t channel) override;
122
127 uint8_t count() const override;
128
134 Info getInfo(uint8_t channel) const override;
135
136private:
143 static const uint16_t ldo4Table_[16];
144
145 AXP202Core &_core;
146};
@license MIT License
AXP202 power channel enable and voltage control.
static constexpr uint8_t CH_LDO3
static constexpr uint8_t CH_DCDC2
static constexpr uint8_t CH_EXTEN
bool setVoltage(uint8_t channel, uint16_t mV) override
Set the output voltage of a power channel.
bool enable(uint8_t channel, bool enable) override
Enable or disable a power output channel.
uint16_t getVoltage(uint8_t channel) override
Get the current output voltage of a power channel.
uint8_t count() const override
Get the number of available power channels.
static constexpr uint8_t CH_LDO4
static constexpr uint8_t CH_LDO2
~AXP202Channel()=default
static constexpr uint8_t CH_LDOio
static constexpr uint8_t CHANNEL_COUNT
static constexpr uint8_t CH_DCDC3
Info getInfo(uint8_t channel) const override
Get information about a specific channel.
bool isEnabled(uint8_t channel) override
Check whether a power output channel is enabled.
PMIC power output channel base interface.
Static metadata for a single power output channel.