ADCXX1C ADC device driver. More...

Detailed Description

ADCXX1C ADC device driver.

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m

Definition in file adcxx1c.h.

#include "periph/i2c.h"
#include "periph/gpio.h"
+ Include dependency graph for adcxx1c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  adcxx1c_params
 ADCxx1C params. More...
 
struct  adcxx1c
 ADCxx1C device descriptor. More...
 

Macros

#define ADCXX1C_I2C_ADDRESS   (0x54)
 ADCxx1C default address (ADCxx1C021 address)
 
#define ADCXX1C_RES_DEFAULT   (-1)
 ADC default resolution for device variants.
 

Typedefs

typedef struct adcxx1c_params adcxx1c_params_t
 ADCxx1C params.
 
typedef void(* adcxx1c_cb_t) (void *)
 ADCxx1C alert callback.
 
typedef struct adcxx1c adcxx1c_t
 ADCxx1C device descriptor.
 

Enumerations

enum  { ADCXX1C_RES_8BITS = 8, ADCXX1C_RES_10BITS = 10, ADCXX1C_RES_12BITS = 12 }
 ADC resolution. More...
 
enum  {
  ADCXX1C_CYCLE_DISABLED = 0, ADCXX1C_CYCLE_32, ADCXX1C_CYCLE_64, ADCXX1C_CYCLE_128,
  ADCXX1C_CYCLE_256, ADCXX1C_CYCLE_512, ADCXX1C_CYCLE_1024, ADCXX1C_CYCLE_2048
}
 Conversion interval configuration value. More...
 
enum  { ADCXX1C_OK = 0, ADCXX1C_NOI2C = -1, ADCXX1C_NODEV = -2, ADCXX1C_NODATA = -3 }
 Named return values. More...
 
enum  { ADCXX1C_ALERT_UNDER_RANGE = 1, ADCXX1C_ALERT_OVER_RANGE = 2 }
 Alert values. More...
 

Functions

int adcxx1c_init (adcxx1c_t *dev, const adcxx1c_params_t *params)
 Initialize an ADCxx1C ADC device. More...
 
int adcxx1c_read_raw (const adcxx1c_t *dev, int16_t *raw)
 Read a raw ADC value. More...
 
int adcxx1c_enable_alert (adcxx1c_t *dev, adcxx1c_cb_t cb, void *arg)
 Enable alert interrupt. More...
 
int adcxx1c_set_alert_parameters (const adcxx1c_t *dev, int16_t low_limit, int16_t high_limit, int16_t hysteresis)
 Set the alert parameters. More...
 
int adcxx1c_get_and_clear_alert (const adcxx1c_t *dev)
 Get alert source and clear it. More...