OpenBIC
OpenSource Bridge-IC
|
#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>
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 [] |
#define MAX_CMD_LINE 1500 |
#define raa228249_READ_IOUT_RESOLUTION 0.1 |
#define raa228249_READ_VOUT_RESOLUTION 0.001 |
#define RAA228249_VOUT_MAX_REG 0x24 |
#define RAA228249_VOUT_MIN_REG 0x2B |
#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_GEN3P5_CRC (336 - VR_RAA_GEN3P5_FILE_HEAD) |
#define VR_RAA_GEN3P5_FILE_HEAD (5) |
#define VR_RAA_REG_CRC 0xF8 |
#define VR_RAA_REG_DEVID 0xAD |
#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_REMAIN_WR 0x35 |
#define VR_WARN_REMAIN_WR 3 |
LOG_MODULE_REGISTER | ( | raa228249 | ) |
bool raa228249_clear_vr_status | ( | sensor_cfg * | cfg, |
uint8_t | rail | ||
) |
bool raa228249_fwupdate | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | img_buff, | ||
uint32_t | img_size | ||
) |
bool raa228249_get_crc | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint32_t * | crc | ||
) |
int raa228249_get_remaining_wr | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | remain | ||
) |
bool raa228249_get_vout_command | ( | sensor_cfg * | cfg, |
uint8_t | rail, | ||
uint16_t * | millivolt | ||
) |
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_get_vr_status | ( | sensor_cfg * | cfg, |
uint8_t | rail, | ||
uint8_t | vr_status_rail, | ||
uint16_t * | vr_status | ||
) |
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 | ||
) |
uint8_t raa228249_init | ( | sensor_cfg * | cfg | ) |
uint8_t raa228249_read | ( | sensor_cfg * | cfg, |
int * | reading | ||
) |
bool raa228249_set_vout_command | ( | 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 | ||
) |
uint8_t addr |
uint8_t cmd |
uint8_t data[] |