API for configuring and manipulating VCP Monitor 4 Click driver.
More...
|
void | vcpmonitor4_cfg_setup (vcpmonitor4_cfg_t *cfg) |
| VCP Monitor 4 configuration object setup function. More...
|
|
err_t | vcpmonitor4_init (vcpmonitor4_t *ctx, vcpmonitor4_cfg_t *cfg) |
| VCP Monitor 4 initialization function. More...
|
|
err_t | vcpmonitor4_default_cfg (vcpmonitor4_t *ctx) |
| VCP Monitor 4 default configuration function. More...
|
|
err_t | vcpmonitor4_generic_write (vcpmonitor4_t *ctx, uint8_t reg, uint16_t data_in) |
| VCP Monitor 4 data writing function. More...
|
|
err_t | vcpmonitor4_generic_read (vcpmonitor4_t *ctx, uint8_t reg, uint32_t *data_out) |
| VCP Monitor 4 data reading function. More...
|
|
uint8_t | vcpmonitor4_get_alert (vcpmonitor4_t *ctx) |
| Get alert pin state. More...
|
|
err_t | vcpmonitor4_get_temperature (vcpmonitor4_t *ctx, float *temperature) |
| Get device temperature. More...
|
|
err_t | vcpmonitor4_get_vbus (vcpmonitor4_t *ctx, float *vbus) |
| Get BUS voltage. More...
|
|
err_t | vcpmonitor4_get_vshunt (vcpmonitor4_t *ctx, float *vshunt) |
| Get Shunt voltage. More...
|
|
err_t | vcpmonitor4_get_current (vcpmonitor4_t *ctx, float *current) |
| Get Current. More...
|
|
err_t | vcpmonitor4_get_power (vcpmonitor4_t *ctx, float *power) |
| Get Shunt voltage. More...
|
|
API for configuring and manipulating VCP Monitor 4 Click driver.
◆ vcpmonitor4_cfg_setup()
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()
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
-
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
-
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
-
See #err_t definition for detailed explanation.
- Note
- None.
◆ vcpmonitor4_get_alert()
Get alert pin state.
- Parameters
-
[in] | ctx | : Click context object. See vcpmonitor4_t object definition for detailed explanation. |
- Returns
-
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
-
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
-
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
-
See #err_t definition for detailed explanation.
◆ vcpmonitor4_get_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
-
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
-
See #err_t definition for detailed explanation.
◆ vcpmonitor4_init()
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
-
See #err_t definition for detailed explanation.
- Note
- None.