Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ina237.h File Reference

Go to the source code of this file.

Macros

#define INA237_CFG_HIGH_PRECISION   BIT(4)
 
#define INA237_OPER_MODE_SHUTDOWN   0x00
 
#define INA237_OPER_MODE_BUS_VOLTAGE_TRIG   0x01
 
#define INA237_OPER_MODE_SHUNT_VOLTAGE_TRIG   0x02
 
#define INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG   0x03
 
#define INA237_OPER_MODE_TEMP_TRIG   0x04
 
#define INA237_OPER_MODE_TEMP_BUS_VOLTAGE_TRIG   0x05
 
#define INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_TRIG   0x06
 
#define INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_TRIG   0x07
 
#define INA237_OPER_MODE_BUS_VOLTAGE_CONT   0x09
 
#define INA237_OPER_MODE_SHUNT_VOLTAGE_CONT   0x0A
 
#define INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT   0x0B
 
#define INA237_OPER_MODE_TEMP_CONT   0x0C
 
#define INA237_OPER_MODE_BUS_VOLTAGE_TEMP_CONT   0x0D
 
#define INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_CONT   0x0E
 
#define INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_CONT   0x0F
 
#define INA237_CONV_TIME_50   0x00
 
#define INA237_CONV_TIME_84   0x01
 
#define INA237_CONV_TIME_150   0x02
 
#define INA237_CONV_TIME_280   0x03
 
#define INA237_CONV_TIME_540   0x04
 
#define INA237_CONV_TIME_1052   0x05
 
#define INA237_CONV_TIME_2074   0x06
 
#define INA237_CONV_TIME_4120   0x07
 
#define INA237_AVG_MODE_1   0x00
 
#define INA237_AVG_MODE_4   0x01
 
#define INA237_AVG_MODE_16   0x02
 
#define INA237_AVG_MODE_64   0x03
 
#define INA237_AVG_MODE_128   0x04
 
#define INA237_AVG_MODE_256   0x05
 
#define INA237_AVG_MODE_512   0x06
 
#define INA237_AVG_MODE_1024   0x07
 
#define INA237_RST_NORMAL_OPERATION   0x00
 
#define INA237_RST_SYSTEM_RESET   0x01
 
#define INA237_INIT_ADC_DELAY_0_S   0x00
 
#define INA237_INIT_ADC_DELAY_2_MS   0x01
 
#define INA237_INIT_ADC_DELAY_510_MS   0xFF
 
#define INA237_ADC_RANGE_163_84   0x00
 
#define INA237_ADC_RANGE_40_96   0x01
 
#define INA237_CONFIG(rst_mode, convdly, adc_range)
 Macro for creating the INA237 configuration value.
 
#define INA237_ADC_CONFIG(mode, vshct, vbusct, vtct, avg)
 Macro for creating the INA237 ADC configuration value.
 

Macro Definition Documentation

◆ INA237_ADC_CONFIG

#define INA237_ADC_CONFIG ( mode,
vshct,
vbusct,
vtct,
avg )
Value:
(((mode) << 12) | ((vbusct) << 9) | ((vshct) << 6) | ((vtct) << 3) | (avg))

Macro for creating the INA237 ADC configuration value.

Parameters
modeOperating mode.
vshctConversion time for shunt voltage.
vbusctConversion time for bus voltage.
vtctConversion time for temperature.
avgAveraging mode.

◆ INA237_ADC_RANGE_163_84

#define INA237_ADC_RANGE_163_84   0x00

◆ INA237_ADC_RANGE_40_96

#define INA237_ADC_RANGE_40_96   0x01

◆ INA237_AVG_MODE_1

#define INA237_AVG_MODE_1   0x00

◆ INA237_AVG_MODE_1024

#define INA237_AVG_MODE_1024   0x07

◆ INA237_AVG_MODE_128

#define INA237_AVG_MODE_128   0x04

◆ INA237_AVG_MODE_16

#define INA237_AVG_MODE_16   0x02

◆ INA237_AVG_MODE_256

#define INA237_AVG_MODE_256   0x05

◆ INA237_AVG_MODE_4

#define INA237_AVG_MODE_4   0x01

