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

Classes

struct  raa_data
 
struct  raa228249_config
 

Macros

#define raa228249_READ_VOUT_RESOLUTION   0.001
 
#define raa228249_READ_IOUT_RESOLUTION   0.1
 
#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_PROG_STATUS   0x83
 
#define VR_RAA_REG_CRC   0xF8
 
#define VR_RAA_REG_DEVID   0xAD
 
#define VR_RAA_DEV_ID_LEN   4
 
#define VR_RAA_DEV_REV_LEN   4
 
#define VR_RAA_CHECKSUM_LEN   4
 
#define VR_RAA_CFG_ID   (7)
 
#define VR_RAA_GEN3P5_FILE_HEAD   (5)
 
#define VR_RAA_GEN3P5_CRC   (336 - VR_RAA_GEN3P5_FILE_HEAD)
 
#define VR_WARN_REMAIN_WR   3
 
#define MAX_CMD_LINE   1500
 
#define RAA228249_VOUT_MAX_REG   0x24
 
#define RAA228249_VOUT_MIN_REG   0x2B
 

Enumerations

enum  { LINE_NEW , LINE_PARSING }
 

Functions

 LOG_MODULE_REGISTER (raa228249)
 
bool raa228249_i2c_read (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len)
 
bool raa228249_i2c_write (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len)
 
bool raa228249_get_vout_max (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool raa228249_get_vout_min (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool raa228249_set_vout_max (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool raa228249_set_vout_min (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
int raa228249_get_remaining_wr (uint8_t bus, uint8_t addr, uint8_t *remain)
 
bool raa228249_get_crc (uint8_t bus, uint8_t addr, uint32_t *crc)
 
bool raa228249_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size)
 
bool raa228249_get_vout_command (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool raa228249_set_vout_command (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt)
 
bool raa228249_get_vr_status (sensor_cfg *cfg, uint8_t rail, uint8_t vr_status_rail, uint16_t *vr_status)
 
bool raa228249_clear_vr_status (sensor_cfg *cfg, uint8_t rail)
 
uint8_t raa228249_read (sensor_cfg *cfg, int *reading)
 
uint8_t raa228249_init (sensor_cfg *cfg)
 

Variables

uint8_t addr
 
uint8_t cmd
 
uint8_t data []
 

Macro Definition Documentation

◆ MAX_CMD_LINE

#define MAX_CMD_LINE   1500

◆ raa228249_READ_IOUT_RESOLUTION

#define raa228249_READ_IOUT_RESOLUTION   0.1

◆ raa228249_READ_VOUT_RESOLUTION

#define raa228249_READ_VOUT_RESOLUTION   0.001

◆ RAA228249_VOUT_MAX_REG

#define RAA228249_VOUT_MAX_REG   0x24

◆ RAA228249_VOUT_MIN_REG

#define RAA228249_VOUT_MIN_REG   0x2B

◆ VR_RAA_CFG_ID

#define VR_RAA_CFG_ID   (7)

◆ VR_RAA_CHECKSUM_LEN

#define VR_RAA_CHECKSUM_LEN   4

◆ VR_RAA_DEV_ID_LEN

#define VR_RAA_DEV_ID_LEN   4

◆ VR_RAA_DEV_REV_LEN

#define VR_RAA_DEV_REV_LEN   4

◆ VR_RAA_GEN3P5_CRC

#define VR_RAA_GEN3P5_CRC   (336 - VR_RAA_GEN3P5_FILE_HEAD)

◆ VR_RAA_GEN3P5_FILE_HEAD

#define VR_RAA_GEN3P5_FILE_HEAD   (5)

◆ VR_RAA_REG_CRC

#define VR_RAA_REG_CRC   0xF8

◆ VR_RAA_REG_DEVID

#define VR_RAA_REG_DEVID   0xAD

◆ 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_PROG_STATUS

#define VR_RAA_REG_PROG_STATUS   0x83

◆ VR_RAA_REG_REMAIN_WR

#define VR_RAA_REG_REMAIN_WR   0x35

◆ VR_WARN_REMAIN_WR

#define VR_WARN_REMAIN_WR   3

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LINE_NEW 
LINE_PARSING 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( raa228249  )

◆ raa228249_clear_vr_status()

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

◆ raa228249_fwupdate()

bool raa228249_fwupdate ( uint8_t  bus,
uint8_t  addr,
uint8_t *  img_buff,
uint32_t  img_size 
)
Here is the call graph for this function:

◆ raa228249_get_crc()

bool raa228249_get_crc ( uint8_t  bus,
uint8_t  addr,
uint32_t *  crc 
)

◆ raa228249_get_remaining_wr()

int raa228249_get_remaining_wr ( uint8_t  bus,
uint8_t  addr,
uint8_t *  remain 
)

◆ raa228249_get_vout_command()

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

◆ raa228249_get_vout_max()

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

◆ raa228249_get_vout_min()

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

◆ raa228249_get_vr_status()

bool raa228249_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:

◆ raa228249_i2c_read()

bool raa228249_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:

◆ raa228249_i2c_write()

bool raa228249_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:

◆ raa228249_init()

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

◆ raa228249_read()

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

◆ raa228249_set_vout_command()

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

◆ raa228249_set_vout_max()

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

◆ raa228249_set_vout_min()

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

Variable Documentation

◆ addr

uint8_t addr

◆ cmd

uint8_t cmd

◆ data

uint8_t data[]