efuse7 2.2.0
Loading...
Searching...
No Matches
efuse7


eFuse 7 Click

eFuse 7 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Ilic
  • Date : May 2023.
  • Type : GPIO type

Software Support

Example Description

This library contains API for the eFuse 7 Click driver. This driver provides the functions to set the current limiting conditions in order to provide the threshold of the fault conditions.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.eFuse7

Example Key Functions

Application Init

Initialization of Click module and UART log, then performing default configuration and setting a current limit to 1A.

void application_init ( void )
{
log_cfg_t log_cfg;
efuse7_cfg_t efuse7_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
efuse7_cfg_setup( &efuse7_cfg );
EFUSE7_MAP_MIKROBUS( efuse7_cfg, MIKROBUS_1 );
if ( DIGITAL_OUT_UNSUPPORTED_PIN == efuse7_init( &efuse7, &efuse7_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( EFUSE7_ERROR == efuse7_default_cfg ( &efuse7 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
display_selection( );
Delay_ms ( 100 );
}
@ EFUSE7_ERROR
Definition efuse7.h:158
#define EFUSE7_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition efuse7.h:115
void application_init(void)
Definition main.c:61

Application Task

This example demonstrates the use of the eFuse 7 Click board. Reading user's input from UART Terminal and using it as an index for an array of pre-calculated values that define the current limit level. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
static char index;
if ( 1 == log_read( &logger, &index, 1 ) )
{
if ( ( index >= '0' ) && ( index <= '7' ) )
{
efuse7_set_limit ( &efuse7, limit_value_op[ index - 48 ] );
log_printf( &logger, " >>> Selected mode %c \r\n", index );
log_printf( &logger, "---------------------------\r\n" );
Delay_ms ( 100 );
}
else
{
log_printf( &logger, " Data not in range! \r\n" );
log_printf( &logger, "---------------------------\r\n" );
display_selection( );
Delay_ms ( 100 );
}
}
}
void application_task(void)
Definition main.c:99
const uint8_t limit_value_op[8]
Definition main.c:33

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.