ble6 2.0.0.0
BLE 6 Click Driver

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

Topics

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

Typedefs

typedef void(* ble6_handler_t) (uint8_t *message_buf, uint32_t message_len)
 BLE 6 Click driver handler.
 
typedef void(* ble6_hdl_t) (uint8_t *)
 BLE 6 Click driver handler.
 

Functions

void ble6_cfg_setup (ble6_cfg_t *cfg)
 BLE 6 configuration object setup function.
 
err_t ble6_init (ble6_t *ctx, ble6_cfg_t *cfg)
 BLE 6 initialization function.
 
err_t ble6_generic_write (ble6_t *ctx, char *data_buf, uint16_t len)
 BLE 6 data writing function.
 
err_t ble6_generic_read (ble6_t *ctx, char *data_buf, uint16_t max_len)
 BLE 6 data reading function.
 
int8_t ble6_strncmp (uint8_t *string1, uint8_t *string2, uint8_t len)
 Lexicographically compares function.
 
uint8_t ble6_byte_ready (ble6_t *ctx)
 Check for new byte received.
 
void ble6_power_on (ble6_t *ctx, uint8_t en_pwr)
 Set Power On function.
 
void ble6_send_command (ble6_t *ctx, uint8_t *tx_data, uint8_t n_bytes)
 Send command function.
 
void ble6_set_response_handler (void(*handler)(uint8_t *), ble6_hdl_t driver_hdl)
 Set response handlers function.
 
void ble6_set_handlers (ble6_handler_t event_handler, ble6_handler_t eve_hdlr)
 Set handlers function.
 
void ble6_parser_rsp (ble6_t *ctx, ble6_rsp_t *response)
 Response parser function.
 

Detailed Description

API for configuring and manipulating BLE 6 Click driver.

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

Typedef Documentation

◆ ble6_handler_t

typedef void(* ble6_handler_t) (uint8_t *message_buf, uint32_t message_len)

BLE 6 Click driver handler.

Definition of driver handler of BLE 6 Click driver.

◆ ble6_hdl_t

typedef void(* ble6_hdl_t) (uint8_t *)

BLE 6 Click driver handler.

Definition of driver handler of BLE 6 Click driver.

Function Documentation

◆ ble6_byte_ready()

uint8_t ble6_byte_ready ( ble6_t * ctx)

Check for new byte received.

Checks is there a new byte received.

Parameters
[in]ctx: Click context object. See ble6_t object definition for detailed explanation.
Returns
Returns the number of bytes that are available for reading.

◆ ble6_cfg_setup()

void ble6_cfg_setup ( ble6_cfg_t * cfg)

BLE 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ ble6_generic_read()

err_t ble6_generic_read ( ble6_t * ctx,
char * data_buf,
uint16_t max_len )

BLE 6 data reading function.

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

Parameters
[in]ctx: Click context object. See ble6_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.

◆ ble6_generic_write()

err_t ble6_generic_write ( ble6_t * ctx,
char * data_buf,
uint16_t len )

BLE 6 data writing function.

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

Parameters
[in]ctx: Click context object. See ble6_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.

◆ ble6_init()

err_t ble6_init ( ble6_t * ctx,
ble6_cfg_t * cfg )

BLE 6 initialization function.

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

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

◆ ble6_parser_rsp()

void ble6_parser_rsp ( ble6_t * ctx,
ble6_rsp_t * response )

Response parser function.

The function parser device response.

Parameters
[in]ctx: Click context object. See ble6_t object definition for detailed explanation.
[in]response: Pointer to the memory location where response be stored.
Returns
Nothing.

◆ ble6_power_on()

void ble6_power_on ( ble6_t * ctx,
uint8_t en_pwr )

Set Power On function.

The function enable/disble power on by set states of the RST pin of BLUENRG-M2SP, Very low power application processor module for Bluetooth� low energy v5.0 on BLE 6 click.

Parameters
[out]ctx: Click context object. See ble6_t object definition for detailed explanation.
[in]en_pwr: State of the RST pin.
Returns
Nothing.

◆ ble6_send_command()

void ble6_send_command ( ble6_t * ctx,
uint8_t * tx_data,
uint8_t n_bytes )

Send command function.

The function send command to the BLUENRG-M2SP, Very low power application processor module for Bluetooth� low energy v5.0 on BLE 6 click.

Parameters
[in]ctx: Click context object. See ble6_t object definition for detailed explanation.
[in]tx_data: Pointer to the memory location where at_command be stored.
[in]n_bytes: Number of bytes to send.
Returns
Nothing.

◆ ble6_set_handlers()

void ble6_set_handlers ( ble6_handler_t event_handler,
ble6_handler_t eve_hdlr )

Set handlers function.

The function set event handler.

Parameters
[in]event_handler: Pointer of event handler. See ble6_handler_t object definition for detailed explanation.
Returns
Nothing.

◆ ble6_set_response_handler()

void ble6_set_response_handler ( void(*)(uint8_t *) handler,
ble6_hdl_t driver_hdl )

Set response handlers function.

The function set response handler.

Parameters
[in]handler: Pointer of response handler.
Returns
Nothing.

◆ ble6_strncmp()

int8_t ble6_strncmp ( uint8_t * string1,
uint8_t * string2,
uint8_t len )

Lexicographically compares function.

Function lexicographically compares not more than len characters ( characters that follow the null character are not compared ) from the string pointed by string1 to the string pointed by string2.

Parameters
[in]string1: Pointer to the memory location where string1 string be stored.
[in]string2: Pointer to the memory location where string2 string be stored..
[in]len: Number of compare characters.
Returns
Value indicating the string1 and string2 relationship.