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

Classes

struct  mpq8746_data
 
struct  mpq8746_config
 

Macros

#define VR_MPS_VEND_ID   0x4D5053
 
#define MAX_CMD_LINE   720
 
#define VR_MPS_PAGE_0   0x00
 
#define VR_REG_STORE_USR_ALL   0x15
 
#define VR_REG_VOUT_MODE   0x20
 
#define VR_REG_MFR_ID   0x99
 
#define VR_REG_MFR_CFG_ID   0xC0
 
#define VR_REG_MFR_CFG_CODE_REV   0xC1
 
#define VR_REG_CRC_USR   0xF8
 

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  { VOUT_MODE_DIRECT , VOUT_MODE_VID , VOUT_MODE_LINEAR , VOUT_MODE_UNKNOWN = 0xFF }
 

Functions

 LOG_MODULE_REGISTER (mpq8746)
 
bool mpq8746_get_fw_version (uint8_t bus, uint8_t addr, uint16_t *rev)
 
bool mpq8746_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size)
 
uint8_t mpq8746_read (sensor_cfg *cfg, int *reading)
 
uint8_t mpq8746_init (sensor_cfg *cfg)
 

Variables

uint8_t vr_vout_mode = VOUT_MODE_UNKNOWN
 

Macro Definition Documentation

◆ MAX_CMD_LINE

#define MAX_CMD_LINE   720

◆ VR_MPS_PAGE_0

#define VR_MPS_PAGE_0   0x00

◆ VR_MPS_VEND_ID

#define VR_MPS_VEND_ID   0x4D5053

◆ VR_REG_CRC_USR

#define VR_REG_CRC_USR   0xF8

◆ VR_REG_MFR_CFG_CODE_REV

#define VR_REG_MFR_CFG_CODE_REV   0xC1

◆ VR_REG_MFR_CFG_ID

#define VR_REG_MFR_CFG_ID   0xC0

◆ VR_REG_MFR_ID

#define VR_REG_MFR_ID   0x99

◆ VR_REG_STORE_USR_ALL

#define VR_REG_STORE_USR_ALL   0x15

◆ VR_REG_VOUT_MODE

#define VR_REG_VOUT_MODE   0x20

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ATE_CONF_ID 
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 

◆ anonymous enum

anonymous enum
Enumerator
VOUT_MODE_DIRECT 
VOUT_MODE_VID 
VOUT_MODE_LINEAR 
VOUT_MODE_UNKNOWN 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( mpq8746  )

◆ mpq8746_fwupdate()

bool mpq8746_fwupdate ( uint8_t  bus,
uint8_t  addr,
uint8_t *  img_buff,
uint32_t  img_size 
)

◆ mpq8746_get_fw_version()

bool mpq8746_get_fw_version ( uint8_t  bus,
uint8_t  addr,
uint16_t *  rev 
)

◆ mpq8746_init()

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

◆ mpq8746_read()

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

Variable Documentation

◆ vr_vout_mode

uint8_t vr_vout_mode = VOUT_MODE_UNKNOWN