Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Texas Instruments INA230 current and power monitor. More...

Files

file  ina230.h
 Devicetree binding constants for the TI INA230 power monitor.

Macros

#define INA230_CONFIG(mode, svct, bvct, avg)
 Build the INA230 configuration register value.

Mask/enable bits that assert the ALERT pin

Mask/enable flags that assert the ALERT pin.

#define INA230_SHUNT_VOLTAGE_OVER   BIT(15)
 Shunt voltage over-limit.
#define INA230_SHUNT_VOLTAGE_UNDER   BIT(14)
 Shunt voltage under-limit.
#define INA230_BUS_VOLTAGE_OVER   BIT(13)
 Bus voltage over-limit.
#define INA230_BUS_VOLTAGE_UNDER   BIT(12)
 Bus voltage under-limit.
#define INA230_OVER_LIMIT_POWER   BIT(11)
 Power over-limit.
#define INA230_CONVERSION_READY   BIT(10)
 Conversion-ready enable.
#define INA230_ALERT_FUNCTION_FLAG   BIT(4)
 Alert function flag.
#define INA230_CONVERSION_READY_FLAG   BIT(3)
 Conversion-ready flag.
#define INA230_MATH_OVERFLOW_FLAG   BIT(2)
 Math overflow flag.
#define INA230_ALERT_POLARITY   BIT(1)
 Alert pin polarity.
#define INA230_ALERT_LATCH_ENABLE   BIT(0)
 Alert latch enable.

Operating mode

Operating-mode argument for the INA230_CONFIG() macro.

#define INA230_OPER_MODE_POWER_DOWN   0x00
 Power-down.
#define INA230_OPER_MODE_SHUNT_VOLTAGE_TRIG   0x01
 Shunt voltage, triggered.
#define INA230_OPER_MODE_BUS_VOLTAGE_TRIG   0x02
 Bus voltage, triggered.
#define INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG   0x03
 Shunt and bus, triggered.
#define INA230_OPER_MODE_SHUNT_VOLTAGE_CONT   0x05
 Shunt voltage, continuous.
#define INA230_OPER_MODE_BUS_VOLTAGE_CONT   0x06
 Bus voltage, continuous.
#define INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT   0x07
 Shunt and bus, continuous.

Bus and shunt voltage conversion time

Conversion-time argument for the INA230_CONFIG() macro.

#define INA230_CONV_TIME_140   0x00
 140 µs
#define INA230_CONV_TIME_204   0x01
 204 µs
#define INA230_CONV_TIME_332   0x02
 332 µs
#define INA230_CONV_TIME_588   0x03
 588 µs
#define INA230_CONV_TIME_1100   0x04
 1100 µs
#define INA230_CONV_TIME_2116   0x05
 2116 µs
#define INA230_CONV_TIME_4156   0x06
 4156 µs
#define INA230_CONV_TIME_8244   0x07
 8244 µs

Averaging mode (number of samples)

Averaging-mode argument for the INA230_CONFIG() macro.

#define INA230_AVG_MODE_1   0x00
 1 sample
#define INA230_AVG_MODE_4   0x01
 4 samples
#define INA230_AVG_MODE_16   0x02
 16 samples
#define INA230_AVG_MODE_64   0x03
 64 samples
#define INA230_AVG_MODE_128   0x04
 128 samples
#define INA230_AVG_MODE_256   0x05
 256 samples
#define INA230_AVG_MODE_512   0x06
 512 samples
#define INA230_AVG_MODE_1024   0x07
 1024 samples

Detailed Description

Texas Instruments INA230 current and power monitor.

Macro Definition Documentation

◆ INA230_ALERT_FUNCTION_FLAG

#define INA230_ALERT_FUNCTION_FLAG   BIT(4)

#include <zephyr/dt-bindings/sensor/ina230.h>

Alert function flag.

◆ INA230_ALERT_LATCH_ENABLE

#define INA230_ALERT_LATCH_ENABLE   BIT(0)

#include <zephyr/dt-bindings/sensor/ina230.h>

Alert latch enable.

◆ INA230_ALERT_POLARITY

#define INA230_ALERT_POLARITY   BIT(1)

#include <zephyr/dt-bindings/sensor/ina230.h>

Alert pin polarity.

◆ INA230_AVG_MODE_1

#define INA230_AVG_MODE_1   0x00

◆ INA230_AVG_MODE_1024

#define INA230_AVG_MODE_1024   0x07

#include <zephyr/dt-bindings/sensor/ina230.h>

1024 samples

◆ INA230_AVG_MODE_128

#define INA230_AVG_MODE_128   0x04

#include <zephyr/dt-bindings/sensor/ina230.h>

128 samples

◆ INA230_AVG_MODE_16

#define INA230_AVG_MODE_16   0x02

#include <zephyr/dt-bindings/sensor/ina230.h>

16 samples

◆ INA230_AVG_MODE_256

#define INA230_AVG_MODE_256   0x05

#include <zephyr/dt-bindings/sensor/ina230.h>

256 samples

◆ INA230_AVG_MODE_4

#define INA230_AVG_MODE_4   0x01

