|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Texas Instruments INA237 current and power monitor. More...
Files | |
| file | ina237.h |
| Devicetree binding constants for the TI INA237 power monitor. | |
Macros | |
| #define | INA237_CONFIG(rst_mode, convdly, adc_range) |
| Build the INA237 configuration register value. | |
| #define | INA237_ADC_CONFIG(mode, vshct, vbusct, vtct, avg) |
| Build the INA237 ADC configuration register value. | |
Operating mode | |
Operating-mode argument for the INA237_ADC_CONFIG() macro. | |
| #define | INA237_CFG_HIGH_PRECISION BIT(4) |
| High-precision mode flag. | |
| #define | INA237_OPER_MODE_SHUTDOWN 0x00 |
| Shutdown. | |
| #define | INA237_OPER_MODE_BUS_VOLTAGE_TRIG 0x01 |
| Bus voltage, triggered. | |
| #define | INA237_OPER_MODE_SHUNT_VOLTAGE_TRIG 0x02 |
| Shunt voltage, triggered. | |
| #define | INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG 0x03 |
| Shunt and bus, triggered. | |
| #define | INA237_OPER_MODE_TEMP_TRIG 0x04 |
| Temperature, triggered. | |
| #define | INA237_OPER_MODE_TEMP_BUS_VOLTAGE_TRIG 0x05 |
| Temp and bus, triggered. | |
| #define | INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_TRIG 0x06 |
| Temp and shunt, triggered. | |
| #define | INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_TRIG 0x07 |
| Bus, shunt and temp, triggered. | |
| #define | INA237_OPER_MODE_BUS_VOLTAGE_CONT 0x09 |
| Bus voltage, continuous. | |
| #define | INA237_OPER_MODE_SHUNT_VOLTAGE_CONT 0x0A |
| Shunt voltage, continuous. | |
| #define | INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT 0x0B |
| Shunt and bus, continuous. | |
| #define | INA237_OPER_MODE_TEMP_CONT 0x0C |
| Temperature, continuous. | |
| #define | INA237_OPER_MODE_BUS_VOLTAGE_TEMP_CONT 0x0D |
| Bus and temp, continuous. | |
| #define | INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_CONT 0x0E |
| Temp and shunt, continuous. | |
| #define | INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_CONT 0x0F |
| Bus, shunt and temp, continuous. | |
Bus, shunt and temperature conversion time | |
Conversion-time argument for the INA237_ADC_CONFIG() macro. | |
| #define | INA237_CONV_TIME_50 0x00 |
| 50 µs | |
| #define | INA237_CONV_TIME_84 0x01 |
| 84 µs | |
| #define | INA237_CONV_TIME_150 0x02 |
| 150 µs | |
| #define | INA237_CONV_TIME_280 0x03 |
| 280 µs | |
| #define | INA237_CONV_TIME_540 0x04 |
| 540 µs | |
| #define | INA237_CONV_TIME_1052 0x05 |
| 1052 µs | |
| #define | INA237_CONV_TIME_2074 0x06 |
| 2074 µs | |
| #define | INA237_CONV_TIME_4120 0x07 |
| 4120 µs | |
Averaging mode (number of samples) | |
Averaging-mode argument for the INA237_ADC_CONFIG() macro. | |
| #define | INA237_AVG_MODE_1 0x00 |
| 1 sample | |
| #define | INA237_AVG_MODE_4 0x01 |
| 4 samples | |
| #define | INA237_AVG_MODE_16 0x02 |
| 16 samples | |
| #define | INA237_AVG_MODE_64 0x03 |
| 64 samples | |
| #define | INA237_AVG_MODE_128 0x04 |
| 128 samples | |
| #define | INA237_AVG_MODE_256 0x05 |
| 256 samples | |
| #define | INA237_AVG_MODE_512 0x06 |
| 512 samples | |
| #define | INA237_AVG_MODE_1024 0x07 |
| 1024 samples | |
Reset mode | |
Reset-mode argument for the INA237_CONFIG() macro. | |
| #define | INA237_RST_NORMAL_OPERATION 0x00 |
| Normal operation. | |
| #define | INA237_RST_SYSTEM_RESET 0x01 |
| Trigger a system reset. | |
Initial ADC conversion delay (steps of 2 ms) | |
Initial ADC-delay argument for the INA237_CONFIG() macro. | |
| #define | INA237_INIT_ADC_DELAY_0_S 0x00 |
| 0 s (no delay) | |
| #define | INA237_INIT_ADC_DELAY_2_MS 0x01 |
| 2 ms | |
| #define | INA237_INIT_ADC_DELAY_510_MS 0xFF |
| 510 ms | |
Shunt full-scale range across IN+ and IN− | |
Shunt full-scale range argument for the INA237_CONFIG() macro. | |
| #define | INA237_ADC_RANGE_163_84 0x00 |
| ±163.84 mV | |
| #define | INA237_ADC_RANGE_40_96 0x01 |
| ±40.96 mV | |
Texas Instruments INA237 current and power monitor.
| #define INA237_ADC_CONFIG | ( | mode, | |
| vshct, | |||
| vbusct, | |||
| vtct, | |||
| avg ) |
#include <zephyr/dt-bindings/sensor/ina237.h>
Build the INA237 ADC configuration register value.
| mode | Operating mode (see ina237_oper_mode). |
| vshct | Shunt voltage conversion time (see ina237_conv_time). |
| vbusct | Bus voltage conversion time (see ina237_conv_time). |
| vtct | Temperature conversion time (see ina237_conv_time). |
| avg | Averaging mode (see ina237_avg). |
| #define INA237_ADC_RANGE_163_84 0x00 |
#include <zephyr/dt-bindings/sensor/ina237.h>
±163.84 mV
| #define INA237_ADC_RANGE_40_96 0x01 |
#include <zephyr/dt-bindings/sensor/ina237.h>
±40.96 mV
| #define INA237_AVG_MODE_1 0x00 |
#include <zephyr/dt-bindings/sensor/ina237.h>
1 sample
| #define INA237_AVG_MODE_1024 0x07 |
#include <zephyr/dt-bindings/sensor/ina237.h>
1024 samples
| #define INA237_AVG_MODE_128 0x04 |
#include <zephyr/dt-bindings/sensor/ina237.h>
128 samples
| #define INA237_AVG_MODE_16 0x02 |
#include <zephyr/dt-bindings/sensor/ina237.h>
16 samples
| #define INA237_AVG_MODE_256 0x05 |
#include <zephyr/dt-bindings/sensor/ina237.h>
256 samples
| #define INA237_AVG_MODE_4 0x01 |
#include <zephyr/dt-bindings/sensor/ina237.h>
4 samples
| #define INA237_AVG_MODE_512 0x06 |
#include <zephyr/dt-bindings/sensor/ina237.h>
512 samples
| #define INA237_AVG_MODE_64 0x03 |
#include <zephyr/dt-bindings/sensor/ina237.h>
64 samples
| #define INA237_CFG_HIGH_PRECISION BIT(4) |
#include <zephyr/dt-bindings/sensor/ina237.h>
High-precision mode flag.
| #define INA237_CONFIG | ( | rst_mode, | |
| convdly, | |||
| adc_range ) |
#include <zephyr/dt-bindings/sensor/ina237.h>
Build the INA237 configuration register value.
| rst_mode | Reset mode (see ina237_reset). |
| convdly | Initial ADC conversion delay (see ina237_init_adc_delay). |
| adc_range | Shunt full-scale range (see ina237_adc_range). |
| #define INA237_CONV_TIME_1052 0x05 |
#include <zephyr/dt-bindings/sensor/ina237.h>
1052 µs
| #define INA237_CONV_TIME_150 0x02 |
#include <zephyr/dt-bindings/sensor/ina237.h>
150 µs
| #define INA237_CONV_TIME_2074 0x06 |
#include <zephyr/dt-bindings/sensor/ina237.h>
2074 µs
| #define INA237_CONV_TIME_280 0x03 |
#include <zephyr/dt-bindings/sensor/ina237.h>
280 µs
| #define INA237_CONV_TIME_4120 0x07 |
#include <zephyr/dt-bindings/sensor/ina237.h>
4120 µs
| #define INA237_CONV_TIME_50 0x00 |
#include <zephyr/dt-bindings/sensor/ina237.h>
50 µs
| #define INA237_CONV_TIME_540 0x04 |
#include <zephyr/dt-bindings/sensor/ina237.h>
540 µs
| #define INA237_CONV_TIME_84 0x01 |
#include <zephyr/dt-bindings/sensor/ina237.h>
84 µs
| #define INA237_INIT_ADC_DELAY_0_S 0x00 |
#include <zephyr/dt-bindings/sensor/ina237.h>
0 s (no delay)
| #define INA237_INIT_ADC_DELAY_2_MS 0x01 |
#include <zephyr/dt-bindings/sensor/ina237.h>
2 ms
| #define INA237_INIT_ADC_DELAY_510_MS 0xFF |
#include <zephyr/dt-bindings/sensor/ina237.h>
510 ms
| #define INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_CONT 0x0F |
#include <zephyr/dt-bindings/sensor/ina237.h>
Bus, shunt and temp, continuous.
| #define INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_TRIG 0x07 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Bus, shunt and temp, triggered.
| #define INA237_OPER_MODE_BUS_VOLTAGE_CONT 0x09 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Bus voltage, continuous.
| #define INA237_OPER_MODE_BUS_VOLTAGE_TEMP_CONT 0x0D |
#include <zephyr/dt-bindings/sensor/ina237.h>
Bus and temp, continuous.
| #define INA237_OPER_MODE_BUS_VOLTAGE_TRIG 0x01 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Bus voltage, triggered.
| #define INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT 0x0B |
#include <zephyr/dt-bindings/sensor/ina237.h>
Shunt and bus, continuous.
| #define INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG 0x03 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Shunt and bus, triggered.
| #define INA237_OPER_MODE_SHUNT_VOLTAGE_CONT 0x0A |
#include <zephyr/dt-bindings/sensor/ina237.h>
Shunt voltage, continuous.
| #define INA237_OPER_MODE_SHUNT_VOLTAGE_TRIG 0x02 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Shunt voltage, triggered.
| #define INA237_OPER_MODE_SHUTDOWN 0x00 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Shutdown.
| #define INA237_OPER_MODE_TEMP_BUS_VOLTAGE_TRIG 0x05 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Temp and bus, triggered.
| #define INA237_OPER_MODE_TEMP_CONT 0x0C |
#include <zephyr/dt-bindings/sensor/ina237.h>
Temperature, continuous.
| #define INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_CONT 0x0E |
#include <zephyr/dt-bindings/sensor/ina237.h>
Temp and shunt, continuous.
| #define INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_TRIG 0x06 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Temp and shunt, triggered.
| #define INA237_OPER_MODE_TEMP_TRIG 0x04 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Temperature, triggered.
| #define INA237_RST_NORMAL_OPERATION 0x00 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Normal operation.
| #define INA237_RST_SYSTEM_RESET 0x01 |
#include <zephyr/dt-bindings/sensor/ina237.h>
Trigger a system reset.