Expand description
Texas Instruments ADS1115 16-bit I2C analog-to-digital converter.
The ADS1115 turns an analog signal (a soil-moisture probe, a pH electrode, a divider) into a 16-bit reading, and a single Config register selects the input, the gain, the rate, and the comparator. This module builds and parses that Config register field by field and converts a raw conversion result into a voltage at the selected full-scale range, following the datasheet’s register tables and per-gain LSB sizes.
Modules§
- register
- The ADS1115 register addresses, selected by the address pointer.
Structs§
- Config
- A decoded ADS1115 Config register.
Enums§
- Comparator
Latch - Whether the comparator latches (Config bit 2).
- Comparator
Mode - The comparator mode (Config bit 4).
- Comparator
Polarity - The ALERT/RDY pin polarity (Config bit 3).
- Comparator
Queue - The comparator queue, or disable (Config bits 1:0).
- Data
Rate - The output data rate (Config bits 7:5), in samples per second.
- Mode
- The conversion mode (Config bit 8).
- Mux
- The input multiplexer setting (Config bits 14:12).
- Pga
- The programmable gain amplifier’s full-scale range (Config bits 11:9).
Constants§
- CONFIG_
RESET - The power-on value of the Config register (0x8583).
Functions§
- to_
nanovolts - Converts a raw conversion result to nanovolts at the selected full-scale range.
- to_
volts - Converts a raw conversion result to volts at the selected full-scale range.