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

Macros

#define INA233_CALIBRATION_OFFSET   0xD4
 
#define INA233_MFR_ADC_CONFIG   0xD0
 
#define INA233_MFR_DEVICE_CONFIG   0xD5
 
#define INA233_MFR_ALERT_MASK   0xD2
 
#define INA233_IOUT_OC_WARN_LIMIT_REG   0x4A
 
#define INA233_VIN_OV_WARN_LIMIT_REG   0x57
 
#define INA233_VIN_UV_WARN_LIMIT_REG   0x58
 
#define INA233_PIN_OP_WARN_LIMIT_REG   0x6B
 
#define INA233_EIN_POWER_CNT_MAX   0x10000
 

Functions

 LOG_MODULE_REGISTER (dev_ina233)
 
int ina233_read_ein (sensor_cfg *cfg, int16_t *val)
 
uint8_t ina233_read (sensor_cfg *cfg, int *reading)
 
uint8_t ina233_init (sensor_cfg *cfg)
 

Variables

uint8_t INA233_DEVICE_ID [3] = { 0x02, 0x54, 0x49 }
 

Macro Definition Documentation

◆ INA233_CALIBRATION_OFFSET

#define INA233_CALIBRATION_OFFSET   0xD4

◆ INA233_EIN_POWER_CNT_MAX

#define INA233_EIN_POWER_CNT_MAX   0x10000

◆ INA233_IOUT_OC_WARN_LIMIT_REG

#define INA233_IOUT_OC_WARN_LIMIT_REG   0x4A

◆ INA233_MFR_ADC_CONFIG

#define INA233_MFR_ADC_CONFIG   0xD0

◆ INA233_MFR_ALERT_MASK

#define INA233_MFR_ALERT_MASK   0xD2

◆ INA233_MFR_DEVICE_CONFIG

#define INA233_MFR_DEVICE_CONFIG   0xD5

◆ INA233_PIN_OP_WARN_LIMIT_REG

#define INA233_PIN_OP_WARN_LIMIT_REG   0x6B

◆ INA233_VIN_OV_WARN_LIMIT_REG

#define INA233_VIN_OV_WARN_LIMIT_REG   0x57

◆ INA233_VIN_UV_WARN_LIMIT_REG

#define INA233_VIN_UV_WARN_LIMIT_REG   0x58

Function Documentation

◆ ina233_init()

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

◆ ina233_read()

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

◆ ina233_read_ein()

int ina233_read_ein ( sensor_cfg cfg,
int16_t *  val 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_ina233  )

Variable Documentation

◆ INA233_DEVICE_ID

uint8_t INA233_DEVICE_ID[3] = { 0x02, 0x54, 0x49 }