current5 2.0.0.0
|
API for configuring and manipulating Current 5 Click driver. More...
Topics | |
Current 5 Registers Settings | |
Settings for registers of Current 5 Click driver. | |
Current 5 MikroBUS Map | |
MikroBUS pin mapping of Current 5 Click driver. | |
Functions | |
void | current5_cfg_setup (current5_cfg_t *cfg) |
Current 5 configuration object setup function. | |
err_t | current5_init (current5_t *ctx, current5_cfg_t *cfg) |
Current 5 initialization function. | |
err_t | current5_default_cfg (current5_t *ctx) |
Current 5 default configuration function. | |
err_t | current5_generic_read (current5_t *ctx, uint8_t *data_out, uint8_t len) |
Current 5 data reading function. | |
uint8_t | current5_get_alert (current5_t *ctx) |
Get alert pin state. | |
void | current5_set_rst (current5_t *ctx, uint8_t state) |
Mode selection. | |
err_t | current5_get_adc (current5_t *ctx, uint16_t *adc_data) |
Read raw adc value. | |
err_t | current5_get_voltage (current5_t *ctx, float *vout) |
Get voltage. | |
err_t | current5_get_current (current5_t *ctx, float *current) |
Get current. | |
API for configuring and manipulating Current 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void current5_cfg_setup | ( | current5_cfg_t * | cfg | ) |
Current 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See current5_cfg_t object definition for detailed explanation. |
err_t current5_default_cfg | ( | current5_t * | ctx | ) |
Current 5 default configuration function.
This function executes a default configuration of Current 5 click board.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t current5_generic_read | ( | current5_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | len ) |
Current 5 data reading function.
This function reads a desired number of data bytes.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t current5_get_adc | ( | current5_t * | ctx, |
uint16_t * | adc_data ) |
Read raw adc value.
This function reads raw adc data.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
[out] | adc_data | : Output read data. |
0
- Success, -1
- Error.uint8_t current5_get_alert | ( | current5_t * | ctx | ) |
Get alert pin state.
This function reads a state of alert(int) pin.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
err_t current5_get_current | ( | current5_t * | ctx, |
float * | current ) |
Get current.
This function gets voltage data from VOUT and calculates input current from it.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
[out] | current | : Output current data in A. |
0
- Success, -1
- Error.err_t current5_get_voltage | ( | current5_t * | ctx, |
float * | vout ) |
Get voltage.
This function reads adc data on VOUT pin and converts it to voltage.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
[out] | vout | : Output voltage data in mV. |
0
- Success, -1
- Error.err_t current5_init | ( | current5_t * | ctx, |
current5_cfg_t * | cfg ) |
Current 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See current5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void current5_set_rst | ( | current5_t * | ctx, |
uint8_t | state ) |
Mode selection.
This function sets RESET pin state to set device mode.
[in] | ctx | : Click context object. See current5_t object definition for detailed explanation. |
[in] | state | :
|