Current Limit 5 click
PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU
[click Product page](CLICK_PRODUCT_PAGE_LINK)
Click library
- Author : Stefan Filipovic
- Date : Jan 2022.
- Type : I2C type
Software Support
We provide a library for the Current Limit 5 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Current Limit 5 Click driver.
Standard key functions :
currentlimit5_cfg_setup
Config Object Initialization function.
void currentlimit5_cfg_setup(currentlimit5_cfg_t *cfg)
Current Limit 5 configuration object setup function.
Current Limit 5 Click configuration object.
Definition: currentlimit5.h:121
currentlimit5_init
Initialization function.
err_t currentlimit5_init(currentlimit5_t *ctx, currentlimit5_cfg_t *cfg)
Current Limit 5 initialization function.
Current Limit 5 Click context object.
Definition: currentlimit5.h:101
Example key functions :
currentlimit5_set_ilimit
This function sets the current limit value by configuring the onboard digital potentiometer.
currentlimit5_ilimit_t
Current Limit 5 Click Ilimit values.
Definition: currentlimit5.h:149
err_t currentlimit5_set_ilimit(currentlimit5_t *ctx, currentlimit5_ilimit_t ilimit)
Current Limit 5 set ilimit function.
currentlimit5_get_fault_pin
This function returns the fault pin logic state.
uint8_t currentlimit5_get_fault_pin(currentlimit5_t *ctx)
Current Limit 5 get fault pin function.
currentlimit5_enable_limit
This function enables the current limiting switch.
void currentlimit5_enable_limit(currentlimit5_t *ctx)
Current Limit 5 enable limit function.
Example Description
This example demonstrates the use of Current Limit 5 click board by limiting
the current to a certain value and displaying an appropriate message when the current reaches the limit.
The demo application is composed of two sections :
Application Init
Initializes the driver and performs the click default configuration which sets the current limit to 200mA.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
@ CURRENTLIMIT5_ERROR
Definition: currentlimit5.h:140
#define CURRENTLIMIT5_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: currentlimit5.h:87
err_t currentlimit5_default_cfg(currentlimit5_t *ctx)
Current Limit 5 default configuration function.
void application_init(void)
Definition: main.c:30
Application Task
Displays the fault indicator state on the USB UART.
{
static uint8_t currentlimit_ind = 2;
{
if ( currentlimit_ind != 0 )
{
log_printf ( &logger, " The switch is in normal operation \r\n\n" );
currentlimit_ind = 0;
}
}
else
{
if ( currentlimit_ind != 1 )
{
log_printf ( &logger, " The switch is in the current limiting or thermal shutdown operation \r\n\n" );
currentlimit_ind = 1;
}
}
}
void application_task(void)
Definition: main.c:66
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.CurrentLimit5
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.