![]() |
LibDriver INA219
|
driver ina219 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | ina219_handle_s |
| ina219 handle structure definition More... | |
| struct | ina219_info_s |
| ina219 information structure definition More... | |
Macros | |
| #define | DRIVER_INA219_LINK_INIT(HANDLE, STRUCTURE) |
| initialize ina219_handle_t structure | |
| #define | DRIVER_INA219_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init function | |
| #define | DRIVER_INA219_LINK_IIC_DEINIT(HANDLE, FUC) |
| link iic_deinit function | |
| #define | DRIVER_INA219_LINK_IIC_READ(HANDLE, FUC) |
| link iic_read function | |
| #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 | |
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 | |
| uint8_t | ina219_set_reg (ina219_handle_t *handle, uint8_t reg, uint16_t data) |
| set the chip register | |
| uint8_t | ina219_get_reg (ina219_handle_t *handle, uint8_t reg, uint16_t *data) |
| get the chip register | |
driver ina219 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2021/06/13 | 1.0 | Shifeng Li | first upload |
Definition in file driver_ina219.h.