SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP2101Channel.hpp
Go to the documentation of this file.
1
31#pragma once
32#include "AXP2101Core.hpp"
33#include "../../PmicChannelBase.hpp"
34
57{
58public:
60 static constexpr uint8_t DCDC_COUNT = 5;
62 static constexpr uint8_t LDO_COUNT = 9;
64 static constexpr uint8_t CHANNEL_COUNT = DCDC_COUNT + LDO_COUNT;
65
66 static constexpr uint8_t CH_DCDC1 = 0;
67 static constexpr uint8_t CH_DCDC2 = 1;
68 static constexpr uint8_t CH_DCDC3 = 2;
69 static constexpr uint8_t CH_DCDC4 = 3;
70 static constexpr uint8_t CH_DCDC5 = 4;
71 static constexpr uint8_t CH_ALDO1 = 5;
72 static constexpr uint8_t CH_ALDO2 = 6;
73 static constexpr uint8_t CH_ALDO3 = 7;
74 static constexpr uint8_t CH_ALDO4 = 8;
75 static constexpr uint8_t CH_BLDO1 = 9;
76 static constexpr uint8_t CH_BLDO2 = 10;
77 static constexpr uint8_t CH_CPUSLDO = 11;
78 static constexpr uint8_t CH_DLDO1 = 12;
79 static constexpr uint8_t CH_DLDO2 = 13;
80
81 explicit AXP2101Channel(AXP2101Core &core);
82 ~AXP2101Channel() = default;
83
90 bool enable(uint8_t channel, bool enable) override;
91
97 bool isEnabled(uint8_t channel) override;
98
109 bool setVoltage(uint8_t channel, uint16_t mV) override;
110
116 uint16_t getVoltage(uint8_t channel) override;
117
122 uint8_t count() const override;
123
129 Info getInfo(uint8_t channel) const override;
130
131private:
137 bool isDCDC(uint8_t channel) const
138 {
139 return channel < DCDC_COUNT;
140 }
141
142 AXP2101Core &_core;
143};
@license MIT License
Power output channel (DCDC / LDO) control for the AXP2101 PMIC.
static constexpr uint8_t CH_ALDO4
static constexpr uint8_t CH_ALDO1
uint8_t count() const override
Get the total number of available power channels.
Info getInfo(uint8_t channel) const override
Get information about a specific power channel.
static constexpr uint8_t CH_DCDC1
static constexpr uint8_t CH_CPUSLDO
static constexpr uint8_t CH_ALDO3
static constexpr uint8_t CH_DCDC2
static constexpr uint8_t DCDC_COUNT
Number of DCDC converters.
static constexpr uint8_t CH_DCDC5
static constexpr uint8_t CH_ALDO2
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 setting for a channel.
static constexpr uint8_t CH_DCDC3
static constexpr uint8_t CH_DLDO2
~AXP2101Channel()=default
static constexpr uint8_t CH_BLDO1
static constexpr uint8_t LDO_COUNT
Number of LDO regulators.
static constexpr uint8_t CH_BLDO2
static constexpr uint8_t CH_DCDC4
bool setVoltage(uint8_t channel, uint16_t mV) override
Set the output voltage for a DCDC or LDO channel.
static constexpr uint8_t CH_DLDO1
bool isEnabled(uint8_t channel) override
Check whether a power output channel is enabled.
static constexpr uint8_t CHANNEL_COUNT
Total number of power channels.
Core I2C communication layer for the AXP2101 PMIC.
PMIC power output channel base interface.
Static metadata for a single power output channel.