DSP 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.
- Author : Nenad Filipovic
- Date : Nov 2020.
- Type : GPIO type
This application controls reverb and multi-effects Digital Multi-Effects DSP provides different sound performance of the DSP Click.
- MikroSDK.Board
- MikroSDK.Log
- Click.Dsp
Config Object Initialization function.
void dsp_cfg_setup ( dsp_cfg_t *cfg );
Initialization function.
err_t dsp_init ( dsp_t *ctx, dsp_cfg_t *cfg );
Click Default Configuration function.
void dsp_default_cfg ( dsp_t *ctx );
DSP reverb and multi-effects setting function.
dsp_retval_t dsp_set_effect ( dsp_t *ctx, uint8_t effects );
DSP power on the device function.
void dsp_power_on ( dsp_t *ctx );
DSP reset the device function.
void dsp_reset ( dsp_t *ctx );
Initializes GPIO driver, set the default configuration and start to write log.
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
dsp_cfg_t dsp_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_printf( &logger, "\r\n" );
log_info( &logger, " Application Init " );
// Click initialization.
dsp_cfg_setup( &dsp_cfg );
DSP_MAP_MIKROBUS( dsp_cfg, MIKROBUS_1 );
if ( dsp_init( &dsp, &dsp_cfg ) == DIGITAL_OUT_UNSUPPORTED_PIN ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
dsp_default_cfg ( &dsp );
log_info( &logger, " Application Task \r\n" );
Delay_ms ( 100 );
log_printf( &logger, "-------------------------------\r\n" );
log_printf( &logger, " DSP Click \r\n" );
log_printf( &logger, "-------------------------------\r\n" );
log_printf( &logger, " Digital Multi-Effects \r\n" );
}
This is an example that shows the use of a DSP Click board. In this example, we change different sound effects such as multiple reverbs, echo, phaser, chorus, flanger, etc. every 10 sec. Results are being sent to the Usart Terminal where you can track their changes.
void application_task ( void )
{
log_printf( &logger, "-------------------------------\r\n" );
dsp_set_effect( &dsp, effects );
display_effects( );
effects++;
if ( effects > DSP_SET_EFFECT_DELAY1 ) {
effects = DSP_SET_EFFECT_MEDIUM;
}
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
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.
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.