ble12 2.0.0.0
BLE 12 Click Driver

API for configuring and manipulating BLE 12 Click driver. More...

Topics

 BLE 12 Device Settings
 Settings for registers of BLE 12 Click driver.
 
 BLE 12 MikroBUS Map
 MikroBUS pin mapping of BLE 12 Click driver.
 

Functions

void ble12_cfg_setup (ble12_cfg_t *cfg)
 BLE 12 configuration object setup function.
 
err_t ble12_init (ble12_t *ctx, ble12_cfg_t *cfg)
 BLE 12 initialization function.
 
err_t ble12_default_cfg (ble12_t *ctx)
 BLE 12 default configuration function.
 
err_t ble12_generic_write (ble12_t *ctx, char *data_buf, uint16_t len)
 BLE 12 data writing function.
 
err_t ble12_generic_read (ble12_t *ctx, char *data_buf, uint16_t max_len)
 BLE 12 data reading function.
 
err_t ble12_wake_up_device (ble12_t *ctx)
 BLE 12 wake up the device function.
 
err_t ble12_send_cmd (ble12_t *ctx, char *cmd)
 BLE 12 sends the command function.
 
err_t ble12_send_data (ble12_t *ctx, char *tx_data)
 BLE 12 send data function.
 
err_t ble12_init_led (ble12_t *ctx)
 BLE 12 LED initialization function.
 
err_t ble12_set_led_state (ble12_t *ctx, uint8_t led, uint8_t state)
 BLE 12 set LED state function.
 
err_t ble12_reset (ble12_t *ctx)
 BLE 12 reset function.
 
err_t ble12_get_version (ble12_t *ctx)
 BLE 12 get version function.
 
err_t ble12_set_device_name (ble12_t *ctx, uint8_t *device_name)
 BLE 12 set device name function.
 
err_t ble12_save_config (ble12_t *ctx)
 BLE 12 save config function.
 
err_t ble12_set_adv_interval (ble12_t *ctx, uint8_t *adv_interval)
 BLE 12 set adv interval function.
 
err_t ble12_disconnect (ble12_t *ctx)
 BLE 12 disconnect function.
 
err_t ble12_set_default (ble12_t *ctx)
 BLE 12 set default function.
 
err_t ble12_set_op_mode (ble12_t *ctx, uint8_t op_mode)
 BLE 12 set operating mode function.
 
err_t ble12_event_startup (ble12_t *ctx)
 BLE 12 event start-up function.
 

Detailed Description

API for configuring and manipulating BLE 12 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ble12_cfg_setup()

void ble12_cfg_setup ( ble12_cfg_t * cfg)

BLE 12 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ble12_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ble12_default_cfg()

err_t ble12_default_cfg ( ble12_t * ctx)

BLE 12 default configuration function.

This function executes a default configuration of BLE 12 click board.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ble12_disconnect()

err_t ble12_disconnect ( ble12_t * ctx)

BLE 12 disconnect function.

This function disconnects all paired devices by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_event_startup()

err_t ble12_event_startup ( ble12_t * ctx)

BLE 12 event start-up function.

This function event start-up for the control LED by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_generic_read()

err_t ble12_generic_read ( ble12_t * ctx,
char * data_buf,
uint16_t max_len )

BLE 12 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_generic_write()

err_t ble12_generic_write ( ble12_t * ctx,
char * data_buf,
uint16_t len )

BLE 12 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_get_version()

err_t ble12_get_version ( ble12_t * ctx)

BLE 12 get version function.

This function get module version by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_init()

err_t ble12_init ( ble12_t * ctx,
ble12_cfg_t * cfg )

BLE 12 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ble12_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_init_led()

err_t ble12_init_led ( ble12_t * ctx)

BLE 12 LED initialization function.

This function initialization for LED control by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_reset()

err_t ble12_reset ( ble12_t * ctx)

BLE 12 reset function.

This function software reset the device by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_save_config()

err_t ble12_save_config ( ble12_t * ctx)

BLE 12 save config function.

This function performs the configuration save procedure by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_send_cmd()

err_t ble12_send_cmd ( ble12_t * ctx,
char * cmd )

BLE 12 sends the command function.

This function sends the desired command by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]cmd: Desired command.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_send_data()

err_t ble12_send_data ( ble12_t * ctx,
char * tx_data )

BLE 12 send data function.

This function send the desired data to the paired device by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]tx_data: Data for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_set_adv_interval()

err_t ble12_set_adv_interval ( ble12_t * ctx,
uint8_t * adv_interval )

BLE 12 set adv interval function.

This function sets the advertising interval by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]adv_interval: Advertising interval time ( ms ).
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
This command trigger readvertise.

◆ ble12_set_default()

err_t ble12_set_default ( ble12_t * ctx)

BLE 12 set default function.

This function sets the default module configuration by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_set_device_name()

err_t ble12_set_device_name ( ble12_t * ctx,
uint8_t * device_name )

BLE 12 set device name function.

This function sets the device name by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]device_name: Device name.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_set_led_state()

err_t ble12_set_led_state ( ble12_t * ctx,
uint8_t led,
uint8_t state )

BLE 12 set LED state function.

This function controls the LEDs by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]led: select LED
  • 0 ( BLE12_LED_YELLOW ) - Yellow led,
  • 1 ( BLE12_LED_RED ) - Red led.
[in]state: LED state
  • 0 ( BLE12_LED_ON ) - Turn on the LED,
  • 1 ( BLE12_LED_OFF ) - Turn off the LED.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_set_op_mode()

err_t ble12_set_op_mode ( ble12_t * ctx,
uint8_t op_mode )

BLE 12 set operating mode function.

This function sets the operating mode by using UART serial interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
[in]op_mode: Operating mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble12_wake_up_device()

err_t ble12_wake_up_device ( ble12_t * ctx)

BLE 12 wake up the device function.

This function performs the wake-up UART interface of the BM832A Bluetooth 5 Module on the BLE 12 click board™.

Parameters
[in]ctx: Click context object. See ble12_t object definition for detailed explanation.
Returns
  • 0 - Success.
Note
None.