leddriver15  2.1.0.0
Main Page

LED Driver 15 Click

LED Driver 15 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the MP3309C, a fully integrated synchronous boost white LED driver with an I2C interface from Monolithic Power Systems. The MP3309C offers high efficiency, delivers up to 40mA of LED current, and operates from a voltage of mikroBUS™ power rails, supporting up to 8 white LEDs in series. It also features a programmable switching frequency to optimize efficiency, supports analog and PWM dimming, and has multiple built-in protection functions that protect the circuit during abnormalities.

Click Product page


Click library

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

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of LED Driver 15 Click board by changing the LEDs dimming level.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
leddriver15_cfg_t leddriver15_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
leddriver15_cfg_setup( &leddriver15_cfg );
LEDDRIVER15_MAP_MIKROBUS( leddriver15_cfg, MIKROBUS_1 );
if ( LEDDRIVER15_OK != leddriver15_init( &leddriver15, &leddriver15_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( LEDDRIVER15_OK != leddriver15_default_cfg ( &leddriver15 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Changes the LEDs dimming level in I2C mode every 500ms. The dimming level will be displayed on the USB UART.

void application_task ( void )
{
static uint8_t dimming = LEDDRIVER15_I2C_DIMMING_MIN;
if ( LEDDRIVER15_OK == leddriver15_set_i2c_dimming ( &leddriver15, dimming ) )
{
log_printf( &logger, " Dimming level: %u\r\n\n", ( uint16_t ) dimming );
}
if ( ++dimming > LEDDRIVER15_I2C_DIMMING_MAX )
{
}
Delay_ms ( 500 );
}

Note

It is recommended to connect 8 LEDs in series (40mA) to the output connector.

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

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.


LEDDRIVER15_I2C_DIMMING_MIN
#define LEDDRIVER15_I2C_DIMMING_MIN
LED Driver 15 I2C dimming setting.
Definition: leddriver15.h:118
application_task
void application_task(void)
Definition: main.c:68
leddriver15_init
err_t leddriver15_init(leddriver15_t *ctx, leddriver15_cfg_t *cfg)
LED Driver 15 initialization function.
leddriver15_enable_device
void leddriver15_enable_device(leddriver15_t *ctx)
LED Driver 15 enable device function.
leddriver15_cfg_setup
void leddriver15_cfg_setup(leddriver15_cfg_t *cfg)
LED Driver 15 configuration object setup function.
leddriver15_set_i2c_dimming
err_t leddriver15_set_i2c_dimming(leddriver15_t *ctx, uint8_t dimming)
LED Driver 15 set i2c dimming function.
leddriver15_disable_device
void leddriver15_disable_device(leddriver15_t *ctx)
LED Driver 15 disable device function.
LEDDRIVER15_I2C_DIMMING_MAX
#define LEDDRIVER15_I2C_DIMMING_MAX
Definition: leddriver15.h:119
application_init
void application_init(void)
Definition: main.c:32
leddriver15_default_cfg
err_t leddriver15_default_cfg(leddriver15_t *ctx)
LED Driver 15 default configuration function.
leddriver15_cfg_t
LED Driver 15 Click configuration object.
Definition: leddriver15.h:171
leddriver15_t
LED Driver 15 Click context object.
Definition: leddriver15.h:157
LEDDRIVER15_OK
@ LEDDRIVER15_OK
Definition: leddriver15.h:187
LEDDRIVER15_MAP_MIKROBUS
#define LEDDRIVER15_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: leddriver15.h:144