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

Classes

struct  raa_data
 
struct  raa229621_config
 

Macros

#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   0x7E
 
#define VR_RAA_REG_CRC   0x94
 
#define VR_RAA_REG_DEVID   0xAD
 
#define VR_RAA_REG_HEX_MODE_CFG0   0x87
 
#define VR_RAA_REG_HEX_MODE_CFG1   0xBD
 
#define VR_RAA_GEN3_SW_REV_MIN   0x06
 
#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_GEN3_FILE_HEAD   (5)
 
#define VR_RAA_GEN3_LEGACY_CRC   (276 - VR_RAA_GEN3_FILE_HEAD)
 
#define VR_RAA_GEN3_PRODUCTION_CRC   (290 - VR_RAA_GEN3_FILE_HEAD)
 
#define VR_WARN_REMAIN_WR   3
 
#define MAX_CMD_LINE   1024
 

Enumerations

enum  { RAA_GEN3_LEGACY , RAA_GEN3_PRODUCTION }
 
enum  { LINE_NEW , LINE_PARSING }
 

Functions

 LOG_MODULE_REGISTER (raa229621)
 
uint8_t raa229621_read (sensor_cfg *cfg, int *reading)
 
int raa229621_get_hex_mode (uint8_t bus, uint8_t addr, uint8_t *mode)
 
int raa229621_get_remaining_wr (uint8_t bus, uint8_t addr, uint8_t *remain)
 
bool raa229621_get_crc (uint8_t bus, uint8_t addr, uint32_t *crc)
 
bool raa229621_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size)
 
uint8_t raa229621_init (sensor_cfg *cfg)
 

Variables

uint8_t addr
 
uint8_t cmd
 
uint8_t data []
 

Macro Definition Documentation

◆ MAX_CMD_LINE

#define MAX_CMD_LINE   1024

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

#define VR_RAA_GEN3_FILE_HEAD   (5)

◆ VR_RAA_GEN3_LEGACY_CRC

#define VR_RAA_GEN3_LEGACY_CRC   (276 - VR_RAA_GEN3_FILE_HEAD)

◆ VR_RAA_GEN3_PRODUCTION_CRC

#define VR_RAA_GEN3_PRODUCTION_CRC   (290 - VR_RAA_GEN3_FILE_HEAD)

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RAA_GEN3_LEGACY 
RAA_GEN3_PRODUCTION 

◆ anonymous enum

anonymous enum
Enumerator
LINE_NEW 
LINE_PARSING 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( raa229621  )

◆ raa229621_fwupdate()

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

◆ raa229621_get_crc()

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

◆ raa229621_get_hex_mode()

int raa229621_get_hex_mode ( uint8_t  bus,
uint8_t  addr,
uint8_t *  mode 
)

◆ raa229621_get_remaining_wr()

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

◆ raa229621_init()

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

◆ raa229621_read()

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

Variable Documentation

◆ addr

uint8_t addr

◆ cmd

uint8_t cmd

◆ data

uint8_t data[]