Base class of ADS1100,ADS1110.
More...
#include <unit_ADS11xx.hpp>
|
| | UnitADS11XX (const uint8_t addr=DEFAULT_ADDRESS) |
| | Constructor.
|
| |
| virtual bool | begin () override |
| | Begin the unit.
|
| |
|
virtual void | update (const bool force=false) override |
| | Update the unit.
|
| |
| virtual bool | generalReset () |
| | General reset.
|
| |
|
|
int16_t | differentialValue () const |
| | Oldest measured differential value.
|
| |
|
float | differentialVoltage () const |
| | Oldest measured differential voltage(mV)
|
| |
|
| bool | readPGA (ads11xx::PGA &pga) |
| | Read the PGA.
|
| |
| bool | writePGA (const ads11xx::PGA pga) |
| | Write the PGA.
|
| |
|
|
bool | start_periodic_measurement (const uint8_t cfg_value) |
| |
|
bool | start_periodic_measurement () |
| |
|
bool | stop_periodic_measurement () |
| |
|
bool | measure_singleshot (ads11xx::Data &data, const uint8_t cfg_value) |
| |
|
bool | measure_singleshot (ads11xx::Data &data) |
| |
|
bool | read_config (uint8_t &v) |
| |
|
bool | write_config (const uint8_t v) |
| |
|
bool | read_measurement (uint8_t v[2]) |
| |
|
bool | is_data_ready () |
| |
| bool | detect_data_ready_flag (bool &goes_low) |
| | Checks whether bit 7 of the configuration register goes to 0 in continuous conversion mode.
|
| |
|
virtual bool | read_if_ready_in_periodic (uint8_t v[2]) |
| |
|
virtual uint32_t | get_interval (const uint8_t) |
| |
|
| M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitADS11XX, ads11xx::Data) |
| |
|
|
std::unique_ptr< m5::container::CircularBuffer< ads11xx::Data > > | _data {} |
| |
|
ads11xx::PGA | _pga {} |
| |
|
uint8_t | _rate {} |
| |
|
float | _vdd {2048.f} |
| |
|
float | _factor {1.0f} |
| |
Base class of ADS1100,ADS1110.
◆ UnitADS11XX()
| m5::unit::UnitADS11XX::UnitADS11XX |
( |
const uint8_t | addr = DEFAULT_ADDRESS | ) |
|
|
inlineexplicit |
◆ begin()
| bool m5::unit::UnitADS11XX::begin |
( |
| ) |
|
|
overridevirtual |
◆ detect_data_ready_flag()
| bool m5::unit::UnitADS11XX::detect_data_ready_flag |
( |
bool & | goes_low | ) |
|
|
protected |
Checks whether bit 7 of the configuration register goes to 0 in continuous conversion mode.
ADS1110 clears ST/DRDY when a new result is written to the output register. ADS1100 always reads ST/BSY as 1 in continuous conversion mode. Both chips have the same I2C address and default configuration, so this tells them apart
- Parameters
-
| [out] | goes_low | True if bit 7 went to 0 (ADS1110), false if it stayed 1 (ADS1100) |
- Returns
- True if the configuration register could be read
- Precondition
- The chip is in continuous conversion mode at the default sampling rate (state after begin())
◆ generalReset()
| bool m5::unit::UnitADS11XX::generalReset |
( |
| ) |
|
|
virtual |
General reset.
Reset using I2C general call
- Returns
- True if successful
- Warning
- This is a reset by General command, the command is also sent to all devices with I2C connections
-
Not supported with m5::I2C_Class. The bus hangs because m5::I2C_Class has no timeout on bus recovery after a general call reset
Reimplemented in m5::unit::UnitADS1100, and m5::unit::UnitADS1110.
◆ readPGA()
Read the PGA.
- Parameters
-
- Returns
- True if successful
◆ writePGA()
| bool m5::unit::UnitADS11XX::writePGA |
( |
const ads11xx::PGA | pga | ) |
|
Write the PGA.
- Parameters
-
- Returns
- True if successful
- Warning
- During periodic detection runs, an error is returned