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

Macros

#define DAC_2P5MV_EN_BIT   BIT(13)
 
#define MFR_VID_RES_MASK   GENMASK(15, 14)
 
#define IOUT_SCALE_MASK   GENMASK(2, 0)
 
#define IOUT_MASK   GENMASK(10, 0)
 
#define MFR_SVI3_IOUT_RPT   0x65
 
#define MFR_VOUT_LOOP_CTRL   0xBD
 
#define VR_MPS_PAGE_1   0x01
 
#define VR_REG_EXPECTED_USER_CRC   0xF0
 

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
}
 

Functions

 LOG_MODULE_REGISTER (mp2891)
 
bool mp2891_get_fw_version (uint8_t bus, uint8_t addr, uint32_t *rev)
 
float mp2891_get_resolution (sensor_cfg *cfg)
 
uint8_t mp2891_read (sensor_cfg *cfg, int *reading)
 
uint8_t mp2891_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ DAC_2P5MV_EN_BIT

#define DAC_2P5MV_EN_BIT   BIT(13)

◆ IOUT_MASK

#define IOUT_MASK   GENMASK(10, 0)

◆ IOUT_SCALE_MASK

#define IOUT_SCALE_MASK   GENMASK(2, 0)

◆ MFR_SVI3_IOUT_RPT

#define MFR_SVI3_IOUT_RPT   0x65

◆ MFR_VID_RES_MASK

#define MFR_VID_RES_MASK   GENMASK(15, 14)

◆ MFR_VOUT_LOOP_CTRL

#define MFR_VOUT_LOOP_CTRL   0xBD

◆ VR_MPS_PAGE_1

#define VR_MPS_PAGE_1   0x01

◆ VR_REG_EXPECTED_USER_CRC

#define VR_REG_EXPECTED_USER_CRC   0xF0

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 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( mp2891  )

◆ mp2891_get_fw_version()

bool mp2891_get_fw_version ( uint8_t  bus,
uint8_t  addr,
uint32_t *  rev 
)

◆ mp2891_get_resolution()

float mp2891_get_resolution ( sensor_cfg cfg)
Here is the call graph for this function:

◆ mp2891_init()

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

◆ mp2891_read()

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