Skip to main content

Module ads1115

Module ads1115 

Source
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§

ComparatorLatch
Whether the comparator latches (Config bit 2).
ComparatorMode
The comparator mode (Config bit 4).
ComparatorPolarity
The ALERT/RDY pin polarity (Config bit 3).
ComparatorQueue
The comparator queue, or disable (Config bits 1:0).
DataRate
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.