current14
2.1.0.0
|
API for configuring and manipulating Current 14 Click driver. More...
Modules | |
Current 14 Registers List | |
List of registers of Current 14 Click driver. | |
Current 14 Registers Settings | |
Settings for registers of Current 14 Click driver. | |
Current 14 MikroBUS Map | |
MikroBUS pin mapping of Current 14 Click driver. | |
Functions | |
void | current14_cfg_setup (current14_cfg_t *cfg) |
Current 14 configuration object setup function. More... | |
err_t | current14_init (current14_t *ctx, current14_cfg_t *cfg) |
Current 14 initialization function. More... | |
err_t | current14_default_cfg (current14_t *ctx) |
Current 14 default configuration function. More... | |
err_t | current14_write_reg_byte (current14_t *ctx, uint8_t reg, uint8_t data_in) |
Current 14 write reg byte function. More... | |
err_t | current14_write_reg_word (current14_t *ctx, uint8_t reg, uint16_t data_in) |
Current 14 write reg word function. More... | |
err_t | current14_read_reg_byte (current14_t *ctx, uint8_t reg, uint8_t *data_out) |
Current 14 read reg byte function. More... | |
uint8_t | current14_get_alert_pin (current14_t *ctx) |
Current 14 get alert pin function. More... | |
err_t | current14_set_odr (current14_t *ctx, uint8_t odr) |
Current 14 set odr function. More... | |
err_t | current14_read_data (current14_t *ctx, int16_t *data_out) |
Current 14 read data function. More... | |
err_t | current14_calib_offset (current14_t *ctx) |
Current 14 calib offset function. More... | |
err_t | current14_calib_resolution (current14_t *ctx, float calib_current) |
Current 14 calib resolution function. More... | |
err_t | current14_get_current (current14_t *ctx, float *current) |
Current 14 get current function. More... | |
API for configuring and manipulating Current 14 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 current14_calib_offset | ( | current14_t * | ctx | ) |
Current 14 calib offset function.
This function calibrates the zero current offset value.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current14_calib_resolution | ( | current14_t * | ctx, |
float | calib_current | ||
) |
Current 14 calib resolution function.
This function calibrates the data resolution at the known load current.
[in] | ctx | : Click context object. See current14_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 current14_cfg_setup | ( | current14_cfg_t * | cfg | ) |
Current 14 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See current14_cfg_t object definition for detailed explanation. |
err_t current14_default_cfg | ( | current14_t * | ctx | ) |
Current 14 default configuration function.
This function executes a default configuration of Current 14 click board.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t current14_get_alert_pin | ( | current14_t * | ctx | ) |
Current 14 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
err_t current14_get_current | ( | current14_t * | ctx, |
float * | current | ||
) |
Current 14 get current function.
This function reads the input current level [A].
[in] | ctx | : Click context object. See current14_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 current14_init | ( | current14_t * | ctx, |
current14_cfg_t * | cfg | ||
) |
Current 14 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See current14_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current14_read_data | ( | current14_t * | ctx, |
int16_t * | data_out | ||
) |
Current 14 read data function.
This function reads the sensor raw data measurement.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
[out] | data_out | : 16-bit signed RAW data output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current14_read_reg_byte | ( | current14_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Current 14 read reg byte function.
This function reads a data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current14_set_odr | ( | current14_t * | ctx, |
uint8_t | odr | ||
) |
Current 14 set odr function.
This function sets the sensor output data rate.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
[in] | odr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current14_write_reg_byte | ( | current14_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Current 14 write reg byte function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t current14_write_reg_word | ( | current14_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in | ||
) |
Current 14 write reg word function.
This function writes a data word starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See current14_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : 16-bit data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.