![]() |
LibDriver INA219
|
ina219 basic driver modules More...
Data Structures | |
| struct | ina219_handle_s |
| ina219 handle structure definition More... | |
| struct | ina219_info_s |
| ina219 information structure definition More... | |
Typedefs | |
| typedef struct ina219_handle_s | ina219_handle_t |
| ina219 handle structure definition | |
| typedef struct ina219_info_s | ina219_info_t |
| ina219 information structure definition | |
Functions | |
| uint8_t | ina219_info (ina219_info_t *info) |
| get chip's information | |
| uint8_t | ina219_set_addr_pin (ina219_handle_t *handle, ina219_address_t addr_pin) |
| set the iic address pin | |
| uint8_t | ina219_get_addr_pin (ina219_handle_t *handle, ina219_address_t *addr_pin) |
| get the iic address pin | |
| uint8_t | ina219_set_resistance (ina219_handle_t *handle, double resistance) |
| set the resistance | |
| uint8_t | ina219_get_resistance (ina219_handle_t *handle, double *resistance) |
| get the resistance | |
| uint8_t | ina219_init (ina219_handle_t *handle) |
| initialize the chip | |
| uint8_t | ina219_deinit (ina219_handle_t *handle) |
| close the chip | |
| uint8_t | ina219_read_shunt_voltage (ina219_handle_t *handle, int16_t *raw, float *mV) |
| read the shunt voltage | |
| uint8_t | ina219_read_bus_voltage (ina219_handle_t *handle, uint16_t *raw, float *mV) |
| read the bus voltage | |
| uint8_t | ina219_read_current (ina219_handle_t *handle, int16_t *raw, float *mA) |
| read the current | |
| uint8_t | ina219_read_power (ina219_handle_t *handle, uint16_t *raw, float *mW) |
| read the power | |
| uint8_t | ina219_soft_reset (ina219_handle_t *handle) |
| soft reset the chip | |
| 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_get_bus_voltage_range (ina219_handle_t *handle, ina219_bus_voltage_range_t *range) |
| get the bus voltage range | |
| uint8_t | ina219_set_pga (ina219_handle_t *handle, ina219_pga_t pga) |
| set the pga | |
| uint8_t | ina219_get_pga (ina219_handle_t *handle, ina219_pga_t *pga) |
| get the pga | |
| uint8_t | ina219_set_bus_voltage_adc_mode (ina219_handle_t *handle, ina219_adc_mode_t mode) |
| set the bus voltage adc mode | |
| uint8_t | ina219_get_bus_voltage_adc_mode (ina219_handle_t *handle, ina219_adc_mode_t *mode) |
| get the bus voltage adc mode | |
| 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_shunt_voltage_adc_mode (ina219_handle_t *handle, ina219_adc_mode_t *mode) |
| get the shunt voltage adc mode | |
| uint8_t | ina219_set_mode (ina219_handle_t *handle, ina219_mode_t mode) |
| set the mode | |
| uint8_t | ina219_get_mode (ina219_handle_t *handle, ina219_mode_t *mode) |
| get the mode | |
| uint8_t | ina219_set_calibration (ina219_handle_t *handle, uint16_t data) |
| set the calibration | |
| uint8_t | ina219_get_calibration (ina219_handle_t *handle, uint16_t *data) |
| get the calibration | |
| uint8_t | ina219_calculate_calibration (ina219_handle_t *handle, uint16_t *calibration) |
| calculate the calibration | |
ina219 basic driver modules
| typedef struct ina219_handle_s ina219_handle_t |
ina219 handle structure definition
| typedef struct ina219_info_s ina219_info_t |
ina219 information structure definition
| enum ina219_adc_mode_t |
ina219 adc mode enumeration definition
Definition at line 105 of file driver_ina219.h.
| enum ina219_address_t |
ina219 address enumeration definition
Definition at line 62 of file driver_ina219.h.
ina219 bus voltage enumeration definition
| Enumerator | |
|---|---|
| INA219_BUS_VOLTAGE_RANGE_16V | ±16V |
| INA219_BUS_VOLTAGE_RANGE_32V | ±32V |
Definition at line 85 of file driver_ina219.h.
| enum ina219_mode_t |
ina219 mode enumeration definition
Definition at line 123 of file driver_ina219.h.
| enum ina219_pga_t |
ina219 pga enumeration definition
| Enumerator | |
|---|---|
| INA219_PGA_40_MV | ±40 mV |
| INA219_PGA_80_MV | ±80 mV |
| INA219_PGA_160_MV | ±160 mV |
| INA219_PGA_320_MV | ±320 mV |
Definition at line 94 of file driver_ina219.h.
| uint8_t ina219_calculate_calibration | ( | ina219_handle_t * | handle, |
| uint16_t * | calibration ) |
calculate the calibration
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *calibration | pointer to a calibration data buffer |
Definition at line 863 of file driver_ina219.c.
| uint8_t ina219_deinit | ( | ina219_handle_t * | handle | ) |
close the chip
| [in] | *handle | pointer to an ina219 handle structure |
Definition at line 1092 of file driver_ina219.c.
| uint8_t ina219_get_addr_pin | ( | ina219_handle_t * | handle, |
| ina219_address_t * | addr_pin ) |
get the iic address pin
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *addr_pin | pointer to an address pin buffer |
Definition at line 187 of file driver_ina219.c.
| uint8_t ina219_get_bus_voltage_adc_mode | ( | ina219_handle_t * | handle, |
| ina219_adc_mode_t * | mode ) |
get the bus voltage adc mode
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *mode | pointer to an adc mode buffer |
Definition at line 435 of file driver_ina219.c.
| uint8_t ina219_get_bus_voltage_range | ( | ina219_handle_t * | handle, |
| ina219_bus_voltage_range_t * | range ) |
get the bus voltage range
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *range | pointer to a bus voltage range buffer |
Definition at line 285 of file driver_ina219.c.
| uint8_t ina219_get_calibration | ( | ina219_handle_t * | handle, |
| uint16_t * | data ) |
get the calibration
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *data | pointer to a calibration data buffer |
Definition at line 826 of file driver_ina219.c.
| uint8_t ina219_get_mode | ( | ina219_handle_t * | handle, |
| ina219_mode_t * | mode ) |
get the mode
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *mode | pointer to a chip mode buffer |
Definition at line 614 of file driver_ina219.c.
| uint8_t ina219_get_pga | ( | ina219_handle_t * | handle, |
| ina219_pga_t * | pga ) |
get the pga
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *pga | pointer to an adc pga buffer |
Definition at line 360 of file driver_ina219.c.
| uint8_t ina219_get_resistance | ( | ina219_handle_t * | handle, |
| double * | resistance ) |
get the resistance
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *resistance | pointer to a current sampling resistance value buffer |
Definition at line 145 of file driver_ina219.c.
| uint8_t ina219_get_shunt_voltage_adc_mode | ( | ina219_handle_t * | handle, |
| ina219_adc_mode_t * | mode ) |
get the shunt voltage adc mode
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *mode | pointer to an adc mode buffer |
Definition at line 510 of file driver_ina219.c.
| uint8_t ina219_info | ( | ina219_info_t * | info | ) |
get chip's information
| [out] | *info | pointer to an ina219 info structure |
Definition at line 1192 of file driver_ina219.c.
| uint8_t ina219_init | ( | ina219_handle_t * | handle | ) |
initialize the chip
| [in] | *handle | pointer to an ina219 handle structure |
Definition at line 992 of file driver_ina219.c.
| uint8_t ina219_read_bus_voltage | ( | ina219_handle_t * | handle, |
| uint16_t * | raw, | ||
| float * | mV ) |
read the bus voltage
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *raw | pointer to raw data buffer |
| [out] | *mV | pointer to converted data buffer |
Definition at line 697 of file driver_ina219.c.
| uint8_t ina219_read_current | ( | ina219_handle_t * | handle, |
| int16_t * | raw, | ||
| float * | mA ) |
read the current
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *raw | pointer to raw data buffer |
| [out] | *mA | pointer to converted data buffer |
Definition at line 747 of file driver_ina219.c.
| uint8_t ina219_read_power | ( | ina219_handle_t * | handle, |
| uint16_t * | raw, | ||
| float * | mW ) |
read the power
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *raw | pointer to raw data buffer |
| [out] | *mW | pointer to converted data buffer |
Definition at line 790 of file driver_ina219.c.
| uint8_t ina219_read_shunt_voltage | ( | ina219_handle_t * | handle, |
| int16_t * | raw, | ||
| float * | mV ) |
read the shunt voltage
| [in] | *handle | pointer to an ina219 handle structure |
| [out] | *raw | pointer to raw data buffer |
| [out] | *mV | pointer to converted data buffer |
Definition at line 652 of file driver_ina219.c.
| uint8_t ina219_set_addr_pin | ( | ina219_handle_t * | handle, |
| ina219_address_t | addr_pin ) |
set the iic address pin
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | addr_pin | address pin |
Definition at line 166 of file driver_ina219.c.
| uint8_t ina219_set_bus_voltage_adc_mode | ( | ina219_handle_t * | handle, |
| ina219_adc_mode_t | mode ) |
set the bus voltage adc mode
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | mode | adc mode |
Definition at line 397 of file driver_ina219.c.
| uint8_t ina219_set_bus_voltage_range | ( | ina219_handle_t * | handle, |
| ina219_bus_voltage_range_t | range ) |
set the bus voltage range
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | range | bus voltage range |
Definition at line 247 of file driver_ina219.c.
| uint8_t ina219_set_calibration | ( | ina219_handle_t * | handle, |
| uint16_t | data ) |
set the calibration
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | data | calibration data |
Definition at line 957 of file driver_ina219.c.
| uint8_t ina219_set_mode | ( | ina219_handle_t * | handle, |
| ina219_mode_t | mode ) |
set the mode
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | mode | chip mode |
Definition at line 547 of file driver_ina219.c.
| uint8_t ina219_set_pga | ( | ina219_handle_t * | handle, |
| ina219_pga_t | pga ) |
set the pga
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | pga | adc pga |
Definition at line 322 of file driver_ina219.c.
| uint8_t ina219_set_resistance | ( | ina219_handle_t * | handle, |
| double | resistance ) |
set the resistance
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | resistance | current sampling resistance value |
Definition at line 124 of file driver_ina219.c.
| uint8_t ina219_set_shunt_voltage_adc_mode | ( | ina219_handle_t * | handle, |
| ina219_adc_mode_t | mode ) |
set the shunt voltage adc mode
| [in] | *handle | pointer to an ina219 handle structure |
| [in] | mode | adc mode |
Definition at line 472 of file driver_ina219.c.
| uint8_t ina219_soft_reset | ( | ina219_handle_t * | handle | ) |
soft reset the chip
| [in] | *handle | pointer to an ina219 handle structure |
Definition at line 209 of file driver_ina219.c.