TOP Contributors

  1. MIKROE (2769 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139362 times)
  2. FAT32 Library (71816 times)
  3. Network Ethernet Library (57150 times)
  4. USB Device Library (47467 times)
  5. Network WiFi Library (43123 times)
  6. FT800 Library (42441 times)
  7. GSM click (29860 times)
  8. mikroSDK (28203 times)
  9. PID Library (26895 times)
  10. microSD click (26225 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:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.4

mikroSDK Library: 2.0.0.0

Category: BT/BLE

Downloaded: 44 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. With features like high resolution up to 24-bit, 96 kHz audio data format, Bluetooth Low Energy data rate up to 1Mbits/s, connection of two hosts with HFP/A2DP profiles simultaneously, seamless serial data over UART interface and many more it's perfect solution for applications like portable speakers and headsets.

No Abuse Reported

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 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


BT Audio 2 Click

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. With features like high resolution up to 24-bit, 96 kHz audio data format, Bluetooth Low Energy data rate up to 1Mbits/s, connection of two hosts with HFP/A2DP profiles simultaneously, seamless serial data over UART interface and many more it's perfect solution for applications like portable speakers and headsets.

btaudio2_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Feb 2024.
  • Type : UART type

Software Support

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

Standard key functions :

  • btaudio2_cfg_setup Config Object Initialization function.

    void btaudio2_cfg_setup ( btaudio2_cfg_t *cfg );
  • btaudio2_init Initialization function.

    err_t btaudio2_init ( btaudio2_t *ctx, btaudio2_cfg_t *cfg );
  • btaudio2_default_cfg Click Default Configuration function.

    err_t btaudio2_default_cfg ( btaudio2_t *ctx );

Example key functions :

  • btaudio2_set_device_name This function sets the local device name.

    err_t btaudio2_set_device_name ( btaudio2_t *ctx, uint8_t *device_name );
  • btaudio2_make_call This function makes a call to the specified phone number.

    err_t btaudio2_make_call ( btaudio2_t *ctx, uint8_t database_index, uint8_t *phone_number );
  • btaudio2_volume_up This function increases the volume of a specified gain mask.

    err_t btaudio2_volume_up ( btaudio2_t *ctx, uint8_t database_index, uint8_t mask );

Example Description

This example demonstrates the use of BT Audio 2 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;  /**< Logger config object. */
    btaudio2_cfg_t btaudio2_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_info( &logger, " Application Init " );

    // Click initialization.
    btaudio2_cfg_setup( &btaudio2_cfg );
    BTAUDIO2_MAP_MIKROBUS( btaudio2_cfg, MIKROBUS_1 );
    if ( UART_ERROR == btaudio2_init( &btaudio2, &btaudio2_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( BTAUDIO2_OK != btaudio2_default_cfg ( &btaudio2 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    if ( BTAUDIO2_OK != btaudio2_set_device_name ( &btaudio2, DEVICE_NAME ) )
    {
        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 ( BTAUDIO2_OK == btaudio2_read_event ( &btaudio2 ) ) 
    {
        btaudio2_event_handler ( &btaudio2 );
    }
}

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

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.


ALSO FROM THIS AUTHOR

NB IoT 4 Click

0

NB IoT 4 Click is a compact add-on board that contains a cellular IoT-based module with integrated eSIM for global data connectivity. This board features the C1-RM, a three-band NB-IoT, IoT/2G wireless communication module supporting Band 3, 5, and 8 mainly applied to low power data transmission service from Cavli Wireless.

[Learn More]

Temp-Hum 12 click

5

Temp-Hum 12 click is a smart environmental temperature and humidity sensor Click board, packed with features which allow easy and simple integration into any design that requires accurate and reliable humidity and temperature measurements.

[Learn More]

Servo Click

0

Servo Click is a 16-channel PWM servo driver with the voltage sensing circuitry. It can be used to simultaneously control 16 servo motors, each with its own programmable PWM signal.

[Learn More]