SELKIELogger
1.0.0
|
Classes | |
struct | i2c_ads1015_options |
Macros | |
#define | I2C_ADS1015_DEFAULTS {.scale = 1.0, .offset=0.0, .min=-INFINITY, .max=INFINITY} |
Functions | |
uint16_t | i2c_ads1015_read_configuration (const int busHandle, const int devAddr) |
Read configuration from device. More... | |
float | i2c_ads1015_read_mux (const int busHandle, const int devAddr, const uint16_t mux, const i2c_ads1015_options *opts) |
Generic ADS1015 read function. More... | |
float | i2c_ads1015_pga_to_scale_factor (const uint16_t config) |
Get number of millivolts represented by LSB at a given PGA value. More... | |
float | i2c_ads1015_read_ch0 (const int busHandle, const int devAddr, const void *opts) |
Get single-ended voltage measurement from channel 0. More... | |
float | i2c_ads1015_read_ch1 (const int busHandle, const int devAddr, const void *opts) |
Get single-ended voltage measurement from channel 1. More... | |
float | i2c_ads1015_read_ch2 (const int busHandle, const int devAddr, const void *opts) |
Get single-ended voltage measurement from channel 2. More... | |
float | i2c_ads1015_read_ch3 (const int busHandle, const int devAddr, const void *opts) |
Get single-ended voltage measurement from channel 3. More... | |
float | i2c_ads1015_read_diff_ch0_ch1 (const int busHandle, const int devAddr, const void *opts) |
Get differential voltage measurement between channels 0 and 1. More... | |
float | i2c_ads1015_read_diff_ch0_ch3 (const int busHandle, const int devAddr, const void *opts) |
Get differential voltage measurement between channels 0 and 3. More... | |
float | i2c_ads1015_read_diff_ch1_ch3 (const int busHandle, const int devAddr, const void *opts) |
Get differential voltage measurement between channels 1 and 3. More... | |
float | i2c_ads1015_read_diff_ch2_ch3 (const int busHandle, const int devAddr, const void *opts) |
Get differential voltage measurement between channels 2 and 3. More... | |
float i2c_ads1015_pga_to_scale_factor | ( | const uint16_t | config | ) |
Get number of millivolts represented by LSB at a given PGA value.
Convert PGA setting (or extract it from a 16bit configuration word) and return the value of the least significant bit in millivolts.
[in] | config | Configuration word or ADS1015_CONFIG_PGA_ constant |
Definition at line 55 of file I2C-ADS1015.c.
float i2c_ads1015_read_ch0 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get single-ended voltage measurement from channel 0.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 163 of file I2C-ADS1015.c.
float i2c_ads1015_read_ch1 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get single-ended voltage measurement from channel 1.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 177 of file I2C-ADS1015.c.
float i2c_ads1015_read_ch2 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get single-ended voltage measurement from channel 2.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 191 of file I2C-ADS1015.c.
float i2c_ads1015_read_ch3 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get single-ended voltage measurement from channel 3.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 206 of file I2C-ADS1015.c.
uint16_t i2c_ads1015_read_configuration | ( | const int | busHandle, |
const int | devAddr | ||
) |
Read configuration from device.
Connect to specified device address and read configuration
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 sensor |
Definition at line 40 of file I2C-ADS1015.c.
float i2c_ads1015_read_diff_ch0_ch1 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get differential voltage measurement between channels 0 and 1.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 220 of file I2C-ADS1015.c.
float i2c_ads1015_read_diff_ch0_ch3 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get differential voltage measurement between channels 0 and 3.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 234 of file I2C-ADS1015.c.
float i2c_ads1015_read_diff_ch1_ch3 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get differential voltage measurement between channels 1 and 3.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 248 of file I2C-ADS1015.c.
float i2c_ads1015_read_diff_ch2_ch3 | ( | const int | busHandle, |
const int | devAddr, | ||
const void * | opts | ||
) |
Get differential voltage measurement between channels 2 and 3.
Wrapper around i2c_ads1015_read_mux()
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 ADC |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 262 of file I2C-ADS1015.c.
float i2c_ads1015_read_mux | ( | const int | busHandle, |
const int | devAddr, | ||
const uint16_t | mux, | ||
const i2c_ads1015_options * | opts | ||
) |
Generic ADS1015 read function.
Perform a single shot conversion on an ADS1015 device using provided mux and pga values.
mux and pga parameters will be masked before use.
[in] | busHandle | Handle from i2c_openConnection() |
[in] | devAddr | I2C Address for an ADS1015 sensor |
[in] | mux | ADS1015_CONFIG_MUX_ constant to select measurement to be performed |
[in] | opts | Pointer to i2c_ads1015_options structure |
Definition at line 91 of file I2C-ADS1015.c.