54 uint16_t data, data_check;
391 r = (double)(rand() % 100) / 1000.0;
1248 data = rand() % 65536;
uint8_t ina219_get_pga(ina219_handle_t *handle, ina219_pga_t *pga)
get the pga
uint8_t ina219_get_resistance(ina219_handle_t *handle, double *resistance)
get the resistance
uint8_t ina219_get_bus_voltage_range(ina219_handle_t *handle, ina219_bus_voltage_range_t *range)
get the bus voltage range
uint8_t ina219_soft_reset(ina219_handle_t *handle)
soft reset the chip
struct ina219_info_s ina219_info_t
ina219 information structure definition
uint8_t ina219_set_addr_pin(ina219_handle_t *handle, ina219_address_t addr_pin)
set the iic address pin
uint8_t ina219_info(ina219_info_t *info)
get chip's information
uint8_t ina219_set_shunt_voltage_adc_mode(ina219_handle_t *handle, ina219_adc_mode_t mode)
set the shunt voltage adc mode
uint8_t ina219_get_mode(ina219_handle_t *handle, ina219_mode_t *mode)
get the mode
uint8_t ina219_get_bus_voltage_adc_mode(ina219_handle_t *handle, ina219_adc_mode_t *mode)
get the bus voltage adc mode
ina219_adc_mode_t
ina219 adc mode enumeration definition
ina219_pga_t
ina219 pga enumeration definition
uint8_t ina219_get_shunt_voltage_adc_mode(ina219_handle_t *handle, ina219_adc_mode_t *mode)
get the shunt voltage adc mode
uint8_t ina219_get_addr_pin(ina219_handle_t *handle, ina219_address_t *addr_pin)
get the iic address pin
uint8_t ina219_set_calibration(ina219_handle_t *handle, uint16_t data)
set the calibration
ina219_bus_voltage_range_t
ina219 bus voltage enumeration definition
uint8_t ina219_deinit(ina219_handle_t *handle)
close the chip
uint8_t ina219_get_calibration(ina219_handle_t *handle, uint16_t *data)
get the calibration
uint8_t ina219_set_mode(ina219_handle_t *handle, ina219_mode_t mode)
set the mode
uint8_t ina219_set_pga(ina219_handle_t *handle, ina219_pga_t pga)
set the pga
uint8_t ina219_set_bus_voltage_range(ina219_handle_t *handle, ina219_bus_voltage_range_t range)
set the bus voltage range
uint8_t ina219_calculate_calibration(ina219_handle_t *handle, uint16_t *calibration)
calculate the calibration
uint8_t ina219_init(ina219_handle_t *handle)
initialize the chip
uint8_t ina219_set_resistance(ina219_handle_t *handle, double resistance)
set the resistance
ina219_mode_t
ina219 mode enumeration definition
ina219_address_t
ina219 address enumeration definition
uint8_t ina219_set_bus_voltage_adc_mode(ina219_handle_t *handle, ina219_adc_mode_t mode)
set the bus voltage adc mode
struct ina219_handle_s ina219_handle_t
ina219 handle structure definition
@ INA219_ADC_MODE_12_BIT_128_SAMPLES
@ INA219_ADC_MODE_12_BIT_8_SAMPLES
@ INA219_ADC_MODE_10_BIT_1_SAMPLES
@ INA219_ADC_MODE_12_BIT_1_SAMPLES
@ INA219_ADC_MODE_12_BIT_4_SAMPLES
@ INA219_ADC_MODE_9_BIT_1_SAMPLES
@ INA219_ADC_MODE_12_BIT_2_SAMPLES
@ INA219_ADC_MODE_12_BIT_16_SAMPLES
@ INA219_ADC_MODE_12_BIT_32_SAMPLES
@ INA219_ADC_MODE_12_BIT_64_SAMPLES
@ INA219_ADC_MODE_11_BIT_1_SAMPLES
@ INA219_BUS_VOLTAGE_RANGE_16V
@ INA219_BUS_VOLTAGE_RANGE_32V
@ INA219_MODE_SHUNT_BUS_VOLTAGE_CONTINUOUS
@ INA219_MODE_SHUNT_VOLTAGE_CONTINUOUS
@ INA219_MODE_SHUNT_BUS_VOLTAGE_TRIGGERED
@ INA219_MODE_SHUNT_VOLTAGE_TRIGGERED
@ INA219_MODE_BUS_VOLTAGE_TRIGGERED
@ INA219_MODE_BUS_VOLTAGE_CONTINUOUS
uint8_t ina219_interface_iic_init(void)
interface iic bus init
uint8_t ina219_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t ina219_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void ina219_interface_delay_ms(uint32_t ms)
interface delay ms
void ina219_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t ina219_interface_iic_deinit(void)
interface iic bus deinit
#define DRIVER_INA219_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_INA219_LINK_INIT(HANDLE, STRUCTURE)
initialize ina219_handle_t structure
#define DRIVER_INA219_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_INA219_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_INA219_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_INA219_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_INA219_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
uint8_t ina219_register_test(ina219_address_t addr_pin)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v