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

Classes

struct  LTC4286_MBR_TABLE
 

Macros

#define LTC4286_MFR_CONFIG1   0xF2
 
#define I2C_DATA_SIZE   5
 

Enumerations

enum  VRANGE_SELECT { VRANGE_SELECT_25_6_V = 0x0 , VRANGE_SELECT_102_4_V = 0x1 , BOTH = 0x2 }
 
enum  SENSOR_TYPE { VOLTAGE = 0x0 , CURRENT = 0x1 , POWER = 0x2 , TEMPERATURE = 0x3 }
 

Functions

 LOG_MODULE_REGISTER (ltc4286)
 
int ltc4286_convert_real_value (uint8_t type, uint8_t vrange_select, float rsense, uint16_t tmp_val, double *val)
 
int ltc4286_read_iin (sensor_cfg *cfg, double *val)
 
int ltc4286_read_pout (sensor_cfg *cfg, double *val)
 
uint8_t ltc4286_read (sensor_cfg *cfg, int *reading)
 
uint8_t ltc4286_init (sensor_cfg *cfg)
 

Variables

struct LTC4286_MBR_TABLE ltc4286_mbr_table []
 

Macro Definition Documentation

◆ I2C_DATA_SIZE

#define I2C_DATA_SIZE   5

◆ LTC4286_MFR_CONFIG1

#define LTC4286_MFR_CONFIG1   0xF2

Enumeration Type Documentation

◆ SENSOR_TYPE

Enumerator
VOLTAGE 
CURRENT 
POWER 
TEMPERATURE 

◆ VRANGE_SELECT

Enumerator
VRANGE_SELECT_25_6_V 
VRANGE_SELECT_102_4_V 
BOTH 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( ltc4286  )

◆ ltc4286_convert_real_value()

int ltc4286_convert_real_value ( uint8_t  type,
uint8_t  vrange_select,
float  rsense,
uint16_t  tmp_val,
double *  val 
)

◆ ltc4286_init()

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

◆ ltc4286_read()

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

◆ ltc4286_read_iin()

int ltc4286_read_iin ( sensor_cfg cfg,
double *  val 
)

◆ ltc4286_read_pout()

int ltc4286_read_pout ( sensor_cfg cfg,
double *  val 
)

Variable Documentation

◆ ltc4286_mbr_table

struct LTC4286_MBR_TABLE ltc4286_mbr_table[]
Initial value:
= {
{ VOLTAGE, VRANGE_SELECT_102_4_V, 32, false, 0.1, 0 },
{ VOLTAGE, VRANGE_SELECT_25_6_V, 128, false, 0.1, 0 },
{ CURRENT, BOTH, 1024, true, 0.001, 0 },
{ POWER, VRANGE_SELECT_102_4_V, 1, true, 0.0001, 0 },
{ POWER, VRANGE_SELECT_25_6_V, 4, true, 0.0001, 0 },
{ TEMPERATURE, BOTH, 1, false, 1, 273.15 },
}
@ BOTH
Definition: ltc4286.c:35
@ VRANGE_SELECT_102_4_V
Definition: ltc4286.c:34
@ VRANGE_SELECT_25_6_V
Definition: ltc4286.c:33
@ POWER
Definition: ltc4286.c:41
@ CURRENT
Definition: ltc4286.c:40
@ VOLTAGE
Definition: ltc4286.c:39
@ TEMPERATURE
Definition: ltc4286.c:42