API Reference
ADS122C04
CircuitPython driver for the Adafruit ADS122C04 24-Bit ADC - 4 Channel 2-kSPS - STEMMA QT / Qwiic
Author(s): Liz Clark
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_ads122c04.ads122c04.ADS122C04(i2c: busio.I2C, address: int = _DEFAULT_ADDR)
Driver for the ADS122C04 24-bit ADC.
- Parameters:
i2c (I2C) – The I2C bus the ADS122C04 is connected to.
address (int) – The I2C device address. Default is
0x40.
- static convert_to_temperature(raw_data: int) float
Convert a raw ADC reading to temperature (when in temperature sensor mode).
- property crc_mode: int
CRC mode selection. Use one of the
CRC_*constants.Note
Setting this property also updates the internal cache used by
read_data()and the register read/write helpers.
- property effective_gain: float
The effective gain considering PGA bypass and single-ended restrictions.
In single-ended mode the PGA is automatically bypassed and gain is limited to 1, 2, or 4. Read-only.
- property last_data_valid: bool
Trueif the most recentread_data()passed integrity validation.
- property pga: bool
PGA enable.
Trueto enable PGA,Falseto bypass.Note: the hardware register bit is PGA_BYPASS, so the sense is inverted.
- read_voltage() float
Read the ADC and return the value as a voltage.
- Returns:
Voltage in volts.
- Return type:
- property reference_voltage: float
Reference voltage used for voltage conversion calculations, in volts.
Defaults to 2.048 V (the internal reference). Set this to match your external reference if using
VREF_EXTERNALorVREF_SUPPLY.
- adafruit_ads122c04.ads122c04.CRC_CRC16 = 2
CRC16 enabled.
- adafruit_ads122c04.ads122c04.CRC_DISABLED = 0
CRC disabled.
- adafruit_ads122c04.ads122c04.CRC_INVERTED = 1
Inverted data output.
- adafruit_ads122c04.ads122c04.GAIN_1 = 0
Gain = 1.
- adafruit_ads122c04.ads122c04.GAIN_128 = 7
Gain = 128.
- adafruit_ads122c04.ads122c04.GAIN_16 = 4
Gain = 16.
- adafruit_ads122c04.ads122c04.GAIN_2 = 1
Gain = 2.
- adafruit_ads122c04.ads122c04.GAIN_32 = 5
Gain = 32.
- adafruit_ads122c04.ads122c04.GAIN_4 = 2
Gain = 4.
- adafruit_ads122c04.ads122c04.GAIN_64 = 6
Gain = 64.
- adafruit_ads122c04.ads122c04.GAIN_8 = 3
Gain = 8.
- adafruit_ads122c04.ads122c04.IDAC_1000UA = 6
1000 µA.
- adafruit_ads122c04.ads122c04.IDAC_100UA = 3
100 µA.
- adafruit_ads122c04.ads122c04.IDAC_10UA = 1
10 µA.
- adafruit_ads122c04.ads122c04.IDAC_1500UA = 7
1500 µA.
- adafruit_ads122c04.ads122c04.IDAC_250UA = 4
250 µA.
- adafruit_ads122c04.ads122c04.IDAC_500UA = 5
500 µA.
- adafruit_ads122c04.ads122c04.IDAC_50UA = 2
50 µA.
- adafruit_ads122c04.ads122c04.IDAC_OFF = 0
IDAC off.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_AIN0 = 1
IDAC connected to AIN0.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_AIN1 = 2
IDAC connected to AIN1.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_AIN2 = 3
IDAC connected to AIN2.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_AIN3 = 4
IDAC connected to AIN3.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_DISABLED = 0
IDAC disabled.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_REFN = 6
IDAC connected to REFN.
- adafruit_ads122c04.ads122c04.IDAC_ROUTE_REFP = 5
IDAC connected to REFP.
- adafruit_ads122c04.ads122c04.MUX_AIN0 = 8
AIN0 vs AVSS.
- Type:
Single-ended
- adafruit_ads122c04.ads122c04.MUX_AIN0_AIN1 = 0
AINP=AIN0, AINN=AIN1.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN0_AIN2 = 1
AINP=AIN0, AINN=AIN2.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN0_AIN3 = 2
AINP=AIN0, AINN=AIN3.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN1 = 9
AIN1 vs AVSS.
- Type:
Single-ended
- adafruit_ads122c04.ads122c04.MUX_AIN1_AIN0 = 3
AINP=AIN1, AINN=AIN0.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN1_AIN2 = 4
AINP=AIN1, AINN=AIN2.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN1_AIN3 = 5
AINP=AIN1, AINN=AIN3.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN2 = 10
AIN2 vs AVSS.
- Type:
Single-ended
- adafruit_ads122c04.ads122c04.MUX_AIN2_AIN3 = 6
AINP=AIN2, AINN=AIN3.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_AIN3 = 11
AIN3 vs AVSS.
- Type:
Single-ended
- adafruit_ads122c04.ads122c04.MUX_AIN3_AIN2 = 7
AINP=AIN3, AINN=AIN2.
- Type:
Differential
- adafruit_ads122c04.ads122c04.MUX_REFPN_4 = 12
(REFP-REFN)/4 monitor.
- adafruit_ads122c04.ads122c04.MUX_SHORTED = 14
Inputs shorted to (AVDD+AVSS)/2.
- adafruit_ads122c04.ads122c04.MUX_SUPPLY_4 = 13
(AVDD-AVSS)/4 monitor.
- adafruit_ads122c04.ads122c04.RATE_1000SPS = 6
1000 SPS (normal) / 2000 SPS (turbo).
- adafruit_ads122c04.ads122c04.RATE_175SPS = 3
175 SPS (normal) / 350 SPS (turbo).
- adafruit_ads122c04.ads122c04.RATE_20SPS = 0
20 SPS (normal) / 40 SPS (turbo).
- adafruit_ads122c04.ads122c04.RATE_330SPS = 4
330 SPS (normal) / 660 SPS (turbo).
- adafruit_ads122c04.ads122c04.RATE_45SPS = 1
45 SPS (normal) / 90 SPS (turbo).
- adafruit_ads122c04.ads122c04.RATE_600SPS = 5
600 SPS (normal) / 1200 SPS (turbo).
- adafruit_ads122c04.ads122c04.RATE_90SPS = 2
90 SPS (normal) / 180 SPS (turbo).
- adafruit_ads122c04.ads122c04.VREF_EXTERNAL = 1
External reference (REFP/REFN).
- adafruit_ads122c04.ads122c04.VREF_INTERNAL = 0
Internal 2.048V reference.
- adafruit_ads122c04.ads122c04.VREF_SUPPLY = 2
Analog supply (AVDD-AVSS).
AnalogIn
AnalogIn for ADC readings.
Author(s): Liz Clark
- class adafruit_ads122c04.analog_in.AnalogIn(adc: ADS122C04, pin: int)
AnalogIn-compatible wrapper for ADS122C04 single-ended readings.
Provides a
valueproperty scaled to a 16-bit unsigned range[0, 65535]and avoltageproperty in volts, matching the CircuitPythonanalogio.AnalogInAPI.- Parameters: