vcpmonitor3 2.0.0.0
VCP Monitor 3 Click Driver

API for configuring and manipulating VCP Monitor 3 Click driver. More...

Topics

 VCP Monitor 3 Registers List
 List of registers of VCP Monitor 3 Click driver.
 
 VCP Monitor 3 Registers Settings
 Settings for registers of VCP Monitor 3 Click driver.
 
 VCP Monitor 3 MikroBUS Map
 MikroBUS pin mapping of VCP Monitor 3 Click driver.
 

Functions

void vcpmonitor3_cfg_setup (vcpmonitor3_cfg_t *cfg)
 VCP Monitor 3 configuration object setup function.
 
void vcpmonitor3_drv_interface_selection (vcpmonitor3_cfg_t *cfg, vcpmonitor3_drv_t drv_sel)
 VCP Monitor 3 driver interface setup function.
 
err_t vcpmonitor3_init (vcpmonitor3_t *ctx, vcpmonitor3_cfg_t *cfg)
 VCP Monitor 3 initialization function.
 
err_t vcpmonitor3_default_cfg (vcpmonitor3_t *ctx)
 VCP Monitor 3 default configuration function.
 
err_t vcpmonitor3_generic_write (vcpmonitor3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 VCP Monitor 3 data writing function.
 
err_t vcpmonitor3_generic_read (vcpmonitor3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 VCP Monitor 3 data reading function.
 
void vcpmonitor3_wr_page_0 (vcpmonitor3_t *ctx, uint8_t reg, uint8_t *wr_data, uint8_t n_bytes)
 Write Data To Page 0 function.
 
void vcpmonitor3_rd_page_0 (vcpmonitor3_t *ctx, uint8_t reg, uint8_t *rd_data, uint8_t n_bytes)
 Read Data From Page 0 function.
 
void vcpmonitor3_wr_page_1 (vcpmonitor3_t *ctx, uint8_t reg, uint8_t *wr_data, uint8_t n_bytes)
 Write Data To Page 1 function.
 
void vcpmonitor3_rd_page_1 (vcpmonitor3_t *ctx, uint8_t reg, uint8_t *rd_data, uint8_t n_bytes)
 Read Data From Page 1 function.
 
void vcpmonitor3_set_op_mode (vcpmonitor3_t *ctx, uint8_t op_mode)
 Set Operation Mode function.
 
float vcpmonitor3_read_i (vcpmonitor3_t *ctx)
 Read Current in Amps function.
 
float vcpmonitor3_read_p (vcpmonitor3_t *ctx)
 Read Power in Watts function.
 
float vcpmonitor3_read_v (vcpmonitor3_t *ctx)
 Read Voltage in Volts function.
 
float vcpmonitor3_read_temp (vcpmonitor3_t *ctx)
 Read Die Temperature in degrees Centigrade function.
 
float vcpmonitor3_read_vcc (vcpmonitor3_t *ctx)
 Read Voltage at DVCC in Volts function.
 
float vcpmonitor3_read_c (vcpmonitor3_t *ctx, uint8_t accu_set1)
 Read Charge in Coulombs function.
 
float vcpmonitor3_read_e (vcpmonitor3_t *ctx, uint8_t accu_set1)
 Read Energy in Joules function.
 
float vcpmonitor3_read_tb (vcpmonitor3_t *ctx, uint8_t accu_set1)
 Read Time in Seconds function.
 
uint8_t vcpmonitor3_get_int (vcpmonitor3_t *ctx)
 Get Interrupt state function.
 

Detailed Description

API for configuring and manipulating VCP Monitor 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ vcpmonitor3_cfg_setup()

void vcpmonitor3_cfg_setup ( vcpmonitor3_cfg_t * cfg)

VCP Monitor 3 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See vcpmonitor3_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ vcpmonitor3_default_cfg()

err_t vcpmonitor3_default_cfg ( vcpmonitor3_t * ctx)

VCP Monitor 3 default configuration function.

This function executes a default configuration of VCP Monitor 3 click board.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ vcpmonitor3_drv_interface_selection()

void vcpmonitor3_drv_interface_selection ( vcpmonitor3_cfg_t * cfg,
vcpmonitor3_drv_t drv_sel )

VCP Monitor 3 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See vcpmonitor3_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See vcpmonitor3_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ vcpmonitor3_generic_read()

err_t vcpmonitor3_generic_read ( vcpmonitor3_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

VCP Monitor 3 data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vcpmonitor3_generic_write()

err_t vcpmonitor3_generic_write ( vcpmonitor3_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

VCP Monitor 3 data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vcpmonitor3_get_int()

uint8_t vcpmonitor3_get_int ( vcpmonitor3_t * ctx)

Get Interrupt state function.

Function is used to check if an interrupt has occured.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
State of the INT pin.

◆ vcpmonitor3_init()

err_t vcpmonitor3_init ( vcpmonitor3_t * ctx,
vcpmonitor3_cfg_t * cfg )

VCP Monitor 3 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See vcpmonitor3_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vcpmonitor3_rd_page_0()

void vcpmonitor3_rd_page_0 ( vcpmonitor3_t * ctx,
uint8_t reg,
uint8_t * rd_data,
uint8_t n_bytes )

Read Data From Page 0 function.

Reads user defined number of bytes from page 0 registers defined by 8-bit register address.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[out]rd_data: 8-bit read data.
[in]n_bytes: 16-bit number of bytes.
Returns
Nothing.

◆ vcpmonitor3_rd_page_1()

void vcpmonitor3_rd_page_1 ( vcpmonitor3_t * ctx,
uint8_t reg,
uint8_t * rd_data,
uint8_t n_bytes )

Read Data From Page 1 function.

Reads user defined number of bytes from page 1 registers defined by 8-bit register address.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]reg: 8-bit register address
[out]rd_data: 8-bit read data.
[in]n_bytes: 16-bit number of bytes.
Returns
Nothing.

◆ vcpmonitor3_read_c()

float vcpmonitor3_read_c ( vcpmonitor3_t * ctx,
uint8_t accu_set1 )

Read Charge in Coulombs function.

Function is used to get charge in Coulombs.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]accu_set1: Read accumulated quantities set.
Returns
Result float value representing charge in Coulombs.

◆ vcpmonitor3_read_e()

float vcpmonitor3_read_e ( vcpmonitor3_t * ctx,
uint8_t accu_set1 )

Read Energy in Joules function.

Function is used to get energy in Joules.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]accu_set1: Read accumulated quantities set.
Returns
Result float value representing energy in Joules.

◆ vcpmonitor3_read_i()

float vcpmonitor3_read_i ( vcpmonitor3_t * ctx)

Read Current in Amps function.

Function is used to get current in Amperes.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
Result float value representing current in Amperes.

◆ vcpmonitor3_read_p()

float vcpmonitor3_read_p ( vcpmonitor3_t * ctx)

Read Power in Watts function.

Function is used to get power in Watts.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
Result float value representing power in Watts.

◆ vcpmonitor3_read_tb()

float vcpmonitor3_read_tb ( vcpmonitor3_t * ctx,
uint8_t accu_set1 )

Read Time in Seconds function.

Function is used to get time in Seconds.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]accu_set1: Read accumulated quantities set.
Returns
Result float value representing time in Seconds.

