currentlimit 2.0.0.0
Current Limit Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ currentlimit_cfg_setup()

void currentlimit_cfg_setup ( currentlimit_cfg_t * cfg)

Current Limit configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See currentlimit_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ currentlimit_dev_enable()

void currentlimit_dev_enable ( currentlimit_t * ctx,
uint8_t state )

Device enable function.

Function is used to enable or disable the device.

Parameters
[out]ctx: Click context object. See currentlimit_t object definition for detailed explanation.
[in]statevalue that defines state of the device
Returns
Nothing.

◆ currentlimit_generic_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ currentlimit_generic_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ currentlimit_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ currentlimit_set_limit()

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.

Parameters
[in]ctx: Click context object. See currentlimit_t object definition for detailed explanation.
[in]lim_val8-bit value that defines current limit
Returns
Nothing.
Note
Input value should not exceed 0.867.
For best performance, set the current limit (ILIMIT) between 0.2 IMAX <= ILIMIT <= IMAX.

◆ currentlimit_set_limit_calc()

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.

Parameters
[in]ctx: Click context object. See currentlimit_t object definition for detailed explanation.
[in]lim_valfloat value that defines current limit
Returns
Nothing.
Note
Input value should not exceed 0.867.
For best performance, set the current limit (ILIMIT) between 0.2 IMAX <= ILIMIT <= IMAX.