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

Macros

#define SQ52205_CONFIG_REG_OFFSET   0x00
 
#define SQ52205_CALIBRATION_OFFSET   0x05
 
#define SQ52205_MASK_ENABLE_OFFSET   0x06
 
#define SQ52205_ALERT_LIMIT_OFFSET   0x07
 
#define SQ52205_ACCUM_CONFIG_OFFSET   0x0D
 
#define SQ52205_SHUNT_LSB   0.0000025
 
#define SQ52205_EIN_POWER_CNT_MAX   0x10000
 
#define SQ52205_ALERT_MASK_SHIFT_OFFSET   11
 

Functions

 LOG_MODULE_REGISTER (dev_sq52205)
 
uint8_t sq52205_read (sensor_cfg *cfg, int *reading)
 
uint8_t sq52205_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ SQ52205_ACCUM_CONFIG_OFFSET

#define SQ52205_ACCUM_CONFIG_OFFSET   0x0D

◆ SQ52205_ALERT_LIMIT_OFFSET

#define SQ52205_ALERT_LIMIT_OFFSET   0x07

◆ SQ52205_ALERT_MASK_SHIFT_OFFSET

#define SQ52205_ALERT_MASK_SHIFT_OFFSET   11

◆ SQ52205_CALIBRATION_OFFSET

#define SQ52205_CALIBRATION_OFFSET   0x05

◆ SQ52205_CONFIG_REG_OFFSET

#define SQ52205_CONFIG_REG_OFFSET   0x00

◆ SQ52205_EIN_POWER_CNT_MAX

#define SQ52205_EIN_POWER_CNT_MAX   0x10000

◆ SQ52205_MASK_ENABLE_OFFSET

#define SQ52205_MASK_ENABLE_OFFSET   0x06

◆ SQ52205_SHUNT_LSB

#define SQ52205_SHUNT_LSB   0.0000025

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_sq52205  )

◆ sq52205_init()

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

◆ sq52205_read()

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