OpenBIC
OpenSource Bridge-IC
mpc12109.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 mpc12109.c:

Macros

#define MP2891_READ_TEMPERATURE_1_RESOLUTION   1
 
#define MP2891_READ_VIN_RESOLUTION   0.125
 
#define MP2891_READ_VOUT_RESOLUTION   0.0625
 
#define MP2891_READ_IOUT_RESOLUTION   0.25
 
#define MP2891_READ_POUT_RESOLUTION   1
 
#define MP2891_READ_TEMPERATURE_1_MASK   GENMASK(7, 0)
 
#define MP2891_READ_VIN_MASK   GENMASK(9, 0)
 
#define MP2891_READ_VOUT_MASK   GENMASK(8, 0)
 
#define MP2891_READ_IOUT_MASK   GENMASK(9, 0)
 
#define MP2891_READ_POUT_MASK   GENMASK(10, 0)
 

Functions

 LOG_MODULE_REGISTER (mpc12109)
 
bool mpc12109_i2c_read (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len)
 
bool mpc12109_get_vr_status (sensor_cfg *cfg, uint8_t rail, uint8_t vr_status_rail, uint16_t *vr_status)
 
bool mpc12109_clear_vr_status (sensor_cfg *cfg, uint8_t rail)
 
uint8_t mpc12109_read (sensor_cfg *cfg, int *reading)
 
uint8_t mpc12109_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ MP2891_READ_IOUT_MASK

#define MP2891_READ_IOUT_MASK   GENMASK(9, 0)

◆ MP2891_READ_IOUT_RESOLUTION

#define MP2891_READ_IOUT_RESOLUTION   0.25

◆ MP2891_READ_POUT_MASK

#define MP2891_READ_POUT_MASK   GENMASK(10, 0)

◆ MP2891_READ_POUT_RESOLUTION

#define MP2891_READ_POUT_RESOLUTION   1

◆ MP2891_READ_TEMPERATURE_1_MASK

#define MP2891_READ_TEMPERATURE_1_MASK   GENMASK(7, 0)

◆ MP2891_READ_TEMPERATURE_1_RESOLUTION

#define MP2891_READ_TEMPERATURE_1_RESOLUTION   1

◆ MP2891_READ_VIN_MASK

#define MP2891_READ_VIN_MASK   GENMASK(9, 0)

◆ MP2891_READ_VIN_RESOLUTION

#define MP2891_READ_VIN_RESOLUTION   0.125

◆ MP2891_READ_VOUT_MASK

#define MP2891_READ_VOUT_MASK   GENMASK(8, 0)

◆ MP2891_READ_VOUT_RESOLUTION

#define MP2891_READ_VOUT_RESOLUTION   0.0625

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( mpc12109  )

◆ mpc12109_clear_vr_status()

bool mpc12109_clear_vr_status ( sensor_cfg cfg,
uint8_t  rail 
)
Here is the call graph for this function:

◆ mpc12109_get_vr_status()

bool mpc12109_get_vr_status ( sensor_cfg cfg,
uint8_t  rail,
uint8_t  vr_status_rail,
uint16_t *  vr_status 
)
Here is the call graph for this function:

◆ mpc12109_i2c_read()

bool mpc12109_i2c_read ( uint8_t  bus,
uint8_t  addr,
uint8_t  reg,
uint8_t *  data,
uint8_t  len 
)
Here is the call graph for this function:

◆ mpc12109_init()

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

◆ mpc12109_read()

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