M5Unit-METER 0.0.3 git rev:c518ea3
Loading...
Searching...
No Matches
m5::unit::UnitADS1115 Class Reference

ADS1115 unit. More...

#include <unit_ADS1115.hpp>

Inheritance diagram for m5::unit::UnitADS1115:
m5::unit::UnitADS111x m5::unit::UnitAVmeterBase m5::unit::UnitAmeter m5::unit::UnitVmeter

Public Member Functions

 UnitADS1115 (const uint8_t addr=DEFAULT_ADDRESS)
 
Configration
virtual bool writeMultiplexer (const ads111x::Mux mux) override
 Write the input multiplexer.
 
virtual bool writeGain (const ads111x::Gain gain) override
 Write the programmable gain amplifier.
 
virtual bool writeComparatorMode (const bool b) override
 Write the comparator mode.
 
virtual bool writeComparatorPolarity (const bool b) override
 Write the comparator polarity.
 
virtual bool writeLatchingComparator (const bool b) override
 Write the latching comparator.
 
virtual bool writeComparatorQueue (const ads111x::ComparatorQueue c) override
 Write the comparator queue.
 
- Public Member Functions inherited from m5::unit::UnitADS111x
 UnitADS111x (const uint8_t addr=DEFAULT_ADDRESS)
 
virtual bool begin () override
 
virtual void update (const bool force=false) override
 
bool generalReset ()
 General reset.
 
config_t config ()
 Gets the configration.
 
void config (const config_t &cfg)
 Set the configration.
 
float coefficient () const
 Coefficient value.
 
int16_t adc () const
 Oldest measured ADC.
 
bool startPeriodicMeasurement ()
 Start periodic measurement in the current settings.
 
bool startPeriodicMeasurement (const ads111x::Sampling rate, const ads111x::Mux mux, const ads111x::Gain gain, const ads111x::ComparatorQueue comp_que)
 Start periodic measurement.
 
bool stopPeriodicMeasurement ()
 Stop periodic measurement.
 
ads111x::Mux multiplexer () const
 Gets the input multiplexer.
 
ads111x::Gain gain () const
 Gets the programmable gain amplifier.
 
ads111x::Sampling samplingRate () const
 Gets the sampling rate.
 
bool comparatorMode () const
 Gets the comparator mode.
 
bool comparatorPolarity () const
 Gets the comparator polarity.
 
bool latchingComparator () const
 Gets the Latching comparator.
 
ads111x::ComparatorQueue comparatorQueue () const
 Gets the comparator queue.
 
bool writeSamplingRate (const ads111x::Sampling rate)
 Write the data rate

 
bool measureSingleshot (ads111x::Data &d, const uint32_t timeoutMillis=1000U)
 Measurement single shot.
 
bool readThreshold (int16_t &high, int16_t &low)
 Reads the threshold values.
 
bool writeThreshold (const int16_t high, const int16_t low)
 Write the threshold values.
 

Protected Member Functions

virtual bool start_periodic_measurement (const ads111x::Sampling rate, const ads111x::Mux mux, const ads111x::Gain gain, const ads111x::ComparatorQueue comp_que) override
 
- Protected Member Functions inherited from m5::unit::UnitADS111x
bool start_periodic_measurement ()
 
bool stop_periodic_measurement ()
 
bool read_adc_raw (ads111x::Data &d)
 
bool start_single_measurement ()
 
bool in_conversion ()
 
bool read_config (ads111x::Config &c)
 
bool write_config (const ads111x::Config &c)
 
void apply_interval (const ads111x::Sampling rate)
 
virtual void apply_coefficient (const ads111x::Gain gain)
 
bool write_multiplexer (const ads111x::Mux mux)
 
bool write_gain (const ads111x::Gain gain)
 
bool write_comparator_mode (const bool b)
 
bool write_comparator_polarity (const bool b)
 
bool write_latching_comparator (const bool b)
 
bool write_comparator_queue (const ads111x::ComparatorQueue c)
 
 M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitADS111x, ads111x::Data)
 

Additional Inherited Members

- Protected Attributes inherited from m5::unit::UnitADS111x
std::unique_ptr< m5::container::CircularBuffer< ads111x::Data > > _data {}
 
float _coefficient {}
 
ads111x::Config _ads_cfg {}
 
config_t _cfg {}
 

Detailed Description

ADS1115 unit.

Member Function Documentation

◆ start_periodic_measurement()

bool m5::unit::UnitADS1115::start_periodic_measurement ( const ads111x::Sampling rate,
const ads111x::Mux mux,
const ads111x::Gain gain,
const ads111x::ComparatorQueue comp_que )
overrideprotectedvirtual

Implements m5::unit::UnitADS111x.

◆ writeComparatorMode()

virtual bool m5::unit::UnitADS1115::writeComparatorMode ( const bool b)
inlineoverridevirtual

Write the comparator mode.

Implements m5::unit::UnitADS111x.

◆ writeComparatorPolarity()

virtual bool m5::unit::UnitADS1115::writeComparatorPolarity ( const bool b)
inlineoverridevirtual

Write the comparator polarity.

Implements m5::unit::UnitADS111x.

◆ writeComparatorQueue()

virtual bool m5::unit::UnitADS1115::writeComparatorQueue ( const ads111x::ComparatorQueue c)
inlineoverridevirtual

Write the comparator queue.

Implements m5::unit::UnitADS111x.

◆ writeGain()

virtual bool m5::unit::UnitADS1115::writeGain ( const ads111x::Gain gain)
inlineoverridevirtual

Write the programmable gain amplifier.

Implements m5::unit::UnitADS111x.

Reimplemented in m5::unit::UnitAVmeterBase.

◆ writeLatchingComparator()

virtual bool m5::unit::UnitADS1115::writeLatchingComparator ( const bool b)
inlineoverridevirtual

Write the latching comparator.

Implements m5::unit::UnitADS111x.

◆ writeMultiplexer()

virtual bool m5::unit::UnitADS1115::writeMultiplexer ( const ads111x::Mux mux)
inlineoverridevirtual

Write the input multiplexer.

Implements m5::unit::UnitADS111x.