Add support for 4-channel 12-bit ADC ADS1015
What
This MR adds support for single-shot measurements from the Texas Instruments 4-channel, 12-bit ADC device ADS1015 (datasheet here).
Support for single-ended measurements across all 4 analog input channels is supported via the usual ADCDevice API.
Single-ended measurements are attainable only with 11-bit precision.
The ADS1015 supports differential measurements between the analog inputs, at the full 12-bit resolution. The 12th bit is used as the sign bit in the ADC counts measurement. Support for differential measurements are supported between the following channel pairings:
- Analog inputs 0 (+) and 1 (-)
- Analog inputs 2 (+) and 3 (-)
Whether to perform single-ended or differential measurements is decided via configuration of the ADS1015, which can be set via the the ADS1015::setChannelMode(ADS1015::ChannelMode mode) public
method, where the ChannelMode enum is as follows:
enum class ChannelMode {
SingleEnded
,Differential
};
By default, the ADS1015 is in single-ended measurement mode and one can read from 0, 1, 2, or 3. When in differential mode, one can read only from channels 0 and 1 where differential channel 0 corresponds to the configuration with analog inputs 0(+) and 1(-) and where channel 1 corresponds to the configuration with analog inputs 2(+) and 3(-) used in the differential measurement.
The class ADS1015 is added under libDevCom and the Python bindings are provided, as well.