39#ifndef ADCXX1C_I2C_ADDRESS
40#define ADCXX1C_I2C_ADDRESS (0x54)
55#if defined(MODULE_ADC081C)
56#define ADCXX1C_RES_DEFAULT ADCXX1C_RES_8BITS
57#elif defined(MODULE_ADC101C)
58#define ADCXX1C_RES_DEFAULT ADCXX1C_RES_10BITS
59#elif defined(MODULE_ADC121C)
60#define ADCXX1C_RES_DEFAULT ADCXX1C_RES_12BITS
62#define ADCXX1C_RES_DEFAULT (-1)
63#error "ADCXX1C: Failed to select resolution: unknown ADCXX1C device variant!"
168 int16_t high_limit, int16_t hysteresis);
Low-level GPIO peripheral driver interface definitions.
int adcxx1c_get_and_clear_alert(const adcxx1c_t *dev)
Get alert source and clear it.
void(* adcxx1c_cb_t)(void *)
ADCxx1C alert callback.
int adcxx1c_set_alert_parameters(const adcxx1c_t *dev, int16_t low_limit, int16_t high_limit, int16_t hysteresis)
Set the alert parameters.
struct adcxx1c adcxx1c_t
ADCxx1C device descriptor.
int adcxx1c_init(adcxx1c_t *dev, const adcxx1c_params_t *params)
Initialize an ADCxx1C ADC device.
struct adcxx1c_params adcxx1c_params_t
ADCxx1C params.
int adcxx1c_read_raw(const adcxx1c_t *dev, int16_t *raw)
Read a raw ADC value.
int adcxx1c_enable_alert(adcxx1c_t *dev, adcxx1c_cb_t cb, void *arg)
Enable alert interrupt.
@ ADCXX1C_CYCLE_2048
Conversion cycle = Tconvert x 2048.
@ ADCXX1C_CYCLE_512
Conversion cycle = Tconvert x 512.
@ ADCXX1C_CYCLE_128
Conversion cycle = Tconvert x 128.
@ ADCXX1C_CYCLE_DISABLED
No cycle conversion.
@ ADCXX1C_CYCLE_256
Conversion cycle = Tconvert x 256.
@ ADCXX1C_CYCLE_64
Conversion cycle = Tconvert x 64.
@ ADCXX1C_CYCLE_32
Conversion cycle = Tconvert x 32.
@ ADCXX1C_CYCLE_1024
Conversion cycle = Tconvert x 1024.
@ ADCXX1C_RES_8BITS
8 bits resolution (ADC081C family)
@ ADCXX1C_RES_12BITS
12 bits resolution (ADC121C family)
@ ADCXX1C_RES_10BITS
10 bits resolution (ADC101C family)
@ ADCXX1C_ALERT_OVER_RANGE
Measured voltage exceeded Vhigh.
@ ADCXX1C_ALERT_UNDER_RANGE
Measured voltage fell below Vlow.
@ ADCXX1C_NODATA
no data available
@ ADCXX1C_NOI2C
I2C communication failed.
@ ADCXX1C_NODEV
no ADCXX1C device found on the bus
@ ADCXX1C_OK
everything was fine
uint_fast8_t i2c_t
Default i2c_t type definition.
Low-level I2C peripheral driver interface definition.
gpio_t alert_pin
alert pin (GPIO_UNDEF if not connected)
int16_t hysteresis
alert hysteresis
int16_t low_limit
alert low value
uint8_t cycle
conversion interval
int16_t high_limit
alert high value
ADCxx1C device descriptor.
adcxx1c_cb_t cb
alert callback
void * arg
alert callback param
adcxx1c_params_t params
device driver configuration