SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
BQ25896Adc.hpp
Go to the documentation of this file.
1
77#pragma once
78
79#include "../../PmicAdcBase.hpp"
80#include "BQ25896Core.hpp"
81
82class BQ25896Adc : public PmicAdcBase
83{
84public:
89 static constexpr uint8_t ADC_CONV_START = 0x80;
90 static constexpr uint8_t ADC_CONV_RATE = 0x40;
97 explicit BQ25896Adc(BQ25896Core &core);
98
99 ~BQ25896Adc() = default;
100
114
115 bool enableChannels(uint32_t mask) override;
116
123 bool disableChannels(uint32_t mask) override;
124
150 bool read(Channel ch, float &out) override;
151
163 bool startConversion();
164
178 bool setContinuousMode(bool enable);
179
180private:
181 BQ25896Core &_core;
182};
@license MIT License
~BQ25896Adc()=default
static constexpr uint8_t ADC_CONV_RATE
Enable continuous conversion mode (1Hz)
bool setContinuousMode(bool enable)
Enable or disable continuous ADC mode.
bool disableChannels(uint32_t mask) override
Disable ADC channels (no-op for BQ25896)
bool enableChannels(uint32_t mask) override
Enable one or more ADC channels.
static constexpr uint8_t ADC_CONV_START
ADC control flags.
bool read(Channel ch, float &out) override
Read ADC value for specified channel.
bool startConversion()
Start a single ADC conversion.
bool disableChannels(Channel mask)
Disable one or more ADC channels by Channel enum.
bool enableChannels(Channel mask)
Enable one or more ADC channels by Channel enum.
Channel
ADC channel bitmask.