currentsens2 2.1.0.0
|
API for configuring and manipulating Current Sens 2 Click driver. More...
Topics | |
Current Sens 2 Registers Settings | |
Settings for registers of Current Sens 2 Click driver. | |
Current Sens 2 MikroBUS Map | |
MikroBUS pin mapping of Current Sens 2 Click driver. | |
Functions | |
void | currentsens2_cfg_setup (currentsens2_cfg_t *cfg) |
Current Sens 2 configuration object setup function. | |
err_t | currentsens2_init (currentsens2_t *ctx, currentsens2_cfg_t *cfg) |
Current Sens 2 initialization function. | |
err_t | currentsens2_read_an_pin_value (currentsens2_t *ctx, uint16_t *data_out) |
Current Sens 2 read AN pin value function. | |
err_t | currentsens2_read_an_pin_vol (currentsens2_t *ctx, float *data_out) |
Current Sens 2 read AN pin voltage level function. | |
uint8_t | currentsens2_get_int_pin (currentsens2_t *ctx) |
Current Sens 2 get int pin state function. | |
void | currentsens2_set_prim_turn_no (currentsens2_t *ctx, uint8_t turns) |
Current Sens 2 set number of primary coil turns function. | |
err_t | currentsens2_tare (currentsens2_t *ctx) |
Current Sens 2 tare function. | |
err_t | currentsens2_get_current (currentsens2_t *ctx, float *current) |
Current Sens 2 read current function. | |
API for configuring and manipulating Current Sens 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void currentsens2_cfg_setup | ( | currentsens2_cfg_t * | cfg | ) |
Current Sens 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See currentsens2_cfg_t object definition for detailed explanation. |
err_t currentsens2_get_current | ( | currentsens2_t * | ctx, |
float * | current ) |
Current Sens 2 read current function.
This function reads the input current level [A] based of voltage measurements.
[in] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
[out] | current | : Input current level [A]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t currentsens2_get_int_pin | ( | currentsens2_t * | ctx | ) |
Current Sens 2 get int pin state function.
This function is used to read int pin state.
[in] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
0
- Pin state low, -1
- Pin state high. err_t currentsens2_init | ( | currentsens2_t * | ctx, |
currentsens2_cfg_t * | cfg ) |
Current Sens 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See currentsens2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t currentsens2_read_an_pin_value | ( | currentsens2_t * | ctx, |
uint16_t * | data_out ) |
Current Sens 2 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t currentsens2_read_an_pin_vol | ( | currentsens2_t * | ctx, |
float * | data_out ) |
Current Sens 2 read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void currentsens2_set_prim_turn_no | ( | currentsens2_t * | ctx, |
uint8_t | turns ) |
Current Sens 2 set number of primary coil turns function.
This function is used to set number of primary coil turns function.
[in] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
[in] | turns | : Number of primary coil turns. |
err_t currentsens2_tare | ( | currentsens2_t * | ctx | ) |
Current Sens 2 tare function.
This function is used to set zero ampere reference.
[in] | ctx | : Click context object. See currentsens2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.