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

Macros

#define REG_PWR_MONITOR_CFG   0xD4
 
#define ADM1272_EIN_ROLLOVER_CNT_MAX   0x100
 
#define ADM1272_EIN_SAMPLE_CNT_MAX   0x1000000
 
#define ADM1272_EIN_ENERGY_CNT_MAX   0x8000
 
#define OPERATION_REGISTER   0x01;
 

Functions

 LOG_MODULE_REGISTER (dev_adm1272)
 
bool enable_adm1272_hsc (uint8_t bus, uint8_t addr, bool enable_flag)
 
uint8_t adm1272_read (sensor_cfg *cfg, int *reading)
 
uint8_t adm1272_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ ADM1272_EIN_ENERGY_CNT_MAX

#define ADM1272_EIN_ENERGY_CNT_MAX   0x8000

◆ ADM1272_EIN_ROLLOVER_CNT_MAX

#define ADM1272_EIN_ROLLOVER_CNT_MAX   0x100

◆ ADM1272_EIN_SAMPLE_CNT_MAX

#define ADM1272_EIN_SAMPLE_CNT_MAX   0x1000000

◆ OPERATION_REGISTER

#define OPERATION_REGISTER   0x01;

◆ REG_PWR_MONITOR_CFG

#define REG_PWR_MONITOR_CFG   0xD4

Function Documentation

◆ adm1272_init()

uint8_t adm1272_init ( sensor_cfg cfg)

◆ adm1272_read()

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

◆ enable_adm1272_hsc()

bool enable_adm1272_hsc ( uint8_t  bus,
uint8_t  addr,
bool  enable_flag 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_adm1272  )