vcpmonitor6 2.2.0
Loading...
Searching...
No Matches
vcpmonitor6.h File Reference

This file contains API for VCP Monitor 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  vcpmonitor6_t
 VCP Monitor 6 Click context object. More...
struct  vcpmonitor6_cfg_t
 VCP Monitor 6 Click configuration object. More...

Macros

#define VCPMONITOR6_REG_CONFIG   0x00
 VCP Monitor 6 description register.
#define VCPMONITOR6_REG_ADC_CONFIG   0x01
#define VCPMONITOR6_REG_VBUS   0x05
#define VCPMONITOR6_REG_DIETEMP   0x06
#define VCPMONITOR6_REG_CURRENT   0x07
#define VCPMONITOR6_REG_POWER   0x08
#define VCPMONITOR6_REG_ENERGY   0x09
#define VCPMONITOR6_REG_CHARGE   0x0A
#define VCPMONITOR6_REG_ALERT_DIAG   0x0B
#define VCPMONITOR6_REG_COL   0x0C
#define VCPMONITOR6_REG_CUL   0x0D
#define VCPMONITOR6_REG_BOVL   0x0E
#define VCPMONITOR6_REG_BUVL   0x0F
#define VCPMONITOR6_REG_TEMP_LIMIT   0x10
#define VCPMONITOR6_REG_PWR_LIMIT   0x11
#define VCPMONITOR6_REG_MANUFACTURER_ID   0x3E
#define VCPMONITOR6_CFG_RST   0x80
 VCP Monitor 6 configuration register setting.
#define VCPMONITOR6_CFG_RSTACC   0x40
#define VCPMONITOR6_CFG_CONVDLY   0x01FEu
#define VCPMONITOR6_ADC_CFG_MODE_SHD   0x00
 VCP Monitor 6 ADC configuration register setting.
#define VCPMONITOR6_ADC_CFG_MODE_TRG_BV   0x01
#define VCPMONITOR6_ADC_CFG_MODE_TRG_T   0x04
#define VCPMONITOR6_ADC_CFG_MODE_TRG_BV_T   0x05
#define VCPMONITOR6_ADC_CFG_MODE_TRG_T_C   0x06
#define VCPMONITOR6_ADC_CFG_MODE_TRG_ALL   0x07
#define VCPMONITOR6_ADC_CFG_MODE_SD   0x08
#define VCPMONITOR6_ADC_CFG_MODE_CNT_BV   0x09
#define VCPMONITOR6_ADC_CFG_MODE_CNT_T   0x0C
#define VCPMONITOR6_ADC_CFG_MODE_CNT_BV_T   0x0D
#define VCPMONITOR6_ADC_CFG_MODE_CNT_T_C   0x0E
#define VCPMONITOR6_ADC_CFG_MODE_CNT_ALL   0x0F
#define VCPMONITOR6_ADC_CFG_MODE_BITMASK   0x0FFFu
#define VCPMONITOR6_ADC_CFG_VBSTA   0x07
#define VCPMONITOR6_ADC_CFG_VBSTA_BITMASK   0xF007u
#define VCPMONITOR6_ADC_CFG_AVG   0x07
#define VCPMONITOR6_ADC_CFG_AVG_BITMASK   0xFFF8u
#define VCPMONITOR6_ALR_DIAG_TRANSPARENT   0x0000u
 VCP Monitor 6 diagnostic flags and aler register setting.
#define VCPMONITOR6_ALR_DIAG_ALATCH   0x8000u
#define VCPMONITOR6_ALR_DIAG_CNVR_DIS   0x0000u
#define VCPMONITOR6_ALR_DIAG_CNVR_EN   0x4000u
#define VCPMONITOR6_ALR_DIAG_SLWALR_NAVG   0x0000u
#define VCPMONITOR6_ALR_DIAG_SLWALR_AVG   0x2000u
#define VCPMONITOR6_ALR_DIAG_APOL_NORMAL   0x0000u
#define VCPMONITOR6_ALR_DIAG_APOL_INV   0x1000u
#define VCPMONITOR6_ALR_DIAG_W_BITMASK   0xF000u
#define VCPMONITOR6_ALR_DIAG_ENERGYOF   0x0800u
#define VCPMONITOR6_ALR_DIAG_CHARGEOF   0x0400u
#define VCPMONITOR6_ALR_DIAG_MATHOF   0x0200u
#define VCPMONITOR6_ALR_DIAG_TMPOL   0x0080u
#define VCPMONITOR6_ALR_DIAG_CURRENTOL   0x0040u
#define VCPMONITOR6_ALR_DIAG_CURRENTUL   0x0020u
#define VCPMONITOR6_ALR_DIAG_BUSOL   0x0010u
#define VCPMONITOR6_ALR_DIAG_BUSUL   0x0008u
#define VCPMONITOR6_ALR_DIAG_POL   0x0004u
#define VCPMONITOR6_ALR_DIAG_CNVRF   0x0002u
#define VCPMONITOR6_ALR_DIAG_MEMSTAT   0x0001u
#define VCPMONITOR6_ALR_DIAG_R_BITMASK   0x0FFFu
#define VCPMONITOR6_MANUFACTURER_ID   0x5449u
 VCP Monitor 6 device manufacturer ID data value.
