Default configuration for ADS101x/111x devices. More...

Detailed Description

#include "periph/i2c.h"
#include "saul_reg.h"
#include "ads1x1x.h"
#include "ads1x1x_internal.h"
+ Include dependency graph for ads1x1x_params.h:

Go to the source code of this file.

Variables

static const ads1x1x_params_t ads1x1x_params []
 ADS1X1X defaults if not defined for a board or application. More...
 
static const ads1x1x_alert_params_t ads1x1x_alert_params []
 ADS1X1X alert defaults if not defined for a board or application. More...
 
static const saul_reg_info_t ads1x1x_saul_info []
 Additional meta information to keep in the SAUL registry. More...
 

Set default configuration parameters for the ADS101x/111x driver

#define ADS1X1X_PARAM_I2C   (I2C_DEV(0))
 Default I2C bus.
 
#define ADS1X1X_PARAM_ADDR   (0x48)
 Default I2C address.
 
#define ADS1X1X_PARAM_MUX   (ADS1X1X_AIN0_DIFFM_AIN1)
 Default multiplexer configuration.
 
#define ADS1X1X_PARAM_ALERT_PIN   (GPIO_UNDEF)
 Default alert pin configuration.
 
#define ADS1X1X_PARAM_LOW_LIMIT   (10000U)
 Default low limit for alert.
 
#define ADS1X1X_PARAM_HIGH_LIMIT   (20000U)
 Default high limit for alert.
 
#define ADS1X1X_PARAM_PGA   (ADS1X1X_PGA_FSR_2V048)
 Default programmable gain amplifier configuration.
 
#define ADS1X1X_PARAM_DATAR   ADS1X1X_DATAR_UNDEF
 Default data rate configuration set to undefined.
 
#define ADS1X1X_PARAM_MODE   (ADS1X1X_MODE_SINGLE)
 Default operating mode.
 
#define ADS1X1X_PARAM_COMP_MODE   (ADS1X1X_COMP_MODE_TRADITIONAL)
 Default comparator mode (No effect on ADS1113/1013)
 
#define ADS1X1X_PARAM_COMP_POLARITY   (ADS1X1X_COMP_POLARITY_LOW)
 Default comparator polarity (No effect on ADS1113/1013)
 
#define ADS1X1X_PARAM_COMP_LATCH   (ADS1X1X_COMP_LATCH_DISABLE)
 Default comparator latch (No effect on ADS1113/1013)
 
#define ADS1X1X_PARAM_COMP_QUEUE   (ADS1X1X_COMP_QUEUE_DISABLE)
 Default comparator queue (No effect on ADS1113/1013)
 
#define ADS1X1X_PARAM_BITS_RES   (ADS1X1X_BITS_RES_UNDEF)
 Default bit resolution set to undefined.
 
#define ADS1X1X_PARAMS
 Default configuration parameters structure for ADS1X1X ADC devices. More...
 
#define ADS1X1X_ALERT_PARAMS
 Default ADS1X1X alert parameters structure. More...
 
#define ADS1X1X_SAUL_INFO   { .name = "ads1x1x" }
 Additional SAUL registry information.
 

Macro Definition Documentation

◆ ADS1X1X_ALERT_PARAMS

#define ADS1X1X_ALERT_PARAMS
Value:
{ .i2c = ADS1X1X_PARAM_I2C, \
.addr = ADS1X1X_PARAM_ADDR, \
.comp_mode = ADS1X1X_PARAM_COMP_MODE, \
.comp_polarity = ADS1X1X_PARAM_COMP_POLARITY, \
.comp_latch = ADS1X1X_PARAM_COMP_LATCH, \
.comp_queue = ADS1X1X_PARAM_COMP_QUEUE, \
.alert_pin = ADS1X1X_PARAM_ALERT_PIN, \
.low_limit = ADS1X1X_PARAM_LOW_LIMIT, \
.high_limit = ADS1X1X_PARAM_HIGH_LIMIT }
#define ADS1X1X_PARAM_ALERT_PIN
Default alert pin configuration.
#define ADS1X1X_PARAM_COMP_MODE
Default comparator mode (No effect on ADS1113/1013)
#define ADS1X1X_PARAM_COMP_POLARITY
Default comparator polarity (No effect on ADS1113/1013)
#define ADS1X1X_PARAM_HIGH_LIMIT
Default high limit for alert.
#define ADS1X1X_PARAM_LOW_LIMIT
Default low limit for alert.
#define ADS1X1X_PARAM_I2C
Default I2C bus.
#define ADS1X1X_PARAM_COMP_LATCH
Default comparator latch (No effect on ADS1113/1013)
#define ADS1X1X_PARAM_COMP_QUEUE
Default comparator queue (No effect on ADS1113/1013)
#define ADS1X1X_PARAM_ADDR
Default I2C address.

Default ADS1X1X alert parameters structure.

Definition at line 185 of file ads1x1x_params.h.

◆ ADS1X1X_PARAMS

#define ADS1X1X_PARAMS
Value:
{ .i2c = ADS1X1X_PARAM_I2C, \
.addr = ADS1X1X_PARAM_ADDR, \
.mode = ADS1X1X_PARAM_MODE, \
.bits_res = ADS1X1X_PARAM_BITS_RES }
#define ADS1X1X_PARAM_MUX
Default multiplexer configuration.
#define ADS1X1X_PARAM_DATAR
Default data rate configuration set to undefined.
#define ADS1X1X_PARAM_BITS_RES
Default bit resolution set to undefined.
#define ADS1X1X_PARAM_PGA
Default programmable gain amplifier configuration.
#define ADS1X1X_PARAM_MODE
Default operating mode.

Default configuration parameters structure for ADS1X1X ADC devices.

This macro defines the default parameter structure used to initialize ADS1X1X analog-to-digital converter devices. The structure contains all necessary configuration options including resolution, data rate, gain, and operational modes.

Warning
The following parameters are mandatory and must be explicitly configured:
  • ads1x1x_params_t::bits_res - ADC resolution, must be set to either:
    • ADS101X_BITS_RES for 12-bit resolution (ADS101x series)
    • ADS111X_BITS_RES for 16-bit resolution (ADS111x series)
  • ads1x1x_params_t::dr - Data rate configuration, must be set to a valid sampling rate value appropriate for the selected device variant
Note
Other parameters in the structure have sensible defaults but can be customized based on application requirements such as input multiplexer configuration, programmable gain amplifier settings, and comparator modes.
See also
ads1x1x_params_t for detailed parameter structure definition
ads1x1x_init() for device initialization using these parameters

Definition at line 171 of file ads1x1x_params.h.

Variable Documentation

◆ ads1x1x_alert_params

Initial value:
=
{
}
#define ADS1X1X_ALERT_PARAMS
Default ADS1X1X alert parameters structure.

ADS1X1X alert defaults if not defined for a board or application.

Definition at line 216 of file ads1x1x_params.h.

◆ ads1x1x_params

const ads1x1x_params_t ads1x1x_params[]
static
Initial value:
=
{
}
#define ADS1X1X_PARAMS
Default configuration parameters structure for ADS1X1X ADC devices.

ADS1X1X defaults if not defined for a board or application.

Definition at line 208 of file ads1x1x_params.h.

◆ ads1x1x_saul_info

const saul_reg_info_t ads1x1x_saul_info[]
static
Initial value:
=
{
}
#define ADS1X1X_SAUL_INFO
Additional SAUL registry information.

Additional meta information to keep in the SAUL registry.

Definition at line 224 of file ads1x1x_params.h.