ble6 2.0.0.0
|
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. | |
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 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.
typedef void(* ble6_hdl_t) (uint8_t *) |
BLE 6 Click driver handler.
Definition of driver handler of BLE 6 Click driver.
uint8_t ble6_byte_ready | ( | ble6_t * | ctx | ) |
Check for new byte received.
Checks is there a new byte received.
[in] | ctx | : Click context object. See ble6_t object definition for detailed explanation. |
void ble6_cfg_setup | ( | ble6_cfg_t * | cfg | ) |
BLE 6 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ble6_cfg_t object definition for detailed explanation. |
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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.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.
[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. |
>=0
- Success, <0
- Error.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.
[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. |
0
- Success, -1
- Error.void ble6_parser_rsp | ( | ble6_t * | ctx, |
ble6_rsp_t * | response ) |
Response parser function.
The function parser device response.
[in] | ctx | : Click context object. See ble6_t object definition for detailed explanation. |
[in] | response | : Pointer to the memory location where response be stored. |
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.
[out] | ctx | : Click context object. See ble6_t object definition for detailed explanation. |
[in] | en_pwr | : State of the RST pin. |
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.
[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. |
void ble6_set_handlers | ( | ble6_handler_t | event_handler, |
ble6_handler_t | eve_hdlr ) |
Set handlers function.
The function set event handler.
[in] | event_handler | : Pointer of event handler. See ble6_handler_t object definition for detailed explanation. |
void ble6_set_response_handler | ( | void(*)(uint8_t *) | handler, |
ble6_hdl_t | driver_hdl ) |
Set response handlers function.
The function set response handler.
[in] | handler | : Pointer of response handler. |
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.
[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. |