current10
2.1.0.0
|
API for configuring and manipulating Current 10 Click driver. More...
Modules | |
Current 10 Settings | |
Settings of Current 10 Click driver. | |
Current 10 MikroBUS Map | |
MikroBUS pin mapping of Current 10 Click driver. | |
Functions | |
void | current10_cfg_setup (current10_cfg_t *cfg) |
Current 10 configuration object setup function. More... | |
void | current10_drv_interface_sel (current10_cfg_t *cfg, current10_drv_t drv_sel) |
Current 10 driver interface setup function. More... | |
err_t | current10_init (current10_t *ctx, current10_cfg_t *cfg) |
Current 10 initialization function. More... | |
err_t | current10_read_raw_adc (current10_t *ctx, uint16_t *raw_adc) |
Current 10 read raw ADC value function. More... | |
err_t | current10_read_voltage (current10_t *ctx, float *voltage) |
Current 10 read voltage level function. More... | |
err_t | current10_read_voltage_avg (current10_t *ctx, uint16_t num_conv, float *voltage_avg) |
Current 10 read average voltage level function. More... | |
err_t | current10_set_vref (current10_t *ctx, float vref) |
Current 10 set vref function. More... | |
err_t | current10_calib_offset (current10_t *ctx) |
Current 10 calib offset function. More... | |
err_t | current10_calib_resolution (current10_t *ctx, float calib_current) |
Current 10 calib resolution function. More... | |
err_t | current10_read_current (current10_t *ctx, float *current) |
Current 10 read current function. More... | |
API for configuring and manipulating Current 10 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t current10_calib_offset | ( | current10_t * | ctx | ) |
Current 10 calib offset function.
This function calibrates the zero current offset value.
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current10_calib_resolution | ( | current10_t * | ctx, |
float | calib_current | ||
) |
Current 10 calib resolution function.
This function calibrates the data resolution at the known load current.
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[in] | calib_current | : The known load current used for calibrating data resolution. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void current10_cfg_setup | ( | current10_cfg_t * | cfg | ) |
Current 10 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See current10_cfg_t object definition for detailed explanation. |
void current10_drv_interface_sel | ( | current10_cfg_t * | cfg, |
current10_drv_t | drv_sel | ||
) |
Current 10 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See current10_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See current10_drv_t object definition for detailed explanation. |
err_t current10_init | ( | current10_t * | ctx, |
current10_cfg_t * | cfg | ||
) |
Current 10 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See current10_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current10_read_current | ( | current10_t * | ctx, |
float * | current | ||
) |
Current 10 read current function.
This function reads the input current level [A].
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[out] | current | : Input current level [A]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current10_read_raw_adc | ( | current10_t * | ctx, |
uint16_t * | raw_adc | ||
) |
Current 10 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[out] | raw_adc | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current10_read_voltage | ( | current10_t * | ctx, |
float * | voltage | ||
) |
Current 10 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[out] | voltage | : Output voltage level [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current10_read_voltage_avg | ( | current10_t * | ctx, |
uint16_t | num_conv, | ||
float * | voltage_avg | ||
) |
Current 10 read average voltage level function.
This function reads a desired number of ADC samples and calculates the average voltage level.
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[in] | num_conv | : Number of ADC samples. |
[out] | voltage_avg | : Average output voltage level [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current10_set_vref | ( | current10_t * | ctx, |
float | vref | ||
) |
Current 10 set vref function.
This function sets the voltage reference for Current 10 click driver.
[in] | ctx | : Click context object. See current10_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.