I2C Analog-to-Digital Converter device driver.
More...
I2C Analog-to-Digital Converter device driver.
This driver works with ADS1013-5 and ADS1113-5.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
◆ anonymous enum
Named return values.
Enumerator |
---|
ADS101X_OK | everything was fine
|
ADS101X_NOI2C | I2C communication failed.
|
ADS101X_NODEV | no ADS101X device found on the bus
|
ADS101X_NODATA | no data available
|
Definition at line 60 of file ads101x.h.
◆ ads101x_alert_init()
Initialize an ADS101x/111x alert device.
- Parameters
-
[in,out] | dev | device descriptor |
[in] | params | device configuration |
- Returns
- zero on successful initialization, non zero on error
◆ ads101x_enable_alert()
Enable alert interrupt.
Alert settings have no effect on ADS1013 and ADS1113.
- Parameters
-
[in] | dev | device descriptor |
[in] | cb | callback called when the alert fires |
[in] | arg | callback argument |
- Returns
- zero on success, non zero on error
◆ ads101x_init()
Initialize an ADS101x/111x ADC device (ADC only)
- Parameters
-
[in,out] | dev | device descriptor |
[in] | params | device configuration |
- Returns
- zero on successful initialization, non zero on error
◆ ads101x_read_raw()
int ads101x_read_raw |
( |
const ads101x_t * |
dev, |
|
|
int16_t * |
raw |
|
) |
| |
Read a raw ADC value.
- Parameters
-
[in] | dev | device descriptor |
[out] | raw | read value |
- Returns
- zero on successful read, non zero on error
◆ ads101x_set_alert_parameters()
int ads101x_set_alert_parameters |
( |
const ads101x_alert_t * |
dev, |
|
|
int16_t |
low_limit, |
|
|
int16_t |
high_limit |
|
) |
| |
Set the alert parameters.
Alert settings have no effect on ADS1013 and ADS1113.
- Parameters
-
[in,out] | dev | device descriptor |
[in] | low_limit | alert low limit |
[in] | high_limit | alert high limit |
- Returns
- zero on success, non zero on error
◆ ads101x_set_mux_gain()
int ads101x_set_mux_gain |
( |
const ads101x_t * |
dev, |
|
|
uint8_t |
mux_gain |
|
) |
| |
Set mux and gain.
Mux settings have no effect on ADS1013-4 and ADS1113-4. Gain settings have no effect on ADS1013 and ADS1113.
- Parameters
-
[in] | dev | device descriptor |
[in] | mux_gain | mux and gain boolean values |
- Returns
- zero on successful read, non zero on error