buck15  2.1.0.0
Main Page

Buck 15 click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

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

Software Support

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

Standard key functions :

Example key functions :

  • buck15_set_vout This function sets the voltage output by using an I2C serial interface.
    err_t buck15_set_vout ( buck15_t *ctx, buck15_vout_t vout );
  • buck15_set_vset This function sets the wiper position for the output voltage settings by using an I2C serial interface.
    err_t buck15_set_vset ( buck15_t *ctx, uint8_t vset_wp );
  • buck15_enable_device This function enables the device by setting the EN pin to high logic state.

Example Description

This example demonstrates the use of the Buck 15 Click board by changing the output voltage.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the device default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
buck15_cfg_t buck15_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
buck15_cfg_setup( &buck15_cfg );
BUCK15_MAP_MIKROBUS( buck15_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == buck15_init( &buck15, &buck15_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( BUCK15_ERROR == buck15_default_cfg ( &buck15 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
log_printf( &logger, "____________\r\n" );
Delay_ms( 100 );
}

Application Task

The demo application changes the output voltage and displays the currently set voltage output value. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{
for ( buck15_vout_t vout = BUCK15_VOUT_0V6; vout <= BUCK15_VOUT_5V; vout++ )
{
if ( BUCK15_OK == buck15_set_vout( &buck15, vout ) )
{
log_printf( &logger, " Vout : %.1f [V]\r\n", vout_table[ vout ] );
log_printf( &logger, "____________\r\n" );
Delay_ms( 5000 );
}
}
}

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

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.


BUCK15_VOUT_5V
@ BUCK15_VOUT_5V
Definition: buck15.h:229
buck15_t
Buck 15 Click context object.
Definition: buck15.h:159
buck15_set_vset
err_t buck15_set_vset(buck15_t *ctx, uint8_t vset_wp)
Buck 15 set VSET function.
buck15_cfg_t
Buck 15 Click configuration object.
Definition: buck15.h:179
application_task
void application_task(void)
Definition: main.c:69
buck15_default_cfg
err_t buck15_default_cfg(buck15_t *ctx)
Buck 15 default configuration function.
BUCK15_ERROR
@ BUCK15_ERROR
Definition: buck15.h:198
BUCK15_VOUT_0V6
@ BUCK15_VOUT_0V6
Definition: buck15.h:208
buck15_cfg_setup
void buck15_cfg_setup(buck15_cfg_t *cfg)
Buck 15 configuration object setup function.
BUCK15_MAP_MIKROBUS
#define BUCK15_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: buck15.h:145
buck15_vout_t
buck15_vout_t
Buck 15 output voltage values.
Definition: buck15.h:207
buck15_set_vout
err_t buck15_set_vout(buck15_t *ctx, buck15_vout_t vout)
Buck 15 set VOUT function.
application_init
void application_init(void)
Definition: main.c:31
BUCK15_OK
@ BUCK15_OK
Definition: buck15.h:197
buck15_enable_device
void buck15_enable_device(buck15_t *ctx)
Buck 15 enable device function.
buck15_init
err_t buck15_init(buck15_t *ctx, buck15_cfg_t *cfg)
Buck 15 initialization function.