OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sensor.h"
#include "hal_i2c.h"
#include "pmbus.h"
#include <logging/log.h>
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 [] |
#define MAX_CMD_LINE 1024 |
#define VR_RAA_CFG_ID (7) |
#define VR_RAA_CHECKSUM_LEN 4 |
#define VR_RAA_DEV_ID_LEN 4 |
#define VR_RAA_DEV_REV_LEN 4 |
#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_RAA_GEN3_SW_REV_MIN 0x06 |
#define VR_RAA_REG_CRC 0x94 |
#define VR_RAA_REG_DEVID 0xAD |
#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_PROG_STATUS 0x7E |
#define VR_RAA_REG_REMAIN_WR 0x35 |
#define VR_WARN_REMAIN_WR 3 |
LOG_MODULE_REGISTER | ( | raa229621 | ) |
bool raa229621_fwupdate | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | img_buff, | ||
uint32_t | img_size | ||
) |
bool raa229621_get_crc | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint32_t * | crc | ||
) |
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 | ||
) |
uint8_t raa229621_init | ( | sensor_cfg * | cfg | ) |
uint8_t raa229621_read | ( | sensor_cfg * | cfg, |
int * | reading | ||
) |
uint8_t addr |
uint8_t cmd |
uint8_t data[] |