◆ vcpmonitor3_read_temp()

float vcpmonitor3_read_temp ( vcpmonitor3_t * ctx)

Read Die Temperature in degrees Centigrade function.

Function is used to get die temperature in degrees Centigrade.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
Result float value representing die temperature in degrees Centigrade

◆ vcpmonitor3_read_v()

float vcpmonitor3_read_v ( vcpmonitor3_t * ctx)

Read Voltage in Volts function.

Function is used to get voltage in Volts.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
Result float value voltage in Volts.

◆ vcpmonitor3_read_vcc()

float vcpmonitor3_read_vcc ( vcpmonitor3_t * ctx)

Read Voltage at DVCC in Volts function.

Function is used to get die voltage at DVCC in Volts.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
Returns
Result float value representing voltage at DVCC in Volts.

◆ vcpmonitor3_set_op_mode()

void vcpmonitor3_set_op_mode ( vcpmonitor3_t * ctx,
uint8_t op_mode )

Set Operation Mode function.

Function is used to select operation mode.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]op_mode: Value that defines operation mode.
Returns
Nothing.

◆ vcpmonitor3_wr_page_0()

void vcpmonitor3_wr_page_0 ( vcpmonitor3_t * ctx,
uint8_t reg,
uint8_t * wr_data,
uint8_t n_bytes )

Write Data To Page 0 function.

Writes user defined number of bytes into page 0 registers defined by 8-bit register address.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]wr_data: 8-bit write data.
[in]n_bytes: 16-bit number of bytes.
Returns
Nothing.

◆ vcpmonitor3_wr_page_1()

void vcpmonitor3_wr_page_1 ( vcpmonitor3_t * ctx,
uint8_t reg,
uint8_t * wr_data,
uint8_t n_bytes )

Write Data To Page 1 function.

Writes user defined number of bytes into page 1 registers defined by 8-bit register address.

Parameters
[in]ctx: Click context object. See vcpmonitor3_t object definition for detailed explanation.
[in]reg: 8-bit register address.
[in]wr_data: 8-bit write data.
[in]n_bytes: 16-bit number of bytes.
Returns
Nothing.