ina2xx_params.h File Reference

Default configuration for INA2xx power/current monitors. More...

Detailed Description

Default configuration for INA2xx power/current monitors.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file ina2xx_params.h.

#include "board.h"
#include "ina2xx.h"
#include "saul_reg.h"
+ Include dependency graph for ina2xx_params.h:

Go to the source code of this file.

Variables

static const ina2xx_params_t ina2xx_params []
 Configure INA2XX devices. More...
 
static const saul_reg_info_t ina2xx_saul_info []
 Allocate and configure entries to the SAUL registry. More...
 

Set default configuration parameters for the INA2XX

#define INA2XX_PARAM_I2C   (I2C_DEV(0))
 Default to first I2C device.
 
#define INA2XX_PARAM_ADDR   (0x40)
 Default to address 0x40, which is active if A0 and A1 are connected to GND. More...
 
#define INA2XX_PARAM_CONFIG
 Default to an optimal configuration for current/power measurements of USB high-power devices using the popular INA219 break out board with 128 samples averaged. More...
 
#define INA2XX_PARAM_RSHUNT_MOHM   (100)
 Default to 100 mΩ as shunt resistor. More...
 
#define INA2XX_PARAM_I_RANGE   (INA2XX_CURRENT_RANGE_655_MA)
 Default to a current range of ±655.36mA. More...
 
#define INA2XX_PARAMS
 

Set default SAUL info for the INA2XX

#define INA2XX_SAULINFO
 

Macro Definition Documentation

◆ INA2XX_PARAM_ADDR

#define INA2XX_PARAM_ADDR   (0x40)

Default to address 0x40, which is active if A0 and A1 are connected to GND.

On the popular INA219 breakout board this is the default address if solder jumpers remain open.

Definition at line 48 of file ina2xx_params.h.

◆ INA2XX_PARAM_CONFIG

#define INA2XX_PARAM_CONFIG
Value:
INA2XX_SADC_AVG_128_SAMPLES | \
INA2XX_BADC_AVG_128_SAMPLES | \
INA2XX_SHUNT_RANGE_80MV | \
INA2XX_BUS_RANGE_16V)

Default to an optimal configuration for current/power measurements of USB high-power devices using the popular INA219 break out board with 128 samples averaged.

Setting Value
Mode Continuous shunt and bus voltage measurements
Shunt ADC Setting 128 Samples, 68.10 ms per conversion
Bus ADC Setting 128 Samples, 68.10 ms per conversion
Shunt Voltage Range ±80mV
Bus Voltage Range 16V

Definition at line 64 of file ina2xx_params.h.

◆ INA2XX_PARAM_I_RANGE

#define INA2XX_PARAM_I_RANGE   (INA2XX_CURRENT_RANGE_655_MA)

Default to a current range of ±655.36mA.

This is the highest resolution suitable to measure USB high-power devices (up to 500 mA).

Definition at line 85 of file ina2xx_params.h.

◆ INA2XX_PARAM_RSHUNT_MOHM

#define INA2XX_PARAM_RSHUNT_MOHM   (100)

Default to 100 mΩ as shunt resistor.

This is the value used in the popular INA219 breakout board.

Definition at line 76 of file ina2xx_params.h.

◆ INA2XX_PARAMS

#define INA2XX_PARAMS
Value:
{ .i2c = INA2XX_PARAM_I2C, \
.addr = INA2XX_PARAM_ADDR, \
.config = INA2XX_PARAM_CONFIG, \
.rshunt_mohm = INA2XX_PARAM_RSHUNT_MOHM, \
.i_range = INA2XX_PARAM_I_RANGE }

Definition at line 88 of file ina2xx_params.h.

◆ INA2XX_SAULINFO

#define INA2XX_SAULINFO
Value:
{ .name = "INA2XX current" }, \
{ .name = "INA2XX power" }, \
{ .name = "INA2XX voltage" }

Definition at line 101 of file ina2xx_params.h.

Variable Documentation

◆ ina2xx_params

const ina2xx_params_t ina2xx_params[]
static
Initial value:
=
{
INA2XX_PARAMS
}

Configure INA2XX devices.

Definition at line 110 of file ina2xx_params.h.

◆ ina2xx_saul_info

const saul_reg_info_t ina2xx_saul_info[]
static
Initial value:
=
{
INA2XX_SAULINFO
}

Allocate and configure entries to the SAUL registry.

Definition at line 118 of file ina2xx_params.h.

INA2XX_PARAM_I2C
#define INA2XX_PARAM_I2C
Default to first I2C device.
Definition: ina2xx_params.h:38
INA2XX_PARAM_CONFIG
#define INA2XX_PARAM_CONFIG
Default to an optimal configuration for current/power measurements of USB high-power devices using th...
Definition: ina2xx_params.h:64
INA2XX_MODE_CONTINUOUS_SHUNT_BUS
@ INA2XX_MODE_CONTINUOUS_SHUNT_BUS
Shunt and Bus, Continuous, default.
Definition: ina2xx.h:69
INA2XX_PARAM_ADDR
#define INA2XX_PARAM_ADDR
Default to address 0x40, which is active if A0 and A1 are connected to GND.
Definition: ina2xx_params.h:48
INA2XX_PARAM_RSHUNT_MOHM
#define INA2XX_PARAM_RSHUNT_MOHM
Default to 100 mΩ as shunt resistor.
Definition: ina2xx_params.h:76
INA2XX_PARAM_I_RANGE
#define INA2XX_PARAM_I_RANGE
Default to a current range of ±655.36mA.
Definition: ina2xx_params.h:85