vcpmonitor2 2.0.0.0

Functions

void vcpmonitor2_cfg_setup (vcpmonitor2_cfg_t *cfg)
 Config Object Initialization function.
 
VCPMONITOR2_RETVAL vcpmonitor2_init (vcpmonitor2_t *ctx, vcpmonitor2_cfg_t *cfg)
 Initialization function.
 
void vcpmonitor2_default_cfg (vcpmonitor2_t *ctx)
 Click Default Configuration function.
 
void vcpmonitor2_generic_write (vcpmonitor2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void vcpmonitor2_generic_read (vcpmonitor2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint16_t vcpmonitor2_get_manifacture_id (vcpmonitor2_t *ctx)
 Get Manufacture ID.
 
uint16_t vcpmonitor2_get_die_id (vcpmonitor2_t *ctx)
 Get DIE ID.
 
float vcpmonitor2_get_bus_voltage (vcpmonitor2_t *ctx, uint8_t channel)
 Get BUS voltage in mV.
 
float vcpmonitor2_get_shunt_voltage (vcpmonitor2_t *ctx, uint8_t channel)
 Get Shunt voltage in mV.
 
float vcpmonitor2_get_current (vcpmonitor2_t *ctx, uint8_t channel)
 Get Current data in mA.
 
float vcpmonitor2_get_power (vcpmonitor2_t *ctx, uint8_t channel)
 Get Power in W.
 
void vcpmonitor2_configuration (vcpmonitor2_t *ctx, uint16_t cfg)
 Configuration function.
 
uint8_t vcpmonitor2_get_alert_status (vcpmonitor2_t *ctx)
 Get Alert status.
 
void vcpmonitor2_reset_alert (vcpmonitor2_t *ctx)
 Alert reset.
 
void vcpmonitor2_alert_config (vcpmonitor2_t *ctx, uint8_t cfg)
 Alert configuration ( Enable / Disable )
 

Detailed Description

Function Documentation

◆ vcpmonitor2_alert_config()

void vcpmonitor2_alert_config ( vcpmonitor2_t * ctx,
uint8_t cfg )

Alert configuration ( Enable / Disable )

Parameters
ctxClick object.
cfgConfiguration data
Note
Options for enable or disable:
  - PVALID ALERT
  - WRNG ALERT
  - CRTCL ALERT
  - TCTRL ALERT

◆ vcpmonitor2_cfg_setup()

void vcpmonitor2_cfg_setup ( vcpmonitor2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ vcpmonitor2_configuration()

void vcpmonitor2_configuration ( vcpmonitor2_t * ctx,
uint16_t cfg )

Configuration function.

Parameters
ctxClick object.
cfgConfig data for set
Note
Config data options:
  -- VBUS ( 140us, 204us, 332us, 588us, 1100us 2116us, 4156us, 8244us )
  -- VSH ( 140us, 204us, 332us, 588us, 1100us 2116us, 4156us, 8244us )
  -- MODE ( POWER_DOWN, SS_SHUNT_VOLT, SS_BUS_VOLT, CONT_SHUNT_VOLT,
            CONT_BUS_VOLT, CONT_SHUNT_BUS_VOLT )

◆ vcpmonitor2_default_cfg()

void vcpmonitor2_default_cfg ( vcpmonitor2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Vcpmonitor2 click.

◆ vcpmonitor2_generic_read()

void vcpmonitor2_generic_read ( vcpmonitor2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ vcpmonitor2_generic_write()

void vcpmonitor2_generic_write ( vcpmonitor2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ vcpmonitor2_get_alert_status()

uint8_t vcpmonitor2_get_alert_status ( vcpmonitor2_t * ctx)

Get Alert status.

Parameters
ctxClick object.
Returns
Alert Status ( PVALID, WRNG, CRTCL, TCTRL )

◆ vcpmonitor2_get_bus_voltage()

float vcpmonitor2_get_bus_voltage ( vcpmonitor2_t * ctx,
uint8_t channel )

Get BUS voltage in mV.

Parameters
ctxClick object.
channelChannel ( 1 / 2 / 3 )
Returns
BUS voltage in mV

◆ vcpmonitor2_get_current()

float vcpmonitor2_get_current ( vcpmonitor2_t * ctx,
uint8_t channel )

Get Current data in mA.

Parameters
ctxClick object.
channelChannel ( 1 / 2 / 3 )
Returns
Current data in mA

◆ vcpmonitor2_get_die_id()

uint16_t vcpmonitor2_get_die_id ( vcpmonitor2_t * ctx)

Get DIE ID.

Parameters
ctxClick object.
Returns
DIE ID ( default 0x3220 )

◆ vcpmonitor2_get_manifacture_id()

uint16_t vcpmonitor2_get_manifacture_id ( vcpmonitor2_t * ctx)

Get Manufacture ID.

Parameters
ctxClick object.
Returns
Manufacture ID ( default 0x5449 )

◆ vcpmonitor2_get_power()

float vcpmonitor2_get_power ( vcpmonitor2_t * ctx,
uint8_t channel )

Get Power in W.

Parameters
ctxClick object.
channelChannel ( 1 / 2 / 3 )
Returns
Power data in W

◆ vcpmonitor2_get_shunt_voltage()

float vcpmonitor2_get_shunt_voltage ( vcpmonitor2_t * ctx,
uint8_t channel )

Get Shunt voltage in mV.

Parameters
ctxClick object.
channelChannel ( 1 / 2 / 3 )
Returns
Shunt voltage in mV

◆ vcpmonitor2_init()

VCPMONITOR2_RETVAL vcpmonitor2_init ( vcpmonitor2_t * ctx,
vcpmonitor2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ vcpmonitor2_reset_alert()

void vcpmonitor2_reset_alert ( vcpmonitor2_t * ctx)

Alert reset.

Parameters
ctxClick object.