vcpmonitor 2.0.0.0

Functions

void vcpmonitor_cfg_setup (vcpmonitor_cfg_t *cfg)
 Config Object Initialization function.
 
VCPMONITOR_RETVAL vcpmonitor_init (vcpmonitor_t *ctx, vcpmonitor_cfg_t *cfg)
 Initialization function.
 
void vcpmonitor_default_cfg (vcpmonitor_t *ctx)
 Click Default Configuration function.
 
void vcpmonitor_generic_write (vcpmonitor_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void vcpmonitor_generic_read (vcpmonitor_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void vcpmonitor_write_data (vcpmonitor_t *ctx, uint8_t reg, uint16_t tx_data)
 Writes data to register.
 
int16_t vcpmonitor_read_data (vcpmonitor_t *ctx, uint8_t reg_addr)
 Reads data from register.
 
uint8_t vcpmonitor_get_interrupt_state (vcpmonitor_t *ctx)
 Gets Interrupt pin state.
 
float vcpmonitor_get_current (vcpmonitor_t *ctx)
 Reads current data in mA.
 
float vcpmonitor_get_voltage (vcpmonitor_t *ctx)
 Reads voltage data in mV.
 
float vcpmonitor_get_power (vcpmonitor_t *ctx)
 Reads power data in mW.
 
uint8_t vcpmonitor_get_id_value (vcpmonitor_t *ctx, uint16_t *manufacture_id, uint16_t *did_id)
 Gets Manufacture ID and Device ID.
 

Detailed Description

Function Documentation

◆ vcpmonitor_cfg_setup()

void vcpmonitor_cfg_setup ( vcpmonitor_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.

◆ vcpmonitor_default_cfg()

void vcpmonitor_default_cfg ( vcpmonitor_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for VCPmonitor click.

◆ vcpmonitor_generic_read()

void vcpmonitor_generic_read ( vcpmonitor_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.

◆ vcpmonitor_generic_write()

void vcpmonitor_generic_write ( vcpmonitor_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.

◆ vcpmonitor_get_current()

float vcpmonitor_get_current ( vcpmonitor_t * ctx)

Reads current data in mA.

Parameters
ctxClick object.
Returns
Current data in mA

@description This function reads current data in mA.

◆ vcpmonitor_get_id_value()

uint8_t vcpmonitor_get_id_value ( vcpmonitor_t * ctx,
uint16_t * manufacture_id,
uint16_t * did_id )

Gets Manufacture ID and Device ID.

Parameters
ctxClick object.
manufacture_idManufacture ID data
did_idDevice ID data
Returns
Communication errors

@description This function gets Manufacture ID and Device ID

◆ vcpmonitor_get_interrupt_state()

uint8_t vcpmonitor_get_interrupt_state ( vcpmonitor_t * ctx)

Gets Interrupt pin state.

Parameters
ctxClick object.
Returns
Interrupt pin state

@description This function gets Interrupt pin state.

◆ vcpmonitor_get_power()

float vcpmonitor_get_power ( vcpmonitor_t * ctx)

Reads power data in mW.

Parameters
ctxClick object.
Returns
Power data in mW

@description This function reads power data in mW.

◆ vcpmonitor_get_voltage()

float vcpmonitor_get_voltage ( vcpmonitor_t * ctx)

Reads voltage data in mV.

Parameters
ctxClick object.
Returns
Voltage data in mV

@description This function reads voltage data in mV.

◆ vcpmonitor_init()

VCPMONITOR_RETVAL vcpmonitor_init ( vcpmonitor_t * ctx,
vcpmonitor_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ vcpmonitor_read_data()

int16_t vcpmonitor_read_data ( vcpmonitor_t * ctx,
uint8_t reg_addr )

Reads data from register.

Parameters
ctxClick object.
regRegister address
Returns
16-bit data read from the register

@description This function reads data from register.

◆ vcpmonitor_write_data()

void vcpmonitor_write_data ( vcpmonitor_t * ctx,
uint8_t reg,
uint16_t tx_data )

Writes data to register.

Parameters
ctxClick object.
regRegister address
tx_dataData to be write in the register

@description This function writes data to register.