OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>
#include <string.h>
#include "ina230.h"
#include "sensor.h"
#include "hal_i2c.h"
#include <logging/log.h>
Macros | |
#define | I2C_RETRY 5 |
#define | INA230_BUS_VOLTAGE_LSB 0.00125 |
#define | INA230_VSH_VOLTAGE_LSB 0.0000025 |
#define | INA230_ALT_MASK 0xF800 |
#define | INA230_ALT_SOL_OFFSET 0x8000 |
#define | INA230_ALT_SUL_OFFSET 0x4000 |
#define | INA230_ALT_BOL_OFFSET 0x2000 |
#define | INA230_ALT_BUL_OFFSET 0x1000 |
#define | INA230_ALT_POL_OFFSET 0x0800 |
Functions | |
LOG_MODULE_REGISTER (dev_ina230) | |
uint8_t | ina230_reset_alt (sensor_cfg *cfg) |
uint8_t | ina230_read (sensor_cfg *cfg, int *reading) |
uint8_t | ina230_init (sensor_cfg *cfg) |
#define I2C_RETRY 5 |
#define INA230_ALT_BOL_OFFSET 0x2000 |
#define INA230_ALT_BUL_OFFSET 0x1000 |
#define INA230_ALT_MASK 0xF800 |
#define INA230_ALT_POL_OFFSET 0x0800 |
#define INA230_ALT_SOL_OFFSET 0x8000 |
#define INA230_ALT_SUL_OFFSET 0x4000 |
#define INA230_BUS_VOLTAGE_LSB 0.00125 |
#define INA230_VSH_VOLTAGE_LSB 0.0000025 |
uint8_t ina230_init | ( | sensor_cfg * | cfg | ) |
uint8_t ina230_read | ( | sensor_cfg * | cfg, |
int * | reading | ||
) |
uint8_t ina230_reset_alt | ( | sensor_cfg * | cfg | ) |
LOG_MODULE_REGISTER | ( | dev_ina230 | ) |