OpenBIC
OpenSource Bridge-IC
ina230.c File Reference
#include <stdio.h>
#include <string.h>
#include "ina230.h"
#include "sensor.h"
#include "hal_i2c.h"
#include <logging/log.h>
Include dependency graph for ina230.c:

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)
 

Macro Definition Documentation

◆ I2C_RETRY

#define I2C_RETRY   5

◆ INA230_ALT_BOL_OFFSET

#define INA230_ALT_BOL_OFFSET   0x2000

◆ INA230_ALT_BUL_OFFSET

#define INA230_ALT_BUL_OFFSET   0x1000

◆ INA230_ALT_MASK

#define INA230_ALT_MASK   0xF800

◆ INA230_ALT_POL_OFFSET

#define INA230_ALT_POL_OFFSET   0x0800

◆ INA230_ALT_SOL_OFFSET

#define INA230_ALT_SOL_OFFSET   0x8000

◆ INA230_ALT_SUL_OFFSET

#define INA230_ALT_SUL_OFFSET   0x4000

◆ INA230_BUS_VOLTAGE_LSB

#define INA230_BUS_VOLTAGE_LSB   0.00125

◆ INA230_VSH_VOLTAGE_LSB

#define INA230_VSH_VOLTAGE_LSB   0.0000025

Function Documentation

◆ ina230_init()

uint8_t ina230_init ( sensor_cfg cfg)
Here is the call graph for this function:

◆ ina230_read()

uint8_t ina230_read ( sensor_cfg cfg,
int *  reading 
)
Here is the call graph for this function:

◆ ina230_reset_alt()

uint8_t ina230_reset_alt ( sensor_cfg cfg)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_ina230  )