#define VCPMONITOR6_CONV_FACT_VBUS   3.125f
 VCP Monitor 6 measurement calculation data values.
#define VCPMONITOR6_CONV_FACT_DIETEMP   125.0f
#define VCPMONITOR6_CONV_FACT_CURRENT   2500.0f
#define VCPMONITOR6_CONV_FACT_POWER   480.0f
#define VCPMONITOR6_CONV_FACT_ENERGY   7.68f
#define VCPMONITOR6_CONV_FACT_CHARGE   150.0f
#define VCPMONITOR6_CALC_EN_CHRG_RES   256.0f
#define VCPMONITOR6_CALC_EN_CHRG   4.0f
#define VCPMONITOR6_UN_CONV_1K   1000.0f
#define VCPMONITOR6_UN_CONV_1M   1000000.0f
#define VCPMONITOR6_DEVICE_ADDRESS_0   0x40
 VCP Monitor 6 device address setting.
#define VCPMONITOR6_DEVICE_ADDRESS_1   0x41
#define VCPMONITOR6_DEVICE_ADDRESS_2   0x44
#define VCPMONITOR6_DEVICE_ADDRESS_3   0x45
#define VCPMONITOR6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  vcpmonitor6_return_value_t { VCPMONITOR6_OK = 0 , VCPMONITOR6_ERROR = -1 }
 VCP Monitor 6 Click return value data. More...

Functions

void vcpmonitor6_cfg_setup (vcpmonitor6_cfg_t *cfg)
 VCP Monitor 6 configuration object setup function.
err_t vcpmonitor6_init (vcpmonitor6_t *ctx, vcpmonitor6_cfg_t *cfg)
 VCP Monitor 6 initialization function.
err_t vcpmonitor6_default_cfg (vcpmonitor6_t *ctx)
 VCP Monitor 6 default configuration function.
err_t vcpmonitor6_generic_write (vcpmonitor6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 VCP Monitor 6 I2C writing function.
err_t vcpmonitor6_generic_read (vcpmonitor6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 VCP Monitor 6 I2C reading function.
err_t vcpmonitor6_reg_write (vcpmonitor6_t *ctx, uint8_t reg, uint16_t data_in)
 VCP Monitor 6 register writing function.
err_t vcpmonitor6_reg_read (vcpmonitor6_t *ctx, uint8_t reg, uint16_t *data_out)
 VCP Monitor 6 register reading function.
err_t vcpmonitor6_sw_reset (vcpmonitor6_t *ctx)
 VCP Monitor 6 SW reset writing function.
err_t vcpmonitor6_set_conv_dly (vcpmonitor6_t *ctx, uint16_t dly_ms)
 VCP Monitor 6 set conversion delay function.
err_t vcpmonitor6_set_op_mode (vcpmonitor6_t *ctx, uint8_t op_mode)
 VCP Monitor 6 set the operating mode function.
err_t vcpmonitor6_set_conv_time (vcpmonitor6_t *ctx, uint8_t vbusct, uint8_t vsenct, uint8_t tct)
 VCP Monitor 6 set the conversion time function.
err_t vcpmonitor6_set_adc_avg (vcpmonitor6_t *ctx, uint8_t avg)
 VCP Monitor 6 set the ADC sample function.
err_t vcpmonitor6_get_bus_voltage (vcpmonitor6_t *ctx, float *voltage)
 VCP Monitor 6 get the voltage function.
err_t vcpmonitor6_get_temperature (vcpmonitor6_t *ctx, float *temperature)
 VCP Monitor 6 get the temperature function.
err_t vcpmonitor6_get_current (vcpmonitor6_t *ctx, float *current)
 VCP Monitor 6 get the current function.
err_t vcpmonitor6_get_power (vcpmonitor6_t *ctx, float *power)
 VCP Monitor 6 get the power function.
err_t vcpmonitor6_get_energy (vcpmonitor6_t *ctx, float *energy)
 VCP Monitor 6 get the energy function.
err_t vcpmonitor6_get_charge (vcpmonitor6_t *ctx, float *charge)
 VCP Monitor 6 get the charge function.
err_t vcpmonitor6_set_diag_flg_alr (vcpmonitor6_t *ctx, uint16_t diag_flg_alr)
 VCP Monitor 6 set diagnostic function.
err_t vcpmonitor6_get_indc_flg (vcpmonitor6_t *ctx, uint16_t *indc_flg)
 VCP Monitor 6 get diagnostic indicates function.
err_t vcpmonitor6_wait_conv_cmpl (vcpmonitor6_t *ctx)
 VCP Monitor 6 wait conversion function.
err_t vcpmonitor6_get_device_id (vcpmonitor6_t *ctx, uint16_t *man_id)
 VCP Monitor 6 get device ID function.
uint8_t vcpmonitor6_get_alarm (vcpmonitor6_t *ctx)
 VCP Monitor 6 get alarm function.

Detailed Description

This file contains API for VCP Monitor 6 Click Driver.

Enumeration Type Documentation

◆ vcpmonitor6_return_value_t

VCP Monitor 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
VCPMONITOR6_OK 
VCPMONITOR6_ERROR