currentlimit 2.0.0.0
|
API for configuring and manipulating Current Limit Click driver. More...
Topics | |
Current Limit Registers Settings | |
Settings for registers of Current Limit Click driver. | |
Current Limit MikroBUS Map | |
MikroBUS pin mapping of Current Limit Click driver. | |
Functions | |
void | currentlimit_cfg_setup (currentlimit_cfg_t *cfg) |
Current Limit configuration object setup function. | |
err_t | currentlimit_init (currentlimit_t *ctx, currentlimit_cfg_t *cfg) |
Current Limit initialization function. | |
err_t | currentlimit_generic_write (currentlimit_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Current Limit data writing function. | |
err_t | currentlimit_generic_read (currentlimit_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Current Limit data reading function. | |
void | currentlimit_dev_enable (currentlimit_t *ctx, uint8_t state) |
Device enable function. | |
void | currentlimit_set_limit (currentlimit_t *ctx, uint8_t lim_val) |
Set Current With Predefined Values Limit function. | |
void | currentlimit_set_limit_calc (currentlimit_t *ctx, float lim_val) |
Set Calculated Current Limit function. | |
API for configuring and manipulating Current Limit Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void currentlimit_cfg_setup | ( | currentlimit_cfg_t * | cfg | ) |
Current Limit configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See currentlimit_cfg_t object definition for detailed explanation. |
void currentlimit_dev_enable | ( | currentlimit_t * | ctx, |
uint8_t | state ) |
Device enable function.
Function is used to enable or disable the device.
[out] | ctx | : Click context object. See currentlimit_t object definition for detailed explanation. |
[in] | state | value that defines state of the device |
err_t currentlimit_generic_read | ( | currentlimit_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Current Limit data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See currentlimit_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t currentlimit_generic_write | ( | currentlimit_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Current Limit data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See currentlimit_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t currentlimit_init | ( | currentlimit_t * | ctx, |
currentlimit_cfg_t * | cfg ) |
Current Limit initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See currentlimit_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See currentlimit_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void currentlimit_set_limit | ( | currentlimit_t * | ctx, |
uint8_t | lim_val ) |
Set Current With Predefined Values Limit function.
Function is used to set the current limit with predefined values.
[in] | ctx | : Click context object. See currentlimit_t object definition for detailed explanation. |
[in] | lim_val | 8-bit value that defines current limit |
void currentlimit_set_limit_calc | ( | currentlimit_t * | ctx, |
float | lim_val ) |
Set Calculated Current Limit function.
Function is used to set the current limit with calculacion.
[in] | ctx | : Click context object. See currentlimit_t object definition for detailed explanation. |
[in] | lim_val | float value that defines current limit |