TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139067 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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-10-31

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: BT/BLE

Downloaded: 211 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

16x9 G Click

0

16x9 Click is an array of 144 LEDs, driven by a single IC with relatively low pin count (28).

[Learn More]

PWM driver click

0

If you need to control DC motors with loads up to 10A, PWM driver click is the perfect solution, thanks to the Silicon Lab Si8711CC one-channel isolator. It communicates with the target MCU over PWM pin, and runs on a 5V power supply.

[Learn More]

Accel 20 Click

0

Accel 20 Click is a compact add-on board that contains an acceleration sensor. This board features the KX134-1211, a digital output 3-axis accelerometer optimized for machine condition monitoring from Rohm Semiconductor. It allows selectable full-scale acceleration measurements in ranges of ±8g, ±16g, ±32g, or ±64g in three axes with a configurable host interface that supports both SPI and I2C serial communication. It also features an Advanced Data Path (ADP) technology which allows noise filtering and sensor signal processing, usually carried out by the MCU, to be performed by the accelerometer. They contribute to reducing MCU load and power consumption together with improved application performance.

[Learn More]