◆ INA237_AVG_MODE_512

#define INA237_AVG_MODE_512   0x06

◆ INA237_AVG_MODE_64

#define INA237_AVG_MODE_64   0x03

◆ INA237_CFG_HIGH_PRECISION

#define INA237_CFG_HIGH_PRECISION   BIT(4)

◆ INA237_CONFIG

#define INA237_CONFIG ( rst_mode,
convdly,
adc_range )
Value:
(((rst_mode) << 15) | ((convdly) << 6) | ((adc_range) << 4))

Macro for creating the INA237 configuration value.

Parameters
rst_modeReset mode.
convdlyDelay for initial ADC conversion in steps of 2 ms.
adc_rangeShunt full scale range selection across IN+ and IN–.

◆ INA237_CONV_TIME_1052

#define INA237_CONV_TIME_1052   0x05

◆ INA237_CONV_TIME_150

#define INA237_CONV_TIME_150   0x02

◆ INA237_CONV_TIME_2074

#define INA237_CONV_TIME_2074   0x06

◆ INA237_CONV_TIME_280

#define INA237_CONV_TIME_280   0x03

◆ INA237_CONV_TIME_4120

#define INA237_CONV_TIME_4120   0x07

◆ INA237_CONV_TIME_50

#define INA237_CONV_TIME_50   0x00

◆ INA237_CONV_TIME_540

#define INA237_CONV_TIME_540   0x04

◆ INA237_CONV_TIME_84

#define INA237_CONV_TIME_84   0x01

◆ INA237_INIT_ADC_DELAY_0_S

#define INA237_INIT_ADC_DELAY_0_S   0x00

◆ INA237_INIT_ADC_DELAY_2_MS

#define INA237_INIT_ADC_DELAY_2_MS   0x01

◆ INA237_INIT_ADC_DELAY_510_MS

#define INA237_INIT_ADC_DELAY_510_MS   0xFF

◆ INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_CONT

#define INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_CONT   0x0F

◆ INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_TRIG

#define INA237_OPER_MODE_BUS_SHUNT_VOLTAGE_TEMP_TRIG   0x07

◆ INA237_OPER_MODE_BUS_VOLTAGE_CONT

#define INA237_OPER_MODE_BUS_VOLTAGE_CONT   0x09

◆ INA237_OPER_MODE_BUS_VOLTAGE_TEMP_CONT

#define INA237_OPER_MODE_BUS_VOLTAGE_TEMP_CONT   0x0D

◆ INA237_OPER_MODE_BUS_VOLTAGE_TRIG

#define INA237_OPER_MODE_BUS_VOLTAGE_TRIG   0x01

◆ INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT

#define INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_CONT   0x0B

◆ INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG

#define INA237_OPER_MODE_SHUNT_BUS_VOLTAGE_TRIG   0x03

◆ INA237_OPER_MODE_SHUNT_VOLTAGE_CONT

#define INA237_OPER_MODE_SHUNT_VOLTAGE_CONT   0x0A

◆ INA237_OPER_MODE_SHUNT_VOLTAGE_TRIG

#define INA237_OPER_MODE_SHUNT_VOLTAGE_TRIG   0x02

◆ INA237_OPER_MODE_SHUTDOWN

#define INA237_OPER_MODE_SHUTDOWN   0x00

◆ INA237_OPER_MODE_TEMP_BUS_VOLTAGE_TRIG

#define INA237_OPER_MODE_TEMP_BUS_VOLTAGE_TRIG   0x05

◆ INA237_OPER_MODE_TEMP_CONT

#define INA237_OPER_MODE_TEMP_CONT   0x0C

◆ INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_CONT

#define INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_CONT   0x0E

◆ INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_TRIG

#define INA237_OPER_MODE_TEMP_SHUNT_VOLTAGE_TRIG   0x06

◆ INA237_OPER_MODE_TEMP_TRIG

#define INA237_OPER_MODE_TEMP_TRIG   0x04

◆ INA237_RST_NORMAL_OPERATION

#define INA237_RST_NORMAL_OPERATION   0x00

◆ INA237_RST_SYSTEM_RESET

#define INA237_RST_SYSTEM_RESET   0x01