efuse2  2.0.0.0
Main Page

eFuse 2 click

eFuse 2 Click is a compact add-on board that contains an integrated FET hot-swap device. This board features the TPS259631, a highly integrated circuit protection and power management solution from Texas Instruments. It provides multiple protection modes against overloads, short circuits, voltage surges, and excessive inrush current.

click Product page


Click library

  • Author : Stefan Ilic
  • Date : Aug 2021.
  • Type : I2C type

Software Support

We provide a library for the eFuse2 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 eFuse2 Click driver.

Standard key functions :

Example key functions :

Example Description

This is an example that demonstrate the use of the eFuse 2 click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - I2C,
AD5175: enable write, set the normal operating mode and operating current to the 1,2 A;
AD5241: set operating voltage to the 12,0 V; Display diagnostic states.

void application_init ( void ) {
log_cfg_t log_cfg;
efuse2_cfg_t efuse2_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
efuse2_cfg_setup( &efuse2_cfg );
EFUSE2_MAP_MIKROBUS( efuse2_cfg, MIKROBUS_1 );
err_t init_flag = efuse2_init( &efuse2, &efuse2_cfg );
if ( I2C_MASTER_ERROR == init_flag ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
efuse2_default_cfg ( &efuse2 );
Delay_ms( 100 );
op_current = 1.2;
op_voltage = 12.0;
log_printf( &logger, "-----------------------------\r\n" );
log_printf( &logger, " Set operating value: \r\n" );
log_printf( &logger, " Voltage: 12.0 V \r\n" );
Delay_ms( 1000 );
log_printf( &logger, " Current: 1.2 A \r\n" );
log_printf( &logger, "-----------------------------\r\n" );
Delay_ms( 1000 );
log_printf( &logger, " Turn ON Power Supply \r\n" );
log_printf( &logger, "-----------------------------\r\n" );
log_info( &logger, " Application Task " );
}

Application Task

eFuse 2 click board uses USB UART log to display operating voltage, OVLO, UVLO and current limit condition. This firmware provides the functions to set the operating voltage and current limiting conditions in order to provide the threshold of the fault conditions. When one of the fault conditions is met, the microcontroller is notified via INT pin which is checked by the app to initiate a shutdown mode. All data logs write on USB UART changes every 2000 milliseconds.

void application_task ( void ) {
if ( EFUSE2_FAULT == efuse2_get_fault( &efuse2 ) ) {
Delay_ms( 1000 );
log_printf( &logger, " Shutdown Mode \r\n" );
log_printf( &logger, "-----------------------------\r\n" );
for ( ; ; );
}
log_printf( &logger, " Oper. Voltage : %.3f V \r\n", op_voltage );
log_printf( &logger, " Undervoltage : %.3f V \r\n", min_voltage );
log_printf( &logger, " Overvoltage : %.3f V \r\n", max_voltage );
log_printf( &logger, " Current Limit : %.3f A \r\n", op_current );
log_printf( &logger, "-----------------------------\r\n" );
Delay_ms( 2000 );
}

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.eFuse2

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.


efuse2_cfg_t
eFuse 2 Click configuration object.
Definition: efuse2.h:178
efuse2_cfg_setup
void efuse2_cfg_setup(efuse2_cfg_t *cfg)
eFuse 2 configuration object setup function.
min_voltage
float min_voltage
Definition: main.c:40
EFUSE2_FAULT
#define EFUSE2_FAULT
eFuse 2 fault setting.
Definition: efuse2.h:118
op_voltage
float op_voltage
Definition: main.c:39
application_task
void application_task(void)
Definition: main.c:92
efuse2_operating_mode
void efuse2_operating_mode(efuse2_t *ctx, uint8_t mode)
Set operating mode function.
efuse2_default_cfg
err_t efuse2_default_cfg(efuse2_t *ctx)
eFuse 2 default configuration function.
max_voltage
float max_voltage
Definition: main.c:41
efuse2_set_operating_voltage
void efuse2_set_operating_voltage(efuse2_t *ctx, float voltage, float *min_voltage, float *max_voltage)
Set operating voltage function.
efuse2_set_current_limit
void efuse2_set_current_limit(efuse2_t *ctx, float current)
Set operating current function.
application_init
void application_init(void)
Definition: main.c:43
efuse2_get_fault
uint8_t efuse2_get_fault(efuse2_t *ctx)
Get fault function.
op_current
float op_current
Definition: main.c:38
efuse2_init
err_t efuse2_init(efuse2_t *ctx, efuse2_cfg_t *cfg)
eFuse 2 initialization function.
efuse2_t
eFuse 2 Click context object.
Definition: efuse2.h:158
EFUSE2_MAP_MIKROBUS
#define EFUSE2_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: efuse2.h:145
EFUSE2_AD5175_SHUTDOWN_MODE
#define EFUSE2_AD5175_SHUTDOWN_MODE
Definition: efuse2.h:60