#include <zephyr/dt-bindings/sensor/ina230.h>

4 samples

◆ INA230_AVG_MODE_512

#define INA230_AVG_MODE_512   0x06

#include <zephyr/dt-bindings/sensor/ina230.h>

512 samples

◆ INA230_AVG_MODE_64

#define INA230_AVG_MODE_64   0x03

#include <zephyr/dt-bindings/sensor/ina230.h>

64 samples

◆ INA230_BUS_VOLTAGE_OVER

#define INA230_BUS_VOLTAGE_OVER   BIT(13)

#include <zephyr/dt-bindings/sensor/ina230.h>

Bus voltage over-limit.

◆ INA230_BUS_VOLTAGE_UNDER

#define INA230_BUS_VOLTAGE_UNDER   BIT(12)

#include <zephyr/dt-bindings/sensor/ina230.h>

Bus voltage under-limit.

◆ INA230_CONFIG

#define INA230_CONFIG ( mode,
svct,
bvct,
avg )

#include <zephyr/dt-bindings/sensor/ina230.h>

Value:
(((avg) << 9) | ((bvct) << 6) | ((svct) << 3) | (mode))

Build the INA230 configuration register value.

Parameters
modeOperating mode (see ina230_oper_mode).
svctShunt voltage conversion time (see ina230_conv_time).
bvctBus voltage conversion time (see ina230_conv_time).
avgAveraging mode (see ina230_avg).

◆ INA230_CONV_TIME_1100

#define INA230_CONV_TIME_1100   0x04

◆ INA230_CONV_TIME_140

#define INA230_CONV_TIME_140   0x00

◆ INA230_CONV_TIME_204

#define INA230_CONV_TIME_204   0x01

◆ INA230_CONV_TIME_2116

#define INA230_CONV_TIME_2116   0x05

◆ INA230_CONV_TIME_332

#define INA230_CONV_TIME_332   0x02

◆ INA230_CONV_TIME_4156

#define INA230_CONV_TIME_4156   0x06

◆ INA230_CONV_TIME_588

#define INA230_CONV_TIME_588   0x03

◆ INA230_CONV_TIME_8244

#define INA230_CONV_TIME_8244   0x07

◆ INA230_CONVERSION_READY

#define INA230_CONVERSION_READY   BIT(10)

#include <zephyr/dt-bindings/sensor/ina230.h>

Conversion-ready enable.

◆ INA230_CONVERSION_READY_FLAG

#define INA230_CONVERSION_READY_FLAG   BIT(3)

#include <zephyr/dt-bindings/sensor/ina230.h>

Conversion-ready flag.

◆ INA230_MATH_OVERFLOW_FLAG

#define INA230_MATH_OVERFLOW_FLAG   BIT(2)

#include <zephyr/dt-bindings/sensor/ina230.h>

Math overflow flag.

◆ INA230_OPER_MODE_BUS_VOLTAGE_CONT

#define INA230_OPER_MODE_BUS_VOLTAGE_CONT   0x06

#include <zephyr/dt-bindings/sensor/ina230.h>

Bus voltage, continuous.

◆ INA230_OPER_MODE_BUS_VOLTAGE_TRIG

#define INA230_OPER_MODE_BUS_VOLTAGE_TRIG   0x02

#include <zephyr/dt-bindings/sensor/ina230.h>

Bus voltage, triggered.

◆ INA230_OPER_MODE_POWER_DOWN

#define INA230_OPER_MODE_POWER_DOWN   0x00

#include <zephyr/dt-bindings/sensor/ina230.h>

Power-down.

◆ INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT

#define INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT   0x07

#include <zephyr/dt-bindings/sensor/ina230.h>

Shunt and bus, continuous.

◆ INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG

#define INA230_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG   0x03

#include <zephyr/dt-bindings/sensor/ina230.h>

Shunt and bus, triggered.

◆ INA230_OPER_MODE_SHUNT_VOLTAGE_CONT

#define INA230_OPER_MODE_SHUNT_VOLTAGE_CONT   0x05

#include <zephyr/dt-bindings/sensor/ina230.h>

Shunt voltage, continuous.

◆ INA230_OPER_MODE_SHUNT_VOLTAGE_TRIG

#define INA230_OPER_MODE_SHUNT_VOLTAGE_TRIG   0x01

#include <zephyr/dt-bindings/sensor/ina230.h>

Shunt voltage, triggered.

◆ INA230_OVER_LIMIT_POWER

#define INA230_OVER_LIMIT_POWER   BIT(11)

#include <zephyr/dt-bindings/sensor/ina230.h>

Power over-limit.

◆ INA230_SHUNT_VOLTAGE_OVER

#define INA230_SHUNT_VOLTAGE_OVER   BIT(15)

#include <zephyr/dt-bindings/sensor/ina230.h>

Shunt voltage over-limit.

◆ INA230_SHUNT_VOLTAGE_UNDER

#define INA230_SHUNT_VOLTAGE_UNDER   BIT(14)

#include <zephyr/dt-bindings/sensor/ina230.h>

Shunt voltage under-limit.