buckboost4  2.1.0.0
Main Page

Buck-Boost 4 click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

  • Author : Nenad Filipovic
  • Date : Sep 2023.
  • Type : I2C type

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of the Buck-Boost 4 Click boardâ„¢. This driver provides functions for device configurations and for the sets the output voltage.

The demo application is composed of two sections :

Application Init

Initialization of I2C module and log UART. After driver initialization, the app executes a default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
buckboost4_cfg_t buckboost4_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
buckboost4_cfg_setup( &buckboost4_cfg );
BUCKBOOST4_MAP_MIKROBUS( buckboost4_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == buckboost4_init( &buckboost4, &buckboost4_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( BUCKBOOST4_ERROR == buckboost4_default_cfg ( &buckboost4 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
log_printf( &logger, "____________\r\n" );
Delay_ms( 100 );
}

Application Task

The demo application sets the desired output voltage by cycling through a couple of voltage values. Results are sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
for ( uint8_t vout = 1; vout < 21; vout++ )
{
if ( BUCKBOOST4_OK == buckboost4_set_vout( &buckboost4, ( float ) vout ) )
{
log_printf( &logger, " Vout: %dV\r\n", ( uint16_t ) vout );
Delay_ms( 5000 );
}
}
log_printf( &logger, "____________\r\n" );
Delay_ms( 1000 );
}

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

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.


buckboost4_fault_indicator
uint8_t buckboost4_fault_indicator(buckboost4_t *ctx)
Buck-Boost 4 check fault indicator function.
buckboost4_cfg_setup
void buckboost4_cfg_setup(buckboost4_cfg_t *cfg)
Buck-Boost 4 configuration object setup function.
buckboost4_t
Buck-Boost 4 Click context object.
Definition: buckboost4.h:195
buckboost4_init
err_t buckboost4_init(buckboost4_t *ctx, buckboost4_cfg_t *cfg)
Buck-Boost 4 initialization function.
buckboost4_default_cfg
err_t buckboost4_default_cfg(buckboost4_t *ctx)
Buck-Boost 4 default configuration function.
buckboost4_set_vout
err_t buckboost4_set_vout(buckboost4_t *ctx, float vout_v)
Buck-Boost 4 set the output voltage function.
buckboost4_set_vref
err_t buckboost4_set_vref(buckboost4_t *ctx, float vref_mv)
Buck-Boost 4 set internal reference voltage function.
application_task
void application_task(void)
Definition: main.c:69
BUCKBOOST4_ERROR
@ BUCKBOOST4_ERROR
Definition: buckboost4.h:234
application_init
void application_init(void)
Definition: main.c:31
buckboost4_cfg_t
Buck-Boost 4 Click configuration object.
Definition: buckboost4.h:215
BUCKBOOST4_OK
@ BUCKBOOST4_OK
Definition: buckboost4.h:233
BUCKBOOST4_MAP_MIKROBUS
#define BUCKBOOST4_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: buckboost4.h:181