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 (136628 times)
  2. FAT32 Library (69833 times)
  3. Network Ethernet Library (55887 times)
  4. USB Device Library (46226 times)
  5. Network WiFi Library (41861 times)
  6. FT800 Library (41081 times)
  7. GSM click (28943 times)
  8. PID Library (26402 times)
  9. mikroSDK (26316 times)
  10. microSD click (25328 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 TX click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.8

mikroSDK Library: 2.0.0.0

Category: BT/BLE

Downloaded: 130 times

Not followed.

License: MIT license  

BLE TX Click is a compact add-on board that contains a low-energy Bluetooth transmitter. This board features the AK1595, a Bluetooth 5.2 transmitter with incorporated proprietary algorithm software from AKM Semiconductor. The AK1595 transmitter simplifies wireless connectivity to a system with no need to develop complicated, proprietary microcontroller code. Bluetooth Low Energy compliant advertising transmission can be achieved by simply configuring the transmission power, data, and transmission start-trigger via the UART or I2C interface.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


BLE TX click

BLE TX Click is a compact add-on board that contains a low-energy Bluetooth transmitter. This board features the AK1595, a Bluetooth 5.2 transmitter with incorporated proprietary algorithm software from AKM Semiconductor. The AK1595 transmitter simplifies wireless connectivity to a system with no need to develop complicated, proprietary microcontroller code. Bluetooth Low Energy compliant advertising transmission can be achieved by simply configuring the transmission power, data, and transmission start-trigger via the UART or I2C interface.

ble_tx_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Mar 2021.
  • Type : I2C type

Software Support

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

Standard key functions :

  • bletx_cfg_setup Config Object Initialization function.

    void bletx_cfg_setup ( bletx_cfg_t *cfg );
  • bletx_init Initialization function.

    err_t bletx_init ( bletx_t *ctx, bletx_cfg_t *cfg );
  • bletx_default_cfg Click Default Configuration function.

    err_t bletx_default_cfg ( bletx_t *ctx );

Example key functions :

  • bletx_start_advertising BLE TX start advertising function.

    err_t bletx_start_advertising ( bletx_t *ctx );
  • bletx_set_configuration BLE TX configuration setting function

    err_t bletx_set_configuration ( bletx_t *ctx, bletx_adv_cfg_t adv_cfg );
  • bletx_create_eddystone_uri BLE TX create Eddystone™ URI data packet function.

    err_t bletx_create_eddystone_uri ( bletx_t *ctx, bletx_eddystone_data_t adv_data );

Example Description

This library contains API for the Ble TX Click driver. This example processes data from Ble TX Click, Ble TX Click Bluetooth® Low Energy compliant advertising transmission can be achieved by simply configuring the transmission power, data, and transmission - start trigger.

The demo application is composed of two sections :

Application Init

Initialization of I2C module and log UART. Initializes driver and set performs the default configuration. Configure Bluetooth Low Energy Beacons to transmit so-called advertising frames. Configuration of the Eddystone URI, UID, or TLM Bluetooth Low Energy Beacons profile task depends on uncommented code. Eddystone ( URI ) : broadcasts a URL of at most 15 characters that redirects to a website that is secured using SSL. Eddystone ( UID ) : broadcasts an identifying code that allows apps to retrieve information from app servers. Eddystone ( TLM ) : broadcasts information about the beacon, include battery level, sensor data, or other relevant information to beacon administrators.


void application_init ( void ) 
{
    log_cfg_t log_cfg;      /**< Logger config object. */
    bletx_cfg_t bletx_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.
    bletx_cfg_setup( &bletx_cfg );
    BLETX_MAP_MIKROBUS( bletx_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == bletx_init( &bletx, &bletx_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    bletx_default_cfg ( &bletx );
    Delay_ms ( 1000 );

    adv_cfg.adv_ch_1_frequency = ADVCH1_37_Ch_2402_MHz;
    adv_cfg.adv_ch_2_frequency = ADVCH2_38_Ch_2426_MHz;
    adv_cfg.adv_ch_3_frequency = ADVCH3_39_Ch_2480_MHz;
    adv_cfg.tx_output_power = TX_POWER_0_dBm;
    adv_cfg.txdata_loop = 0;
    adv_cfg.txdata_cw = 0;
    adv_cfg.eventnum = 0;
    adv_cfg.advdelay_enb = BLETX_ADV_DELAY_ENABLE;
    adv_cfg.avdintvl_interval_ms = 0;
    adv_cfg.crc_enb = BLETX_CRC_ENABLE;
    adv_cfg.white_enb = BLETX_WHITE_ENABLE;
    adv_cfg.pdu_len = 39;

    adv_cfg.uuid[ 0 ] = 0x11;
    adv_cfg.uuid[ 1 ] = 0x22;
    adv_cfg.uuid[ 2 ] = 0x33;
    adv_cfg.uuid[ 3 ] = 0x44;
    adv_cfg.uuid[ 4 ] = 0x55;
    adv_cfg.uuid[ 5 ] = 0x66;

    if ( BLETX_OK != bletx_set_configuration( &bletx, adv_cfg ) ) 
    {
        log_error( &logger, " Set configuration." );
        for ( ; ; );
    }
    Delay_ms ( 100 );

#ifdef URI
    adv_data.length_of_service_list = 3;
    adv_data.param_service_list = 3;
    adv_data.eddystone_id = BLETX_EDDYSTONE_SERVICE_UUID;
    adv_data.length_of_service_data = 13;
    adv_data.service_data = BLETX_EDDYSTONE_SERVICE_DATA_TYPE_VALUE;
    adv_data.frame_type_url = BLETX_EDDYSTONE_FRAME_TYPE_URL;
    adv_data.power = BLETX_TX_POWER_LVL_MODE_LOWEST;
    adv_data.spec_data = BLETX_EDDYSTONE_SPEC_DATA_HTTPS_WWW;
    adv_data.advdata_url[ 0 ] = 'm';
    adv_data.advdata_url[ 1 ] = 'i';
    adv_data.advdata_url[ 2 ] = 'k';
    adv_data.advdata_url[ 3 ] = 'r';
    adv_data.advdata_url[ 4 ] = 'o';
    adv_data.advdata_url[ 5 ] = 'e';
    adv_data.domain = BLETX_CHARACTER_CODES_DOT_COM;

    bletx_create_eddystone_uri ( &bletx, adv_data );
#endif

#ifdef UID
    adv_data.length_of_service_list = 3;
    adv_data.param_service_list = 3;
    adv_data.eddystone_id = BLETX_EDDYSTONE_SERVICE_UUID;
    adv_data.length_of_service_data = 23;
    adv_data.service_data = BLETX_EDDYSTONE_SERVICE_DATA_TYPE_VALUE;
    adv_data.frame_type_url = BLETX_EDDYSTONE_FRAME_TYPE_UID;
    adv_data.power = BLETX_TX_POWER_LVL_MODE_LOW;          

    adv_data.name_space_id[ 0 ] = 0x01;
    adv_data.name_space_id[ 1 ] = 0x02;
    adv_data.name_space_id[ 2 ] = 0x03;
    adv_data.name_space_id[ 3 ] = 0x04;
    adv_data.name_space_id[ 4 ] = 0x05;
    adv_data.name_space_id[ 5 ] = 0x06;
    adv_data.name_space_id[ 6 ] = 0x07;
    adv_data.name_space_id[ 7 ] = 0x08;
    adv_data.name_space_id[ 8 ] = 0x09;
    adv_data.name_space_id[ 9 ] = 0x0A;

    adv_data.instance_id[ 0 ] = 0x01;
    adv_data.instance_id[ 1 ] = 0x23;
    adv_data.instance_id[ 2 ] = 0x45;
    adv_data.instance_id[ 3 ] = 0x67;
    adv_data.instance_id[ 4 ] = 0x89;
    adv_data.instance_id[ 5 ] = 0xAB;

    bletx_create_eddystone_uid ( &bletx, adv_data );
#endif

#ifdef TLM
    adv_data.length_of_service_list = 3;
    adv_data.param_service_list = 3;
    adv_data.eddystone_id = BLETX_EDDYSTONE_SERVICE_UUID;
    adv_data.length_of_service_data = 23;
    adv_data.service_data = BLETX_EDDYSTONE_SERVICE_DATA_TYPE_VALUE;
    adv_data.frame_type_url = BLETX_EDDYSTONE_FRAME_TYPE_TLM;
    adv_data.tlm_version = 0;          // TLM version
    adv_data.spec_data = BLETX_EDDYSTONE_SPEC_DATA_TLM;

    adv_data.battery_voltage = 3600;
    adv_data.beacon_temperature = 20.21;
    adv_data.pdu_count = 11223344;

    bletx_create_eddystone_tlm ( &bletx, adv_data );
#endif

    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

This is an example that shows the use of a Ble TX click board™. In this example, the application turns the selected advertising frames ON and OFF for a period of 10 seconds.


void application_task ( void ) 
{  
    log_printf( &logger, ">>>\tStart Advertising \r\n" );
    bletx_start_advertising( &bletx );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, ">>>\tStop Advertising \r\n" );
    bletx_stop_advertising( &bletx );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

Note

For scanning BLE TX click board™ BLE Scanner is a recommended Android application and you can find it at the link: https://play.google.com/store/apps/details?id=com.macdom.ble.blescanner

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

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

LBAND RTK click

0

LBAND RTK Click is a compact add-on board that provides global and easy access to satellite L-Band GNSS corrections. This board features the NEO-D9S-00B, an professional-grade satellite data receiver for L-band correction broadcast from u-blox. Operating in a frequency range from 1525MHz to 1559MHz, the NEO-D9S-00B decodes the satellite transmission and outputs a correction stream, enabling a high-precision GNSS receiver to reach accuracies down to centimeter level. It can also select the GNSS correction data delivery channel alongside advanced security features such as signature and anti-jamming.

[Learn More]

M-BUS RF 4 click

0

M-BUS RF 4 Click is a mikroBUS™ add-on board with a MIPOT 32001324 RF wireless transceiver. This module operates in the 868 MHz SRD Band. Thanks to its small LCC form factor (15 x 25 mm only) and its low power consumption this module allows the implementation of highly integrated low power (battery operated) solutions for water, gas, heat or electricity metering applications, both on meter or concentrator devices.

[Learn More]

IrThermo 3V3 click

0

IrThermo click 3.3V is a contactless temperature measurement device that relies on the accurate thermopile sensor chip, which encompasses both the thermopile sensor element and the ASSP. The ASSP - signal conditioning circuitry features 17bit ADC and powerful DSP which allow high degree of accuracy and wide temperature measurement range. The IrThermo click is equipped with both the 10bit PWM interface and the SMBus/I2C interface.

[Learn More]