We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-06-26
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: BT/BLE
Downloaded: 1835 times
Not followed.
License: MIT license
BT Audio 2 Click is Bluetooth audio stream add on board based on BM62 module from Microchip. It's a Stereo Audio module which is fully qualified Bluetooth v5.0 dual-mode (BDR/EDR/BLE) to be added in any wireless audio and voice application.
Do you want to subscribe in order to receive notifications regarding "BT Audio 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "BT Audio 2 click" changes.
Do you want to report abuse regarding "BT Audio 2 click".
Library Description
This library allows to establish a communication with the BT Audio 2 click (BM62 module). On this way we can perform a full control of the module, such as playing songs control, EQ control, Bluetooth connection control, status reading, etc. The response reading and checking are also supported by this library. For more details, please, check full documentation.
Key functions:
void btaudio2_response_handler_set( void ( *handler )( uint8_t*, uint16_t*, uint16_t* ) );
- This function sets handler on the function that should be performed.btaudio2_err_t btaudio2_make_call( uint8_t data_base, unsigned char *phone_num );
- This command is used to trigger HF action for making an outgoing call.btaudio2_err_t btaudio2_song_ctrl( uint8_t ctrl_byte );
- This command is used to perform the song control, such as the song volume, song selection, etc.Examples description
The application is composed of three sections :
void application_task( )
{
uint8_t rx_dat = UART_Rdy_Ptr( );
if ( rx_dat != RX_UART_NOT_READY )
{
rx_dat = UART_Rd_Ptr( );
switch ( rx_dat )
{
case 'o' :
{
btaudio2_power_on_off( );
break;
}
case 's' :
{
btaudio2_play_ctrl( BTAUDIO2_STOP );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
case 'p' :
{
btaudio2_play_ctrl( BTAUDIO2_PLAY_PAUSE );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
case '4' :
{
btaudio2_song_ctrl( BTAUDIO2_PREV_SONG );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
case '6' :
{
btaudio2_song_ctrl( BTAUDIO2_NEXT_SONG );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
case '+' :
{
btaudio2_song_ctrl( BTAUDIO2_VOLUME_UP );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
case '-' :
{
btaudio2_song_ctrl( BTAUDIO2_VOLUME_DOWN );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
case 'e' :
{
set_eq_mode( );
mikrobus_logWrite( ">> Command: ", _LOG_TEXT );
log_response( );
break;
}
default :
{
break;
}
}
}
check_response_ready( );
}
Additional Functions :
Other mikroE Libraries used in the example:
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.