btaudio3  2.0.0.0
Main Page

BT Audio 3 click

PRVIH_PAR_RECENICA_SA_PRODUCT_PAGE_DA_ISPRATE_CELINU

[click Product page](CLICK_PRODUCT_PAGE_LINK)


Click library

  • Author : Stefan Filipovic
  • Date : Nov 2021.
  • Type : UART type

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of BT Audio 3 click board by reading the commands received from remote device and performing adequate actions accordingly.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board.

void application_init ( void )
{
log_cfg_t log_cfg;
btaudio3_cfg_t btaudio3_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
btaudio3_cfg_setup( &btaudio3_cfg );
BTAUDIO3_MAP_MIKROBUS( btaudio3_cfg, MIKROBUS_1 );
if ( UART_ERROR == btaudio3_init( &btaudio3, &btaudio3_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( BTAUDIO3_OK != btaudio3_default_cfg ( &btaudio3 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
{
log_error( &logger, " Set device name." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Reads all the received events and parses them.

void application_task ( void )
{
if ( BTAUDIO3_OK == btaudio3_read_event ( &btaudio3 ) )
{
btaudio3_event_handler ( &btaudio3 );
}
}

Note

We have used the Serial Bluetooth Terminal smartphone application for the test.

A smartphone and the click board must be paired in order to exchange messages with each other. So make sure to pair your device with the click board and connect it to using the Serial Bluetooth Terminal application, then you will be able to send commands listed below.

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

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.


btaudio3_eq_mode_t
btaudio3_eq_mode_t
BT Audio 3 Click equalizer mode selection values.
Definition: btaudio3.h:489
btaudio3_music_control_t
btaudio3_music_control_t
BT Audio 3 Click music control values.
Definition: btaudio3.h:469
btaudio3_cfg_setup
void btaudio3_cfg_setup(btaudio3_cfg_t *cfg)
BT Audio 3 configuration object setup function.
btaudio3_default_cfg
err_t btaudio3_default_cfg(btaudio3_t *ctx)
BT Audio 3 default configuration function.
btaudio3_cfg_t
BT Audio 3 Click configuration object.
Definition: btaudio3.h:432
DEVICE_NAME
#define DEVICE_NAME
Definition: main.c:40
BTAUDIO3_OK
@ BTAUDIO3_OK
Definition: btaudio3.h:459
btaudio3_set_eq_mode
err_t btaudio3_set_eq_mode(btaudio3_t *ctx, btaudio3_eq_mode_t eq_mode)
BT Audio 3 set equalizer mode function.
application_task
void application_task(void)
Definition: main.c:112
BTAUDIO3_MAP_MIKROBUS
#define BTAUDIO3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: btaudio3.h:376
btaudio3_set_device_name
err_t btaudio3_set_device_name(btaudio3_t *ctx, uint8_t *device_name)
BT Audio 3 set device name function.
btaudio3_t
BT Audio 3 Click context object.
Definition: btaudio3.h:405
btaudio3_read_event
err_t btaudio3_read_event(btaudio3_t *ctx)
BT Audio 3 read event function.
application_init
void application_init(void)
Definition: main.c:70
btaudio3_music_control
err_t btaudio3_music_control(btaudio3_t *ctx, btaudio3_music_control_t action)
BT Audio 3 music control function.
btaudio3_init
err_t btaudio3_init(btaudio3_t *ctx, btaudio3_cfg_t *cfg)
BT Audio 3 initialization function.