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

Classes

struct  raa_config
 
struct  raa_data
 

Macros

#define VR_IMG_HDR_SYMBOL   0x49
 
#define VR_IMG_BODY_SYMBOL   0x00
 
#define VR_WARN_REMAIN_WR   3
 
#define VR_RAA_REG_REMAIN_WR   0x35
 
#define VR_RAA_REG_DMA_ADDR   0xC7
 
#define VR_RAA_REG_DMA_DATA   0xC5
 
#define VR_RAA_REG_HEX_MODE_CFG0   0x87
 
#define VR_RAA_REG_HEX_MODE_CFG1   0xBD
 
#define VR_RAA_REG_CRC   0x94
 
#define VR_RAA_REG_PROG_STATUS   0x7E
 
#define VR_RAA_GEN3_SW_REV_MIN   0x06
 
#define VR_RAA_GEN3_HW_REV_MIN   0x00
 
#define VR_RAA_REG_GEN2_CRC   0x3F
 
#define VR_RAA_GEN2_SW_REV_MIN   0x02
 
#define VR_RAA_GEN2_HW_REV_MIN   0x03
 
#define VR_RAA_REG_GEN2_REMAIN_WR   0xC2
 
#define VR_RAA_REG_GEN2_PROG_STATUS   0x07
 
#define ISL69259_READ_VOUT_RESOLUTION   0.001
 
#define ISL69260_VOUT_MAX_REG   0x24
 
#define ISL69260_VOUT_MIN_REG   0x2B
 

Typedefs

typedef struct raa_config raa_config_t
 

Enumerations

enum  { RAA_GEN2 , RAA_GEN3_LEGACY , RAA_GEN3_PRODUCTION }
 

Functions

 LOG_MODULE_REGISTER (isl69259)
 
bool isl69260_i2c_read (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len)
 
bool isl69260_i2c_write (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len)
 
bool isl69260_set_page (uint8_t bus, uint8_t addr, uint8_t page)
 
