vcpmonitor4 2.0.0.0
VCP Monitor 4 Click Driver

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

Topics

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

Functions

void vcpmonitor4_cfg_setup (vcpmonitor4_cfg_t *cfg)
 VCP Monitor 4 configuration object setup function.
 
err_t vcpmonitor4_init (vcpmonitor4_t *ctx, vcpmonitor4_cfg_t *cfg)
 VCP Monitor 4 initialization function.
 
err_t vcpmonitor4_default_cfg (vcpmonitor4_t *ctx)
 VCP Monitor 4 default configuration function.
 
err_t vcpmonitor4_generic_write (vcpmonitor4_t *ctx, uint8_t reg, uint16_t data_in)
 VCP Monitor 4 data writing function.
 
err_t vcpmonitor4_generic_read (vcpmonitor4_t *ctx, uint8_t reg, uint32_t *data_out)
 VCP Monitor 4 data reading function.
 
uint8_t vcpmonitor4_get_alert (vcpmonitor4_t *ctx)
 Get alert pin state.
 
err_t vcpmonitor4_get_temperature (vcpmonitor4_t *ctx, float *temperature)
 Get device temperature.
 
err_t vcpmonitor4_get_vbus (vcpmonitor4_t *ctx, float *vbus)
 Get BUS voltage.
 
err_t vcpmonitor4_get_vshunt (vcpmonitor4_t *ctx, float *vshunt)
 Get Shunt voltage.
 
err_t vcpmonitor4_get_current (vcpmonitor4_t *ctx, float *current)
 Get Current.
 
err_t vcpmonitor4_get_power (vcpmonitor4_t *ctx, float *power)
 Get Shunt voltage.
 

Detailed Description

API for configuring and manipulating VCP Monitor 4 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

◆ vcpmonitor4_cfg_setup()

void vcpmonitor4_cfg_setup ( vcpmonitor4_cfg_t * cfg)

VCP Monitor 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ vcpmonitor4_default_cfg()

err_t vcpmonitor4_default_cfg ( vcpmonitor4_t * ctx)

VCP Monitor 4 default configuration function.

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

Parameters
[in]ctx: Click context object. See vcpmonitor4_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.

◆ vcpmonitor4_generic_read()

err_t vcpmonitor4_generic_read ( vcpmonitor4_t * ctx,
uint8_t reg,
uint32_t * data_out )

VCP Monitor 4 data reading function.

This function reads a data from the selected register.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Output data will be uint16_t data exept for the VCPMONITOR4_REG_POWER.

◆ vcpmonitor4_generic_write()

err_t vcpmonitor4_generic_write ( vcpmonitor4_t * ctx,
uint8_t reg,
uint16_t data_in )

VCP Monitor 4 data writing function.

This function writes a data to the selected register.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vcpmonitor4_get_alert()

uint8_t vcpmonitor4_get_alert ( vcpmonitor4_t * ctx)

Get alert pin state.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vcpmonitor4_get_current()

err_t vcpmonitor4_get_current ( vcpmonitor4_t * ctx,
float * current )

Get Current.

This function reads a ADC data for device current and calculates real value in A.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[out]current: Output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vcpmonitor4_get_power()

err_t vcpmonitor4_get_power ( vcpmonitor4_t * ctx,
float * power )

Get Shunt voltage.

This function reads a ADC data for device power and calculates real value in W.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[out]power: Output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vcpmonitor4_get_temperature()

err_t vcpmonitor4_get_temperature ( vcpmonitor4_t * ctx,
float * temperature )

Get device temperature.

This function reads a ADC data for temperature and calculates real value in degrees C.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[out]temperature: Output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vcpmonitor4_get_vbus()

err_t vcpmonitor4_get_vbus ( vcpmonitor4_t * ctx,
float * vbus )

Get BUS voltage.

This function reads a ADC data for vbus voltage and calculates real value in V.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[out]vbus: Output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vcpmonitor4_get_vshunt()

err_t vcpmonitor4_get_vshunt ( vcpmonitor4_t * ctx,
float * vshunt )

Get Shunt voltage.

This function reads a ADC data for shunt voltage and calculates real value in mV.

Parameters
[in]ctx: Click context object. See vcpmonitor4_t object definition for detailed explanation.
[out]vshunt: Output data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vcpmonitor4_init()

err_t vcpmonitor4_init ( vcpmonitor4_t * ctx,
vcpmonitor4_cfg_t * cfg )

VCP Monitor 4 initialization function.

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

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