current9 2.1.0.0
|
API for configuring and manipulating Current 9 Click driver. More...
Topics | |
Current 9 Settings | |
Settings of Current 9 Click driver. | |
Current 9 MikroBUS Map | |
MikroBUS pin mapping of Current 9 Click driver. | |
Functions | |
void | current9_cfg_setup (current9_cfg_t *cfg) |
Current 9 configuration object setup function. | |
void | current9_drv_interface_selection (current9_cfg_t *cfg, current9_drv_t drv_sel) |
Current 9 driver interface setup function. | |
err_t | current9_init (current9_t *ctx, current9_cfg_t *cfg) |
Current 9 initialization function. | |
err_t | current9_read_raw_adc (current9_t *ctx, uint16_t *raw_adc) |
Current 9 read raw ADC value function. | |
err_t | current9_read_voltage (current9_t *ctx, float *voltage) |
Current 9 read voltage level function. | |
err_t | current9_set_vref (current9_t *ctx, float vref) |
Current 9 set vref function. | |
err_t | current9_read_current (current9_t *ctx, float *current) |
Current 9 read current function. | |
API for configuring and manipulating Current 9 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void current9_cfg_setup | ( | current9_cfg_t * | cfg | ) |
Current 9 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See current9_cfg_t object definition for detailed explanation. |
void current9_drv_interface_selection | ( | current9_cfg_t * | cfg, |
current9_drv_t | drv_sel ) |
Current 9 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 current9_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See current9_drv_t object definition for detailed explanation. |
err_t current9_init | ( | current9_t * | ctx, |
current9_cfg_t * | cfg ) |
Current 9 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See current9_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See current9_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current9_read_current | ( | current9_t * | ctx, |
float * | current ) |
Current 9 read current function.
This function reads the input current level [A] based on CURRENT9_NUM_CONVERSIONS of voltage measurements.
[in] | ctx | : Click context object. See current9_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 current9_read_raw_adc | ( | current9_t * | ctx, |
uint16_t * | raw_adc ) |
Current 9 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See current9_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 current9_read_voltage | ( | current9_t * | ctx, |
float * | voltage ) |
Current 9 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See current9_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 current9_set_vref | ( | current9_t * | ctx, |
float | vref ) |
Current 9 set vref function.
This function sets the voltage reference for Current 9 click driver.
[in] | ctx | : Click context object. See current9_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.