vctmonitor 2.0.0.0
vctmonitor.h File Reference

This file contains API for VCT Monitor 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  vctmonitor_t
 VCT Monitor Click context object. More...
 
struct  vctmonitor_cfg_t
 VCT Monitor Click configuration object. More...
 

Macros

#define VCTMONITOR_REG_STATUS   0x00
 VCT Monitor description register.
 
#define VCTMONITOR_REG_CONTROL   0x01
 
#define VCTMONITOR_REG_TRIGGER   0x02
 
#define VCTMONITOR_REG_AMB_TEMP_MSB   0x04
 
#define VCTMONITOR_REG_AMB_TEMP_LSB   0x05
 
#define VCTMONITOR_REG_V1_MSB   0x06
 
#define VCTMONITOR_REG_V1_LSB   0x07
 
#define VCTMONITOR_REG_V2_MSB   0x08
 
#define VCTMONITOR_REG_V2_LSB   0x09
 
#define VCTMONITOR_REG_V3_MSB   0x0A
 
#define VCTMONITOR_REG_V3_LSB   0x0B
 
#define VCTMONITOR_REG_V4_MSB   0x0C
 
#define VCTMONITOR_REG_V4_LSB   0x0D
 
#define VCTMONITOR_REG_VCC_MSB   0x0E
 
#define VCTMONITOR_REG_VCC_LSB   0x0F
 
#define VCTMONITOR_CTRL_TEMP_FORMAT_C   0x00
 VCT Monitor description setting.
 
#define VCTMONITOR_CTRL_TEMP_FORMAT_K   0x80
 
#define VCTMONITOR_CTRL_REPEATED_MEAS   0x00
 
#define VCTMONITOR_CTRL_SINGLE_MEAS   0x40
 
#define VCTMONITOR_CTRL_MODE1_INT_TEMP   0x00
 
#define VCTMONITOR_CTRL_MODE1_V12   0x08
 
#define VCTMONITOR_CTRL_MODE1_V34   0x10
 
#define VCTMONITOR_CTRL_MODE1_ALL   0x18
 
#define VCTMONITOR_CTRL_MODE2_V12_TR2   0x00
 
#define VCTMONITOR_CTRL_MODE2_V1_2_TR2   0x01
 
#define VCTMONITOR_CTRL_MODE2_V1_2_V34   0x02
 
#define VCTMONITOR_CTRL_MODE2_V34_TR1   0x03
 
#define VCTMONITOR_CTRL_MODE2_V3_4_TR1   0x04
 
#define VCTMONITOR_CTRL_MODE2_TR2_TR1   0x05
 
#define VCTMONITOR_CTRL_MODE2_V1_2_V3_4   0x06
 
#define VCTMONITOR_CTRL_MODE2_V1234   0x07
 
#define VCTMONITOR_STATUS_VCC_READY   0x40
 
#define VCTMONITOR_STATUS_V4_READY   0x20
 
#define VCTMONITOR_STATUS_V3_READY   0x10
 
#define VCTMONITOR_STATUS_V2_READY   0x08
 
#define VCTMONITOR_STATUS_V1_READY   0x04
 
#define VCTMONITOR_STATUS_TINT_READY   0x02
 
#define VCTMONITOR_STATUS_BUSY   0x01
 
#define VCTMONITOR_SLAVE_ADDR_GND_GND   0x4C
 VCT Monitor device address setting.
 
#define VCTMONITOR_SLAVE_ADDR_GND_VCC   0x4D
 
#define VCTMONITOR_SLAVE_ADDR_VCC_VCC   0x4F
 
#define VCTMONITOR_SLAVE_ADDR_VCC_GND   0x4E
 
#define VCTMONITOR_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  vctmonitor_return_value_t { VCTMONITOR_OK = 0 , VCTMONITOR_ERROR = -1 }
 VCT Monitor Click return value data. More...
 

Functions

void vctmonitor_cfg_setup (vctmonitor_cfg_t *cfg)
 VCT Monitor configuration object setup function.
 
err_t vctmonitor_init (vctmonitor_t *ctx, vctmonitor_cfg_t *cfg)
 VCT Monitor initialization function.
 
err_t vctmonitor_default_cfg (vctmonitor_t *ctx)
 VCT Monitor default configuration function.
 
err_t vctmonitor_generic_write (vctmonitor_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 VCT Monitor I2C writing function.
 
err_t vctmonitor_generic_read (vctmonitor_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 VCT Monitor I2C reading function.
 
uint8_t vctmonitor_get_status (vctmonitor_t *ctx)
 Gets status value.
 
void vctmonitor_configuration (vctmonitor_t *ctx, uint8_t cfg)
 Configuration function.
 
float vctmonitor_read_temperature (vctmonitor_t *ctx)
 Get temperature function.
 
float vctmonitor_read_voltage_differential (vctmonitor_t *ctx)
 Differential voltage function.
 
float vctmonitor_read_voltage_single (vctmonitor_t *ctx, uint8_t channel)
 Single voltage function.
 
float vctmonitor_read_current (vctmonitor_t *ctx)
 Current function.
 

Detailed Description

This file contains API for VCT Monitor Click Driver.

Enumeration Type Documentation

◆ vctmonitor_return_value_t

VCT Monitor Click return value data.

Predefined enum values for driver return values.

Enumerator
VCTMONITOR_OK 
VCTMONITOR_ERROR