26#ifndef DETERMINISTICESPASYNCWEBSERVER_ADS1115_H
27#define DETERMINISTICESPASYNCWEBSERVER_ADS1115_H
31#define ADS1115_REG_CONVERSION 0x00
32#define ADS1115_REG_CONFIG 0x01
uint16_t ads1115_config_single(uint8_t channel, uint8_t gain, uint8_t dr)
Build the 16-bit config word for a single-shot, single-ended reading of channel (0....
bool ads1115_begin(uint8_t addr)
Initialize the I2C bus for the ADS1115 at addr.
int32_t ads1115_raw_to_uv(int16_t raw, uint8_t gain)
Convert a signed 16-bit sample to microvolts for gain's full-scale range.
bool ads1115_read_raw(uint8_t channel, uint8_t gain, int16_t *raw)
Single-shot read of channel (0..3) at gain into raw.
bool ads1115_read_uv(uint8_t channel, uint8_t gain, int32_t *microvolts)
Single-shot read of channel at gain, converted to microvolts in microvolts.
Data-rate settings (DR register codes; samples per second).
static constexpr uint8_t ADS1115_DR_475
475 SPS
static constexpr uint8_t ADS1115_DR_128
128 SPS (default)
static constexpr uint8_t ADS1115_DR_16
16 SPS
static constexpr uint8_t ADS1115_DR_250
250 SPS
static constexpr uint8_t ADS1115_DR_64
64 SPS
static constexpr uint8_t ADS1115_DR_860
860 SPS
static constexpr uint8_t ADS1115_DR_8
8 SPS
static constexpr uint8_t ADS1115_DR_32
32 SPS
Programmable-gain settings (PGA register codes; full-scale +/- range). Config field values shifted in...
static constexpr uint8_t ADS1115_GAIN_2
+/- 2.048 V (default)
static constexpr uint8_t ADS1115_GAIN_4
+/- 1.024 V
static constexpr uint8_t ADS1115_GAIN_8
+/- 0.512 V
static constexpr uint8_t ADS1115_GAIN_1
+/- 4.096 V
static constexpr uint8_t ADS1115_GAIN_16
+/- 0.256 V
static constexpr uint8_t ADS1115_GAIN_TWOTHIRDS
+/- 6.144 V