TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136710 times)
  2. FAT32 Library (69923 times)
  3. Network Ethernet Library (55936 times)
  4. USB Device Library (46258 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41146 times)
  7. GSM click (28979 times)
  8. PID Library (26410 times)
  9. mikroSDK (26355 times)
  10. microSD click (25353 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

BT Audio 2 click

Rating:

5

Author: MIKROE

Last Updated: 2020-06-26

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: BT/BLE

Downloaded: 1454 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.

No Abuse Reported
Api supported

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

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

BT Audio 2 Click

BT Audio 2 Click

Native view of the BT Audio 2 Click board.

View full image
BT Audio 2 Click

BT Audio 2 Click

Front and back view of the BT Audio 2 Click board.

View full image

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 :

  • System Initialization - Initializes all necessary peripherals and pins.
  • Application Initialization - Initializes UART interface and performs the BTM device enabling, reset and mode configuration. Also sets a default callback function for the response checking.
  • Application Task - (code snippet) - Allows user to execute a full music control, such as volume control, song control, EQ control, BT power control. Note: By using driver functions user can perform the all other module functionality. Using the selected UART terminal user can check every command and event response.
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 :

  • collect_response - Collects a response sequence to the response buffer.
  • log_response - Sends the response to the determined uart terminal.
  • check_response_ready - Checks response ready flag and if the response is ready then calls the log_response function.
  • set_eq_mode - Performs the changing of 10 differents EQ modes of the BTM device. The uart rx interrupt will catch every byte which was sent to the uart rx buffer on the host mcu.

Other mikroE Libraries used in the example:

  • Conversions
  • C_String
  • UART

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

UT-S 7 SEG R click

0

UT-S 7 SEG R click uses two SMD ultra-thin DSM7UA 7-SEG LED displays, made with the patented technology that delivers thickness of only 2.1 mm. These displays are driven by the MAX6969, a constant current LED integrated driver from Maxim Integrated, which uses the SPI serial interface for communication.

[Learn More]

Fan 6 click

0

The Fan 6 click is a Click board™ which features EMC2103, an SMBus compliant fan controller with up to up to 3 external and 1 internal temperature channels.

[Learn More]

FAN 4 click

0

Fan 4 click is a very compact, two-wire fan driver. It utilizes an integrated 5V, DC, brushless-motor driver chip.

[Learn More]