ads1115
0.2.0
|
Classes | |
class | ADS1115 |
struct | Config |
class | Threshold |
Enumerations | |
enum | ADDR : std::uint8_t { ADDR::GND = 0x48, ADDR::VDD = 0x49, ADDR::SDA = 0x4a, ADDR::SCL = 0x4b } |
This Enum describes the possible i2c bus addresses of a ADS1115. More... | |
enum | OS : std::uint16_t { OS::NON = 0x0000, OS::SINGLE_CONV = 0x8000 } |
enum | MUX : std::uint16_t { MUX::AIN0_AIN1 = 0x0000, MUX::AIN0_AIN3 = 0x1000, MUX::AIN1_AIN3 = 0x2000, MUX::AIN2_AIN3 = 0x3000, MUX::AIN0_GND = 0x4000, MUX::AIN1_GND = 0x5000, MUX::AIN2_GND = 0x6000, MUX::AIN3_GND = 0x7000 } |
enum | PGA : std::uint16_t { PGA::FS_6_144 = 0x0000, PGA::FS_4_096 = 0x0200, PGA::FS_2_048 = 0x0400, PGA::FS_1_024 = 0x0600, PGA::FS_0_512 = 0x0800, PGA::FS_0_256 = 0x0a00 } |
enum | MODE : std::uint16_t { MODE::CONT_CONV = 0x0000, MODE::SINGLE_CONV = 0x0100 } |
enum | DR : std::uint16_t { DR::SPS_8 = 0x0000, DR::SPS_16 = 0x0020, DR::SPS_32 = 0x0040, DR::SPS_64 = 0x0060, DR::SPS_128 = 0x0080, DR::SPS_250 = 0x00a0, DR::SPS_475 = 0x00c0, DR::SPS_860 = 0x00e0 } |
enum | COMP_MODE : std::uint16_t { COMP_MODE::TRAD_COMP = 0x0000, COMP_MODE::WINDOW_COMP = 0x0010 } |
enum | COMP_POL : std::uint16_t { COMP_POL::LOW = 0x0000, COMP_POL::HIGH = 0x0008 } |
enum | COMP_LAT : std::uint16_t { COMP_LAT::NON_LATCHING = 0x0000, COMP_LAT::LATCHING = 0x0004 } |
enum | COMP_QUE : std::uint16_t { COMP_QUE::ONE_CONV = 0x0000, COMP_QUE::TWO_CONV = 0x0001, COMP_QUE::FOUR_CONV = 0x0002, COMP_QUE::DISABLE_COMP = 0x0003 } |
Variables | |
constexpr std::uint8_t | conv_reg_addr = 0x00 |
Address of the conversion register. More... | |
constexpr std::uint8_t | conf_reg_addr = 0x01 |
Address of the config register. More... | |
constexpr std::uint8_t | lo_thresh_reg_addr = 0x02 |
Address of the low threshold register. More... | |
constexpr std::uint8_t | hi_thresh_reg_addr = 0x03 |
Address of the high threshold register. More... | |
const static std::unordered_map< PGA, double > | pga_voltage_map |
|
strong |
|
strong |
This enum describes the latching behaviour of the comparator. This enum controls whether the ALERT/RDY pin latches once asserted or clears once conversions are within the margin of the upper and lower threshold values. When COMP_LAT::NON_LATCHING, the ALERT/RDY pin does not latch when asserted. When COMP_LAT::LATCHING, the asserted ALERT/RDY pin remains latched until conversion data are read by the master or an appropriate SMBus alert response is sent by the master, the device responds with its address, and it is the lowest address currently asserting the ALERT/RDY bus line.
Enumerator | |
---|---|
NON_LATCHING | |
LATCHING |
Definition at line 129 of file parameters.hpp.
|
strong |
This enum describes the mode of the comparator of the ADS1115.
Enumerator | |
---|---|
TRAD_COMP | Traditional comparator with hysteresis. |
WINDOW_COMP | Window comparator. |
Definition at line 105 of file parameters.hpp.
|
strong |
This enum describes the comparator polarity of the ADS1115. This enum controls the polarity of the ALERT/RDY pin. When COMP_POL::LOW the comparator output is active low. When COMP_POL::HIGH the ALERT/RDY pin is active high.
Enumerator | |
---|---|
LOW | |
HIGH |
Definition at line 116 of file parameters.hpp.
|
strong |
This enum describes the state of the comparator queue. This enum performs two functions. When set to COMP_QUE::DISABLE_COMP, they disable the comparator function and put the ALERT/RDY pin into a high state. When set to any other value, they control the number of successive conversions exceeding the upper or lower thresholds required before asserting the ALERT/RDY pin.
Enumerator | |
---|---|
ONE_CONV | |
TWO_CONV | |
FOUR_CONV | |
DISABLE_COMP |
Definition at line 140 of file parameters.hpp.
|
strong |
This enum describes the possible data rates of the ADS1115.
Enumerator | |
---|---|
SPS_8 | DR = 8 SPS. |
SPS_16 | DR = 16 SPS. |
SPS_32 | DR = 32 SPS. |
SPS_64 | DR = 64 SPS. |
SPS_128 | DR = 128 SPS. |
SPS_250 | DR = 250 SPS. |
SPS_475 | DR = 475 SPS. |
SPS_860 | DR = 860 SPS. |
Definition at line 84 of file parameters.hpp.
|
strong |
This enum describes the operational modes of the ADS1115.
Enumerator | |
---|---|
CONT_CONV | Sets the ADS1115 to continuous conversion mode. |
SINGLE_CONV | Sets the ADS1115 to power-down single-shot mode. |
Definition at line 75 of file parameters.hpp.
|
strong |
This enum describes the possible values of the multiplexer bits of the configuration register. It is used to select the inputs from which the ADS1115 reads data.
Enumerator | |
---|---|
AIN0_AIN1 | |
AIN0_AIN3 | |
AIN1_AIN3 | |
AIN2_AIN3 | |
AIN0_GND | |
AIN1_GND | |
AIN2_GND | |
AIN3_GND |
Definition at line 43 of file parameters.hpp.
|
strong |
This Enum describes the possible values that can be writen to the operational status bit while the ADS1115 is in power down mode.
The operational status bit of the config register can only be writen when the ADS1115 is in power down mode.
Enumerator | |
---|---|
NON | No effect when the config register is writen. |
SINGLE_CONV | Starts a new conversion when the conversion register is writen. |
Definition at line 33 of file parameters.hpp.
|
strong |
This enum describes the possible values for the programable gain amplifier bits of the config register. This effectefly defines the full-scale of the analog inputs above which the output will be cliped.
Enumerator | |
---|---|
FS_6_144 | FS = |
FS_4_096 | FS = |
FS_2_048 | FS = |
FS_1_024 | FS = |
FS_0_512 | FS = |
FS_0_256 | FS = |
Definition at line 58 of file parameters.hpp.
|
constexpr |
Address of the config register.
Definition at line 13 of file parameters.hpp.
Referenced by ADS1115::ADS1115::read(), ADS1115::ADS1115::readRegConfig(), and ADS1115::ADS1115::setRegConfig().
|
constexpr |
Address of the conversion register.
Definition at line 11 of file parameters.hpp.
Referenced by ADS1115::ADS1115::read().
|
constexpr |
Address of the high threshold register.
Definition at line 17 of file parameters.hpp.
Referenced by ADS1115::ADS1115::readRegThreshold(), and ADS1115::ADS1115::setRegThreshold().
|
constexpr |
Address of the low threshold register.
Definition at line 15 of file parameters.hpp.
Referenced by ADS1115::ADS1115::readRegThreshold(), and ADS1115::ADS1115::setRegThreshold().
|
static |
Definition at line 147 of file parameters.hpp.
Referenced by ADS1115::ADS1115::fromVoltage(), and ADS1115::ADS1115::toVoltage().