ADS101x/111x ADC device driver. More...

Detailed Description

ADS101x/111x ADC device driver.

ADC and alert functionality are separated into two devices to prevent wasteful representations on muxed devices.

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m
Matthew Blue matth.nosp@m.ew.b.nosp@m.lue.n.nosp@m.euro.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition in file ads101x.h.

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

Go to the source code of this file.

Data Structures

struct  ads101x_params
 ADS101x/111x params. More...
 
struct  ads101x_alert_params
 ADS101x/111x alert params. More...
 
struct  ads101x
 ADS101x/111x device descriptor. More...
 
struct  ads101x_alert
 ADS101x/111x alert device descriptor. More...
 

Macros

#define CONFIG_ADS101X_I2C_ADDRESS   (0x48)
 Set ADS101x/111x default I2C address. More...
 

Typedefs

typedef struct ads101x_params ads101x_params_t
 ADS101x/111x params.
 
typedef struct ads101x_alert_params ads101x_alert_params_t
 ADS101x/111x alert params.
 
typedef struct ads101x ads101x_t
 ADS101x/111x device descriptor.
 
typedef void(* ads101x_alert_cb_t) (void *)
 ADS101x/111x alert callback.
 
typedef struct ads101x_alert ads101x_alert_t
 ADS101x/111x alert device descriptor.
 

Enumerations

enum  { ADS101X_OK = 0, ADS101X_NOI2C = -1, ADS101X_NODEV = -2, ADS101X_NODATA = -3 }
 Named return values. More...
 

Functions

int ads101x_init (ads101x_t *dev, const ads101x_params_t *params)
 Initialize an ADS101x/111x ADC device (ADC only) More...
 
int ads101x_alert_init (ads101x_alert_t *dev, const ads101x_alert_params_t *params)
 Initialize an ADS101x/111x alert device. More...
 
int ads101x_set_mux_gain (const ads101x_t *dev, uint8_t mux_gain)
 Set mux and gain. More...
 
int ads101x_read_raw (const ads101x_t *dev, int16_t *raw)
 Read a raw ADC value. More...
 
int ads101x_enable_alert (ads101x_alert_t *dev, ads101x_alert_cb_t cb, void *arg)
 Enable alert interrupt. More...
 
int ads101x_set_alert_parameters (const ads101x_alert_t *dev, int16_t low_limit, int16_t high_limit)
 Set the alert parameters. More...