ldo  2.1.0.0
Main Page

LDO click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

  • Author : Stefan Filipovic
  • Date : Feb 2023.
  • Type : I2C type

Software Support

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

Standard key functions :

Example key functions :

  • ldo_enable_device This function enables the device by setting the EN pin to HIGH logic state.
    void ldo_enable_device ( ldo_t *ctx );
  • ldo_disable_device This function disables the device by setting the EN pin to LOW logic state.
    void ldo_disable_device ( ldo_t *ctx );
  • ldo_set_vout This function sets the voltage output.
    err_t ldo_set_vout ( ldo_t *ctx, uint16_t vout );

Example Description

This example demonstrates the use of LDO click 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;
ldo_cfg_t ldo_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
ldo_cfg_setup( &ldo_cfg );
LDO_MAP_MIKROBUS( ldo_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == ldo_init( &ldo, &ldo_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( LDO_ERROR == ldo_default_cfg ( &ldo ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Changes the output voltage every 3 seconds and displays on the USB UART the currently set voltage output value.

void application_task ( void )
{
static uint16_t vout = LDO_VOUT_MIN;
if ( LDO_OK == ldo_set_vout ( &ldo, vout ) )
{
log_printf ( &logger, " VOUT: %u mV\r\n\n", vout );
}
vout += LDO_VOUT_STEP;
if ( vout > LDO_VOUT_MAX )
{
vout = LDO_VOUT_MIN;
}
Delay_ms ( 3000 );
}

Note

In order to have up to 3950mV at VOUT you will need to move the VIN SEL on-board jumper

to the VEXT position and provide at least 3950mV voltage input at the VEXT terminal. Otherwise, the maximum level of VOUT will be limited to 3.3V system voltage.

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

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.


ldo_enable_device
void ldo_enable_device(ldo_t *ctx)
LDO enable device function.
ldo_disable_device
void ldo_disable_device(ldo_t *ctx)
LDO disable device function.
ldo_cfg_setup
void ldo_cfg_setup(ldo_cfg_t *cfg)
LDO configuration object setup function.
LDO_VOUT_MIN
#define LDO_VOUT_MIN
LDO VOUT settings.
Definition: ldo.h:100
application_task
void application_task(void)
Definition: main.c:69
LDO_VOUT_STEP
#define LDO_VOUT_STEP
Definition: ldo.h:101
LDO_MAP_MIKROBUS
#define LDO_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: ldo.h:133
ldo_init
err_t ldo_init(ldo_t *ctx, ldo_cfg_t *cfg)
LDO initialization function.
ldo_set_vout
err_t ldo_set_vout(ldo_t *ctx, uint16_t vout)
LDO set vout function.
ldo_t
LDO Click context object.
Definition: ldo.h:146
application_init
void application_init(void)
Definition: main.c:33
LDO_OK
@ LDO_OK
Definition: ldo.h:179
LDO_VOUT_MAX
#define LDO_VOUT_MAX
Definition: ldo.h:102
LDO_ERROR
@ LDO_ERROR
Definition: ldo.h:180
ldo_default_cfg
err_t ldo_default_cfg(ldo_t *ctx)
LDO default configuration function.
ldo_cfg_t
LDO Click configuration object.
Definition: ldo.h:163