TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 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 (136997 times)
  2. FAT32 Library (70114 times)
  3. Network Ethernet Library (56027 times)
  4. USB Device Library (46347 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41286 times)
  7. GSM click (29053 times)
  8. mikroSDK (26489 times)
  9. PID Library (26447 times)
  10. microSD click (25413 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: 1487 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

ADC 2 click

0

ADC 2 click carries MCP3551/3, which is a 22-bit ADC with automatic internal offset and gain calibration.

[Learn More]

Magnetic Rotary 4 click

0

Magnetic Rotary 4 Click is a compact add-on board for accurate magnet-position sensing. This board features the AS5047D, an SPI-configurable high-resolution rotary position sensor for fast absolute angle measurement over a full 360-degree range from ams AG. The AS5047D is equipped with revolutionary integrated dynamic angle error compensation (DAEC™) with almost 0 latency and offers a robust design that suppresses the influence of any homogenous external stray magnetic field. It also comes with an onboard header reserved for incremental and commutation signals of their respective A/B/I and U/V/W signals alongside embedded self-diagnostics, including magnetic field strength, lost magnet, and other related diagnostic features.

[Learn More]

I2C Extend 2 click

0

I2C Extend 2 Click is a compact add-on board suitable for I2C communication bus extension. This board features the PCA9615, a 2-channel multipoint differential I2C bus buffer with hot-swap logic from NXP Semiconductors. The PCA9615 converts the two default I2C signals into four differential signals, two for SCL and two for SDA.

[Learn More]