bool isl69260_get_vout_max (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool isl69260_get_vout_min (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool isl69260_set_vout_max (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool isl69260_set_vout_min (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool get_raa_remaining_wr (uint8_t bus, uint8_t addr, uint8_t mode, uint16_t *remain)
 
bool isl69259_get_raa_crc (uint8_t bus, uint8_t addr, uint8_t mode, uint32_t *crc)
 
bool isl69259_get_raa_hex_mode (uint8_t bus, uint8_t addr, uint8_t *mode)
 
bool isl69259_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size)
 
bool isl69260_get_vout_command (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool isl69260_set_vout_command (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool isl69260_get_vr_status (sensor_cfg *cfg, uint8_t rail, uint8_t vr_status_rail, uint16_t *vr_status)
 
bool isl69260_clear_vr_status (sensor_cfg *cfg, uint8_t rail)
 
bool adjust_of_twos_complement (uint8_t offset, int *val)
 
uint8_t isl69259_read (sensor_cfg *cfg, int *reading)
 
uint8_t isl69259_init (sensor_cfg *cfg)
 

Variables

uint8_t addr
 
uint8_t cmd
 
uint8_t data []
 

Macro Definition Documentation

◆ ISL69259_READ_VOUT_RESOLUTION

#define ISL69259_READ_VOUT_RESOLUTION   0.001

◆ ISL69260_VOUT_MAX_REG

#define ISL69260_VOUT_MAX_REG   0x24

◆ ISL69260_VOUT_MIN_REG

#define ISL69260_VOUT_MIN_REG   0x2B

◆ VR_IMG_BODY_SYMBOL

#define VR_IMG_BODY_SYMBOL   0x00

◆ VR_IMG_HDR_SYMBOL

#define VR_IMG_HDR_SYMBOL   0x49

◆ VR_RAA_GEN2_HW_REV_MIN

#define VR_RAA_GEN2_HW_REV_MIN   0x03

◆ VR_RAA_GEN2_SW_REV_MIN

#define VR_RAA_GEN2_SW_REV_MIN   0x02

◆ VR_RAA_GEN3_HW_REV_MIN

#define VR_RAA_GEN3_HW_REV_MIN   0x00

◆ VR_RAA_GEN3_SW_REV_MIN

#define VR_RAA_GEN3_SW_REV_MIN   0x06

◆ VR_RAA_REG_CRC

#define VR_RAA_REG_CRC   0x94

◆ VR_RAA_REG_DMA_ADDR

#define VR_RAA_REG_DMA_ADDR   0xC7

◆ VR_RAA_REG_DMA_DATA

#define VR_RAA_REG_DMA_DATA   0xC5

◆ VR_RAA_REG_GEN2_CRC

#define VR_RAA_REG_GEN2_CRC   0x3F

◆ VR_RAA_REG_GEN2_PROG_STATUS

#define VR_RAA_REG_GEN2_PROG_STATUS   0x07

◆ VR_RAA_REG_GEN2_REMAIN_WR

#define VR_RAA_REG_GEN2_REMAIN_WR   0xC2

◆ VR_RAA_REG_HEX_MODE_CFG0

#define VR_RAA_REG_HEX_MODE_CFG0   0x87

◆ VR_RAA_REG_HEX_MODE_CFG1

#define VR_RAA_REG_HEX_MODE_CFG1   0xBD

◆ VR_RAA_REG_PROG_STATUS

#define VR_RAA_REG_PROG_STATUS   0x7E

◆ VR_RAA_REG_REMAIN_WR

#define VR_RAA_REG_REMAIN_WR   0x35

◆ VR_WARN_REMAIN_WR

#define VR_WARN_REMAIN_WR   3

Typedef Documentation

◆ raa_config_t

typedef struct raa_config raa_config_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RAA_GEN2 
RAA_GEN3_LEGACY 
RAA_GEN3_PRODUCTION 

Function Documentation

◆ adjust_of_twos_complement()

bool adjust_of_twos_complement ( uint8_t  offset,
int *  val 
)

◆ get_raa_remaining_wr()

bool get_raa_remaining_wr ( uint8_t  bus,
uint8_t  addr,
uint8_t  mode,
uint16_t *  remain 
)

◆ isl69259_fwupdate()

bool isl69259_fwupdate ( uint8_t  bus,
uint8_t  addr,
uint8_t *  img_buff,
uint32_t  img_size 
)

◆ isl69259_get_raa_crc()

bool isl69259_get_raa_crc ( uint8_t  bus,
uint8_t  addr,
uint8_t  mode,
uint32_t *  crc 
)

◆ isl69259_get_raa_hex_mode()

bool isl69259_get_raa_hex_mode ( uint8_t  bus,
uint8_t  addr,
uint8_t *  mode 
)

◆ isl69259_init()

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

◆ isl69259_read()

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

◆ isl69260_clear_vr_status()

bool isl69260_clear_vr_status ( sensor_cfg cfg,
uint8_t  rail 
)
Here is the call graph for this function:

◆ isl69260_get_vout_command()

bool isl69260_get_vout_command ( sensor_cfg cfg,
uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ isl69260_get_vout_max()

bool isl69260_get_vout_max ( sensor_cfg cfg,
uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ isl69260_get_vout_min()

bool isl69260_get_vout_min ( sensor_cfg cfg,
uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ isl69260_get_vr_status()

bool isl69260_get_vr_status ( sensor_cfg cfg,
uint8_t  rail,
uint8_t  vr_status_rail,
uint16_t *  vr_status 
)
Here is the call graph for this function:

◆ isl69260_i2c_read()

bool isl69260_i2c_read ( uint8_t  bus,
uint8_t  addr,
uint8_t  reg,
uint8_t *  data,
uint8_t  len 
)
Here is the call graph for this function:

◆ isl69260_i2c_write()

bool isl69260_i2c_write ( uint8_t  bus,
uint8_t  addr,
uint8_t  reg,
uint8_t *  data,
uint8_t  len 
)
Here is the call graph for this function:

◆ isl69260_set_page()

bool isl69260_set_page ( uint8_t  bus,
uint8_t  addr,
uint8_t  page 
)
Here is the call graph for this function:

◆ isl69260_set_vout_command()

bool isl69260_set_vout_command ( sensor_cfg cfg,
uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ isl69260_set_vout_max()

bool isl69260_set_vout_max ( sensor_cfg cfg,
uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ isl69260_set_vout_min()

bool isl69260_set_vout_min ( sensor_cfg cfg,
uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( isl69259  )

Variable Documentation

◆ addr

uint8_t addr

◆ cmd

uint8_t cmd

◆ data