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

Macros

#define I2C_DATA_SIZE   5
 
#define MP5990_OCW_SC_REF_OFFSET   0xC5
 
#define MP5990_EIN_ROLLOVER_CNT_MAX   0x100
 
#define MP5990_EIN_SAMPLE_CNT_MAX   0x1000000
 
#define MP5990_EIN_ENERGY_CNT_MAX   0x8000
 

Functions

 LOG_MODULE_REGISTER (mp5990)
 
int mp5990_read_ein (double *val, sensor_cfg *cfg)
 
uint8_t mp5990_read (sensor_cfg *cfg, int *reading)
 
uint8_t mp5990_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ I2C_DATA_SIZE

#define I2C_DATA_SIZE   5

◆ MP5990_EIN_ENERGY_CNT_MAX

#define MP5990_EIN_ENERGY_CNT_MAX   0x8000

◆ MP5990_EIN_ROLLOVER_CNT_MAX

#define MP5990_EIN_ROLLOVER_CNT_MAX   0x100

◆ MP5990_EIN_SAMPLE_CNT_MAX

#define MP5990_EIN_SAMPLE_CNT_MAX   0x1000000

◆ MP5990_OCW_SC_REF_OFFSET

#define MP5990_OCW_SC_REF_OFFSET   0xC5

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( mp5990  )

◆ mp5990_init()

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

◆ mp5990_read()

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

◆ mp5990_read_ein()

int mp5990_read_ein ( double *  val,
sensor_cfg cfg 
)
Here is the call graph for this function: