|
vcpmonitor6 2.2.0
|
API for configuring and manipulating VCP Monitor 6 Click driver. More...
Topics | |
| VCP Monitor 6 Registers List | |
| List of registers of VCP Monitor 6 Click driver. | |
| VCP Monitor 6 Registers Settings | |
| Settings for registers of VCP Monitor 6 Click driver. | |
| VCP Monitor 6 MikroBUS Map | |
| MikroBUS pin mapping of VCP Monitor 6 Click driver. | |
Functions | |
| void | vcpmonitor6_cfg_setup (vcpmonitor6_cfg_t *cfg) |
| VCP Monitor 6 configuration object setup function. | |
| err_t | vcpmonitor6_init (vcpmonitor6_t *ctx, vcpmonitor6_cfg_t *cfg) |
| VCP Monitor 6 initialization function. | |
| err_t | vcpmonitor6_default_cfg (vcpmonitor6_t *ctx) |
| VCP Monitor 6 default configuration function. | |
| err_t | vcpmonitor6_generic_write (vcpmonitor6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| VCP Monitor 6 I2C writing function. | |
| err_t | vcpmonitor6_generic_read (vcpmonitor6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| VCP Monitor 6 I2C reading function. | |
| err_t | vcpmonitor6_reg_write (vcpmonitor6_t *ctx, uint8_t reg, uint16_t data_in) |
| VCP Monitor 6 register writing function. | |
| err_t | vcpmonitor6_reg_read (vcpmonitor6_t *ctx, uint8_t reg, uint16_t *data_out) |
| VCP Monitor 6 register reading function. | |
| err_t | vcpmonitor6_sw_reset (vcpmonitor6_t *ctx) |
| VCP Monitor 6 SW reset writing function. | |
| err_t | vcpmonitor6_set_conv_dly (vcpmonitor6_t *ctx, uint16_t dly_ms) |
| VCP Monitor 6 set conversion delay function. | |
| err_t | vcpmonitor6_set_op_mode (vcpmonitor6_t *ctx, uint8_t op_mode) |
| VCP Monitor 6 set the operating mode function. | |
| err_t | vcpmonitor6_set_conv_time (vcpmonitor6_t *ctx, uint8_t vbusct, uint8_t vsenct, uint8_t tct) |
| VCP Monitor 6 set the conversion time function. | |
| err_t | vcpmonitor6_set_adc_avg (vcpmonitor6_t *ctx, uint8_t avg) |
| VCP Monitor 6 set the ADC sample function. | |
| err_t | vcpmonitor6_get_bus_voltage (vcpmonitor6_t *ctx, float *voltage) |
| VCP Monitor 6 get the voltage function. | |
| err_t | vcpmonitor6_get_temperature (vcpmonitor6_t *ctx, float *temperature) |
| VCP Monitor 6 get the temperature function. | |
| err_t | vcpmonitor6_get_current (vcpmonitor6_t *ctx, float *current) |
| VCP Monitor 6 get the current function. | |
| err_t | vcpmonitor6_get_power (vcpmonitor6_t *ctx, float *power) |
| VCP Monitor 6 get the power function. | |
| err_t | vcpmonitor6_get_energy (vcpmonitor6_t *ctx, float *energy) |
| VCP Monitor 6 get the energy function. | |
| err_t | vcpmonitor6_get_charge (vcpmonitor6_t *ctx, float *charge) |
| VCP Monitor 6 get the charge function. | |
| err_t | vcpmonitor6_set_diag_flg_alr (vcpmonitor6_t *ctx, uint16_t diag_flg_alr) |
| VCP Monitor 6 set diagnostic function. | |
| err_t | vcpmonitor6_get_indc_flg (vcpmonitor6_t *ctx, uint16_t *indc_flg) |
| VCP Monitor 6 get diagnostic indicates function. | |
| err_t | vcpmonitor6_wait_conv_cmpl (vcpmonitor6_t *ctx) |
| VCP Monitor 6 wait conversion function. | |
| err_t | vcpmonitor6_get_device_id (vcpmonitor6_t *ctx, uint16_t *man_id) |
| VCP Monitor 6 get device ID function. | |
| uint8_t | vcpmonitor6_get_alarm (vcpmonitor6_t *ctx) |
| VCP Monitor 6 get alarm function. | |
API for configuring and manipulating VCP Monitor 6 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void vcpmonitor6_cfg_setup | ( | vcpmonitor6_cfg_t * | cfg | ) |
VCP Monitor 6 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See vcpmonitor6_cfg_t object definition for detailed explanation. |
| err_t vcpmonitor6_default_cfg | ( | vcpmonitor6_t * | ctx | ) |
VCP Monitor 6 default configuration function.
This function executes a default configuration of VCP Monitor 6 Click board.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_generic_read | ( | vcpmonitor6_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
VCP Monitor 6 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_generic_write | ( | vcpmonitor6_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
VCP Monitor 6 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_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. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | uint8_t vcpmonitor6_get_alarm | ( | vcpmonitor6_t * | ctx | ) |
VCP Monitor 6 get alarm function.
This function get states of the ALR [INT] pin.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
0 - Low pin state, 1 - High pin state. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_bus_voltage | ( | vcpmonitor6_t * | ctx, |
| float * | voltage ) |
VCP Monitor 6 get the voltage function.
This function reads the BUS voltage output measurement in volts [V] by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | voltage | : BUS voltage [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_charge | ( | vcpmonitor6_t * | ctx, |
| float * | charge ) |
VCP Monitor 6 get the charge function.
This function reads the charge measurement result in Coulombs [C] by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | charge | : Energy [C]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_current | ( | vcpmonitor6_t * | ctx, |
| float * | current ) |
VCP Monitor 6 get the current function.
This function reads the current measurement result in milliamperes [mA] by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | current | : Current [mA]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_device_id | ( | vcpmonitor6_t * | ctx, |
| uint16_t * | man_id ) |
VCP Monitor 6 get device ID function.
This function reads the Manufacturer ID register by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | man_id | : Manufacturer ID [0x5449]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_energy | ( | vcpmonitor6_t * | ctx, |
| float * | energy ) |
VCP Monitor 6 get the energy function.
This function reads the energy measurement result in kilojoules [kJ] by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | energy | : Energy [kJ]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_indc_flg | ( | vcpmonitor6_t * | ctx, |
| uint16_t * | indc_flg ) |
VCP Monitor 6 get diagnostic indicates function.
This function indicates health flags of the measurements by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | indc_flg | : Health flags indicator. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_power | ( | vcpmonitor6_t * | ctx, |
| float * | power ) |
VCP Monitor 6 get the power function.
This function reads the power measurement result in watts [W] by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | power | : Power [W]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_get_temperature | ( | vcpmonitor6_t * | ctx, |
| float * | temperature ) |
VCP Monitor 6 get the temperature function.
This function reads the internal die temperature measurement in degree Celsius [degC] by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [out] | temperature | : Internal die temperature measurement [degC]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_init | ( | vcpmonitor6_t * | ctx, |
| vcpmonitor6_cfg_t * | cfg ) |
VCP Monitor 6 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See vcpmonitor6_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_reg_read | ( | vcpmonitor6_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t * | data_out ) |
VCP Monitor 6 register reading function.
This function reads a 16-bit data from the selected register by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Output read data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_reg_write | ( | vcpmonitor6_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t | data_in ) |
VCP Monitor 6 register writing function.
This function writes a 16-bit data to the selected register by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_set_adc_avg | ( | vcpmonitor6_t * | ctx, |
| uint8_t | avg ) |
VCP Monitor 6 set the ADC sample function.
This function sets the desired ADC sample averaging count to all active inputs by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | avg | : ADC sample averaging count [0x00-0x07]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_set_conv_dly | ( | vcpmonitor6_t * | ctx, |
| uint16_t | dly_ms ) |
VCP Monitor 6 set conversion delay function.
This function sets the delay for initial ADC conversion in steps of 2 ms by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | dly_ms | : Conversion delay [0-510ms]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_set_conv_time | ( | vcpmonitor6_t * | ctx, |
| uint8_t | vbusct, | ||
| uint8_t | vsenct, | ||
| uint8_t | tct ) |
VCP Monitor 6 set the conversion time function.
This function sets the desired conversion times of the bus voltage, shunt resistor voltage and temperature measurement by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | vbusct | : Conversion time of the bus voltage measurement [0x00-0x07]. |
| [in] | vsenct | : Conversion time of the shunt resistor voltage [0x00-0x07]. |
| [in] | tct | : Conversion time of the temperature measurement [0x00-0x07]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_set_diag_flg_alr | ( | vcpmonitor6_t * | ctx, |
| uint16_t | diag_flg_alr ) |
VCP Monitor 6 set diagnostic function.
This function sets the diagnostic flags and alert by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | diag_flg_alr | : Diagnostic flags and alert bitmask. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_set_op_mode | ( | vcpmonitor6_t * | ctx, |
| uint8_t | op_mode ) |
VCP Monitor 6 set the operating mode function.
This function sets the desired operating mode for continuous or triggered mode on bus voltage, current or temperature measurement by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
| [in] | op_mode | : Operating mode [0x00-0x0F]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_sw_reset | ( | vcpmonitor6_t * | ctx | ) |
VCP Monitor 6 SW reset writing function.
This function resets all registers to default values by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vcpmonitor6_wait_conv_cmpl | ( | vcpmonitor6_t * | ctx | ) |
VCP Monitor 6 wait conversion function.
This function waits until the conversion is completed by using the I2C serial interface.
| [in] | ctx | : Click context object. See vcpmonitor6_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.