TOP Contributors

  1. MIKROE (2652 codes)
  2. Alcides Ramos (351 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 (136636 times)
  2. FAT32 Library (69843 times)
  3. Network Ethernet Library (55895 times)
  4. USB Device Library (46228 times)
  5. Network WiFi Library (41867 times)
  6. FT800 Library (41087 times)
  7. GSM click (28946 times)
  8. PID Library (26402 times)
  9. mikroSDK (26320 times)
  10. microSD click (25329 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

BLE 12 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: BT/BLE

Downloaded: 106 times

Not followed.

License: MIT license  

BLE 12 Click is a compact add-on board that provides BT/BLE connectivity for any embedded application. This board features the BM832A, a powerful and highly flexible, ultra low power Bluetooth Low Energy (BLE) module from Fanstel. Based on the Nordic nRF52 SoC, the BM832A supports Bluetooth 5.0 Low-Energy (BLE) connectivity while delivering RF range and performance, debugging and enhanced security features, and low power consumption. It also comes with an ARM Cortex™ M4(F) MCU up to 192kB flash and 24kB RAM, embedded 2.4GHz multi-protocol transceiver, and an integrated PCB trace antenna. This Click board™ is suitable for low-cost Bluetooth low energy applications such as building automation and sensor networks, portable medical, connected home, and more.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "BLE 12 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "BLE 12 click" changes.

Do you want to report abuse regarding "BLE 12 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


BLE 12 click

BLE 12 Click is a compact add-on board that provides BT/BLE connectivity for any embedded application. This board features the BM832A, a powerful and highly flexible, ultra low power Bluetooth Low Energy (BLE) module from Fanstel. Based on the Nordic nRF52 SoC, the BM832A supports Bluetooth 5.0 Low-Energy (BLE) connectivity while delivering RF range and performance, debugging and enhanced security features, and low power consumption. It also comes with an ARM Cortex™ M4(F) MCU up to 192kB flash and 24kB RAM, embedded 2.4GHz multi-protocol transceiver, and an integrated PCB trace antenna. This Click board™ is suitable for low-cost Bluetooth low energy applications such as building automation and sensor networks, portable medical, connected home, and more.

ble12_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Sep 2021.
  • Type : UART type

Software Support

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

Standard key functions :

  • ble12_cfg_setup Config Object Initialization function.

    void ble12_cfg_setup ( ble12_cfg_t *cfg );
  • ble12_init Initialization function.

    err_t ble12_init ( ble12_t *ctx, ble12_cfg_t *cfg );
  • ble12_default_cfg Click Default Configuration function.

    err_t ble12_default_cfg ( ble12_t *ctx );

Example key functions :

  • ble12_set_device_name BLE 12 set device name function.

    err_t ble12_set_device_name ( ble12_t *ctx, uint8_t *device_name );
  • ble12_set_op_mode BLE 12 set operating mode function.

    err_t ble12_set_op_mode ( ble12_t *ctx, uint8_t op_mode );
  • ble12_send_cmd BLE 12 sends the command function.

    err_t ble12_send_cmd ( ble12_t *ctx, char *cmd );

Example Description

This example reads and processes data from BLE 12 Click board™.

The demo application is composed of two sections :

Application Init

Initializes UART driver and logs UART. After driver initialization, the app performs a wake-up module, enters command mode, sets the device name and advertising time interval, and disconnects all connections. After that, the blinking of the yellow LED Indicates that the BLE 12 Click board™ is ready for connection. After establishing the connection, the yellow LED is turned on.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    ble12_cfg_t ble12_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.
    ble12_cfg_setup( &ble12_cfg );
    BLE12_MAP_MIKROBUS( ble12_cfg, MIKROBUS_1 );
    if ( UART_ERROR == ble12_init( &ble12, &ble12_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( BLE12_ERROR == ble12_default_cfg ( &ble12 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    app_buf_len = 0;
    app_buf_cnt = 0;
    Delay_ms ( 100 );
    log_info( &logger, " Application Task " );

    log_printf( &logger, "-------------------------------\r\n" );
    log_printf( &logger, "\t  BLE 12 Click\r\n" );
    log_printf( &logger, "-------------------------------\r\n" );
    log_printf( &logger, "\t  Command mode\r\n" );
    ble12_set_op_mode( &ble12, BLE12_OP_MODE_CMD );
    Delay_ms ( 100 );

    ble12_event_startup( &ble12 );
    Delay_ms ( 100 );

    ble12_set_led_state( &ble12, BLE12_LED_RED, BLE12_LED_OFF );
    ble12_set_led_state( &ble12, BLE12_LED_YELLOW, BLE12_LED_OFF );
    Delay_ms ( 100 );

    log_printf( &logger, "- - - - - - - - - - - - - - - -\r\n" );
    log_printf( &logger, "> Set device name:" );
    log_printf( &logger, " BLE 12 Click\r\n" );
    ble12_set_device_name( &ble12, "BLE 12 Click" );
    Delay_ms ( 100 );

    log_printf( &logger, "> Set Adv. Interval: 99 ms\r\n" );
    ble12_set_adv_interval( &ble12, "0099" );
    Delay_ms ( 100 );

    log_printf( &logger, "> Disconnect all connections\r\n" );
    ble12_disconnect( &ble12 );
    Delay_ms ( 100 );

    log_printf( &logger, "-------------------------------\r\n" );
    log_printf( &logger, "  Please connect your device\r\n" );

    do
    {
        ble12_process(); 
        ble12_set_led_state( &ble12, BLE12_LED_YELLOW, BLE12_LED_ON );
        Delay_ms ( 50 );
        ble12_set_led_state( &ble12, BLE12_LED_YELLOW, BLE12_LED_OFF );
        Delay_ms ( 50 );
    }
    while ( !strstr( app_buf, BLE12_EVT_CONNECTED ) );
    Delay_ms ( 100 );

    ble12_set_led_state( &ble12, BLE12_LED_RED, BLE12_LED_OFF );
    ble12_set_led_state( &ble12, BLE12_LED_YELLOW, BLE12_LED_ON );
    log_printf( &logger, "- - - - - - - - - - - - - - - -\r\n" );
    log_printf( &logger, "\tDevice connected\r\n" );
    Delay_ms ( 100 );

    ble12_set_op_mode( &ble12, BLE12_OP_MODE_DATA );
    log_printf( &logger, "-------------------------------\r\n" );
    log_printf( &logger, "\t    Data mode\r\n" );
    log_printf( &logger, "- - - - - - - - - - - - - - - -\r\n" );
    Delay_ms ( 100 );

    ble12_process();
    ble12_clear_app_buf( );
    Delay_ms ( 100 );
}

Application Task

This example demonstrates the use of the BLE 12 Click board™. Reads the received data and parses it. Results are being sent to the Usart Terminal, where you can track their changes.


void application_task ( void ) 
{      
    ble12_process();

    if ( app_buf_len > 0 ) 
    { 
        log_printf( &logger, "%s", app_buf );
        ble12_clear_app_buf(  );    
    }
}

Note

We have used the Serial Bluetooth Terminal Android application for the test and you can find it at the link: https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal

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

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

VREG click

0

This library contains API for Vreg Click driver.

[Learn More]

WiFi 11 click

5

WiFi 11 Click is a compact add-on board that contains a WiFi and Bluetooth module that has dual bands for WiFi communication. This board features the BW16, a single-chip low-power dual bands Wireless LAN (WLAN) and Bluetooth Low Energy SoC module from Shenzhen B&amp;amp;T Technologies Co., Ltd.

[Learn More]

8x8 Y click

5

8x8 clicks are 8x8 LED matrix displays in form of add-on boards in mikroBUS form factor. Boards feature MAX7219 8-digit LED display driver module as well as 64 LED diodes.

[Learn More]