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
- stepdown8_cfg_setup Config Object Initialization function.
void stepdown8_cfg_setup(stepdown8_cfg_t *cfg)
Step Down 8 configuration object setup function.
Step Down 8 Click configuration object.
Definition stepdown8.h:175
- stepdown8_init Initialization function.
err_t stepdown8_init(stepdown8_t *ctx, stepdown8_cfg_t *cfg)
Step Down 8 initialization function.
Step Down 8 Click context object.
Definition stepdown8.h:154
- stepdown8_default_cfg Click Default Configuration function.
err_t stepdown8_default_cfg(stepdown8_t *ctx)
Step Down 8 default configuration function.
- stepdown8_set_en_pin Step Down 8 set EN pin state function.
void stepdown8_set_en_pin(stepdown8_t *ctx, uint8_t pin_state)
Step Down 8 set EN pin state function.
- stepdown8_set_wiper_pos Step Down 8 set wiper position.
err_t stepdown8_set_wiper_pos(stepdown8_t *ctx, uint16_t wiper_pos)
Step Down 8 set wiper position.
- stepdown8_set_output Step Down 8 set output voltage.
err_t stepdown8_set_output(stepdown8_t *ctx, float voltage)
Step Down 8 set output voltage.
Application Init
Initialization of I2C module and log UART. After driver initialization, default settings sets output voltage to 3 V.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( I2C_MASTER_ERROR ==
stepdown8_init( &stepdown8, &stepdown8_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
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.
{
{
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.