OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <logging/log.h>
#include "mp289x.h"
#include "sensor.h"
#include "hal_i2c.h"
#include "pmbus.h"
Classes | |
struct | mp289x_data |
struct | mp289x_config |
Enumerations | |
enum | { ATE_CONF_ID = 0 , ATE_PAGE_NUM , ATE_REG_ADDR_HEX , ATE_REG_ADDR_DEC , ATE_REG_NAME , ATE_REG_DATA_HEX , ATE_REG_DATA_DEC , ATE_COL_MAX } |
enum | { MODE_USR , MODE_MULTI_CFG_12 , MODE_MULTI_CFG_34 , MODE_MULTI_CFG_56 , MODE_MULTI_CFG_ALL } |
Functions | |
LOG_MODULE_REGISTER (mp289x) | |
bool | mp289x_get_fw_version (uint8_t bus, uint8_t addr, uint16_t *rev) |
bool | mp289x_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size) |
uint8_t | mp289x_read (sensor_cfg *cfg, int *reading) |
uint8_t | mp289x_init (sensor_cfg *cfg) |
Variables | |
uint8_t | total_current_set = 0xFF |
#define CRC_CHECK_START_KEY "CRC_CHECK_START" |
#define CRC_CHECK_STOP_KEY "CRC_CHECK_STOP" |
#define CRC_GP12_KEY "CRC_M1M2" |
#define CRC_GP34_KEY "CRC_M3M4" |
#define CRC_GP56_KEY "CRC_M5M6" |
#define CRC_USR_KEY "CRC_P0P1" |
#define MAX_CMD_LINE 720 |
#define USR_END_KEY "END" |
#define VR_MPS_PAGE_0 0x00 |
#define VR_MPS_PAGE_1 0x01 |
#define VR_MPS_PAGE_14 0x14 |
#define VR_MPS_PAGE_24 0x24 |
#define VR_MPS_PAGE_3 0x03 |
#define VR_MPS_PAGE_34 0x34 |
#define VR_MPS_PAGE_4 0x04 |
#define VR_MPS_PAGE_44 0x44 |
#define VR_MPS_PAGE_54 0x54 |
#define VR_MPS_PAGE_64 0x64 |
#define VR_MPS_PAGE_9E 0x9E |
#define VR_MPS_PAGE_9F 0x9F |
#define VR_REG_CFG_REV 0x47 |
#define VR_REG_CRC_GP12_HI 0xFE |
#define VR_REG_CRC_GP12_LO 0xFF |
#define VR_REG_CRC_GP34_HI 0x7E |
#define VR_REG_CRC_GP34_LO 0x7F |
#define VR_REG_CRC_GP56_HI 0xFE |
#define VR_REG_CRC_GP56_LO 0xFF |
#define VR_REG_CRC_USR 0xF6 |
#define VR_REG_EN_WR_PROT 0x0F |
#define VR_REG_FAULT_CLR 0x03 |
#define VR_REG_MFR_IMON_DIGI_GAIN 0xD0 |
#define VR_REG_MTP_CTRL 0xD0 |
#define VR_REG_MTP_FAULT_CLR 0xFF |
#define VR_REG_OFFLINE_CTL 0xF3 |
#define VR_REG_STAT_CML 0x7E |
#define VR_REG_STAT_PMBUS 0x8A |
#define VR_REG_STORE_CFG_ALL 0x15 |
#define VR_REG_STORE_CFG_GP12 0xF5 |
#define VR_REG_STORE_CFG_GP34 0xF6 |
#define VR_REG_STORE_CFG_GP56 0xF7 |
#define VR_REG_STORE_STAT 0x35 |
#define VR_REG_STORE_USR 0x17 |
anonymous enum |
anonymous enum |
LOG_MODULE_REGISTER | ( | mp289x | ) |
bool mp289x_fwupdate | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | img_buff, | ||
uint32_t | img_size | ||
) |
bool mp289x_get_fw_version | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint16_t * | rev | ||
) |
uint8_t mp289x_init | ( | sensor_cfg * | cfg | ) |
uint8_t mp289x_read | ( | sensor_cfg * | cfg, |
int * | reading | ||
) |
uint8_t total_current_set = 0xFF |