annab412 2.1.0.0
Main Page

ANNA-B412 click

‍ANNA-B412 Click is a compact add-on board that provides BT/BLE connectivity for any embedded application. This board features the ANNA-B412, a standalone Bluetooth 5.1 low-energy module from u-blox. It is a System-in-Package (SiP) design with pre-flashed u-connectXpress software, which supports Bluetooth LE Serial port service, GATT client and server, Bluetooth beacons, Bluetooth long-range, NFC, and simultaneous peripheral and central roles. The Bluetooth module in LE mode can achieve up to 2Mbps data rates.

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Jul 2023.
  • Type : UART type

Software Support

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

Standard key functions :

Example key functions :

Example Description

‍This example demonstrates the use of ANNA-B412 click board by processing the incoming data and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

‍Initializes the driver and performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
annab412_cfg_t annab412_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
annab412_cfg_setup( &annab412_cfg );
ANNAB412_MAP_MIKROBUS( annab412_cfg, MIKROBUS_1 );
if ( UART_ERROR == annab412_init( &annab412, &annab412_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( ANNAB412_ERROR == annab412_default_cfg ( &annab412 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
Delay_ms ( 1000 );
annab412_display_rsp( RSP_OK );
Delay_ms ( 100 );
annab412_display_rsp( RSP_OK );
Delay_ms ( 100 );
annab412_display_rsp( RSP_OK );
Delay_ms ( 100 );
annab412_display_rsp( RSP_OK );
Delay_ms ( 100 );
Delay_ms ( 100 );
}
@ ANNAB412_ERROR
Definition annab412.h:222
#define ANNAB412_PIN_STATE_LOW
ANNA-B412 I/O logic pin state.
Definition annab412.h:126
#define ANNAB412_ENTER_MODE_DATA
Definition annab412.h:118
#define ANNAB412_DISCOVERABLE_MODE_ON
Definition annab412.h:111
#define ANNAB412_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition annab412.h:153
err_t annab412_set_cmd_enter_mode(annab412_t *ctx, uint8_t mode)
ANNA-B412 set enter mode function.
void annab412_set_dsr_pin(annab412_t *ctx, uint8_t state)
ANNA-B412 set data set ready pin function.
err_t annab412_set_cmd_echo_on(annab412_t *ctx)
ANNA-B412 set command echo on function.
void application_init(void)
Definition main.c:75
#define DEVICE_NAME
Definition main.c:34
#define RSP_OK
Definition main.c:36

Application Task

‍Reads and processes all incoming data and displays them on the USB UART.

void application_task ( void )
{
annab412_process( &annab412 );
if ( app_buf_len > 0 )
{
log_printf( &logger, "%s", app_buf );
annab412_clear_app_buf( );
}
}
void application_task(void)
Definition main.c:129

Note

‍We have used the BLE Scanner smartphone application for the test.

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

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.