stepdown8 2.2.0
Loading...
Searching...
No Matches
stepdown8


Step Down 8 Click

Step Down 8 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Ilic
  • Date : Jul 2023.
  • Type : I2C type

Software Support

Example Description

This library contains API for the Step Down 8 Click driver. This driver provides the functions to set the output voltage treshold.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.StepDown8

Example Key Functions

Application Init

Initialization of I2C module and log UART. After driver initialization, default settings sets output voltage to 3 V.

void application_init ( void )
{
log_cfg_t log_cfg;
stepdown8_cfg_t stepdown8_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
stepdown8_cfg_setup( &stepdown8_cfg );
STEPDOWN8_MAP_MIKROBUS( stepdown8_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == stepdown8_init( &stepdown8, &stepdown8_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( STEPDOWN8_ERROR == stepdown8_default_cfg ( &stepdown8 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define STEPDOWN8_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition stepdown8.h:139
void application_init(void)
Definition main.c:30
@ STEPDOWN8_ERROR
Definition stepdown8.h:195

Application Task

This example demonstrates the use of the Step Down 8 Click board™ by changing output voltage every 2 seconds starting from 3 V up to 18 V.

void application_task ( void )
{
for ( uint8_t n_cnt = STEPDOWN8_MIN_OUTPUT; n_cnt <= STEPDOWN8_MAX_OUTPUT; n_cnt++ )
{
stepdown8_set_output( &stepdown8, ( float ) n_cnt );
log_printf( &logger, " Output voltage %d V\r\n", ( uint16_t ) n_cnt );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
}
#define STEPDOWN8_MAX_OUTPUT
Definition stepdown8.h:99
#define STEPDOWN8_MIN_OUTPUT
Definition stepdown8.h:100
void application_task(void)
Definition main.c:66

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.