ble4 2.0.0.0
ble4.h File Reference

This file contains API for BLE 4 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  ble4_t
 Click ctx object definition. More...
 
struct  ble4_cfg_t
 Click configuration structure definition. More...
 

Macros

#define BLE4_MAP_MIKROBUS(cfg, mikrobus)
 
#define BLE4_RETVAL   uint8_t
 
#define BLE4_OK   0x00
 
#define BLE4_INIT_ERROR   0xFF
 
#define BLE4_END_BUFF   0
 
#define BLE4_RSP_READY   1
 
#define BLE4_RSP_NOT_READY   0
 
#define BLE4_ECHO_ON   1
 
#define BLE4_ECHO_OFF   0
 
#define BLE4_COMMAND_MODE   0
 
#define BLE4_DATA_MODE   1
 
#define BLE4_EXT_DATA_MODE   2
 
#define BLE4_PPP_MODE   3
 
#define BLE4_DISABLED_ROLE   0
 
#define BLE4_CENTRAL_ROLE   1
 
#define BLE4_PERIPHERAL_ROLE   2
 
#define BLE4_SIMULTANEOUS_ROLE   3
 
#define BLE4_SEC_DISABLED   1
 
#define BLE4_SEC_JUST_WORKS   2
 
#define BLE4_SEC_DISPLAY_ONLY   3
 
#define BLE4_SEC_DISPLAY_YES_NO   4
 
#define BLE4_SEC_KEYBOARD_ONLY   5
 
#define BLE4_SEC_OUT_OF_BAND   6
 
#define BLE4_GAP_NON_PAIRING_MODE   1
 
#define BLE4_GAP_PAIRING_MODE   2
 
#define BLE4_GAP_NON_CONNECTABLE_MODE   1
 
#define BLE4_GAP_CONNECTABLE_MODE   2
 
#define BLE4_GAP_NON_DISCOVERABLE_MODE   1
 
#define BLE4_GAP_LIMITED_DISCOVERABLE_MODE   2
 
#define BLE4_GAP_GENERAL_DISCOVERABLE_MODE   3
 
#define DRV_RX_BUFFER_SIZE   100
 
#define DRV_TX_BUFFER_SIZE   100
 

Functions

void ble4_cfg_setup (ble4_cfg_t *cfg)
 Config Object Initialization function.
 
BLE4_RETVAL ble4_init (ble4_t *ctx, ble4_cfg_t *cfg)
 Initialization function.
 
void ble4_reset (ble4_t *ctx)
 Reset function.
 
void ble4_generic_write (ble4_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t ble4_generic_read (ble4_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
uint8_t ble4_response_ready (ble4_t *ctx)
 Response Ready function.
 
void ble4_send_command (ble4_t *ctx, char *command, uint8_t term_char)
 Transmit function.
 
void ble4_fact_rst_cmd (ble4_t *ctx)
 Factory Reset command.
 
void ble4_store_cnfg_cmd (ble4_t *ctx)
 Store Current Configuration command.
 
void ble4_get_local_addr_cmd (ble4_t *ctx)
 Get Local Address command.
 
void ble4_set_start_mode_cmd (ble4_t *ctx, uint8_t start_mode)
 Module Start Mode Setting command.
 
void ble4_get_start_mode_cmd (ble4_t *ctx)
 Get Module Start Mode command.
 
void ble4_enter_mode_cmd (ble4_t *ctx, uint8_t mode)
 Enter Data Mode command.
 
void ble4_set_echo_cmd (ble4_t *ctx, uint8_t echo_en)
 Echo On/Off command.
 
void ble4_get_echo_cmd (ble4_t *ctx)
 Get Echo Setting command.
 
void ble4_set_local_name_cmd (ble4_t *ctx, char *local_name)
 Local Name Setting command.
 
void ble4_get_local_name_cmd (ble4_t *ctx)
 Get Local Name command.
 
void ble4_set_low_energy_role_cmd (ble4_t *ctx, uint8_t le_role)
 Bluetooth Low Energy Role Setting command.
 
void ble4_get_low_energy_role_cmd (ble4_t *ctx)
 Get Bluetooth Low Energy Role command.
 
void ble4_get_list_peers_cmd (ble4_t *ctx)
 Get Peer List command.
 
void ble4_get_server_cnfg_cmd (ble4_t *ctx)
 Get Server Configuration command.
 
void ble4_set_default_cmd (ble4_t *ctx)
 Default Configuration command.
 
void ble4_set_sec_mode_cmd (ble4_t *ctx, uint8_t sec_mode)
 Security Mode Setting command.
 
void ble4_get_sec_mode_cmd (ble4_t *ctx)
 Get Security Mode command.
 
void ble4_pairing_en_cmd (ble4_t *ctx, uint8_t pairing_mode)
 Pairing Mode Setting command.
 
void ble4_check_pairing_cmd (ble4_t *ctx)
 Get Pairing Mode command.
 
void ble4_connectability_en_cmd (ble4_t *ctx, uint8_t conn_mode)
 Connectability Mode Setting command.
 
void ble4_check_connectability_cmd (ble4_t *ctx)
 Get Connectability Mode command.
 
void ble4_discoverability_en_cmd (ble4_t *ctx, uint8_t discover_mode)
 Discoverability Mode Setting command.
 
void ble4_check_discoverability_cmd (ble4_t *ctx)
 Get Discoverability Mode command.
 
void ble4_get_info (ble4_t *ctx)
 Get Info command.
 
uint8_t ble4_sps_central_pairing (ble4_t *ctx, uint8_t *local_addr)
 SPS Pairing As Central Device command.
 
void ble4_sps_peripheral_pairing (ble4_t *ctx)
 SPS Pairing As Peripheral Device command.
 
void ble4_set_cts_pin (ble4_t *ctx, uint8_t state)
 CTS Pin Setting function.
 
void ble4_set_dsr_pin (ble4_t *ctx, uint8_t state)
 Set DSR Pin function.
 
uint8_t ble4_get_dtr_pin (ble4_t *ctx)
 Check DTR Pin function.
 
uint8_t ble4_get_rts_pin (ble4_t *ctx)
 Check RTS Pin function.
 

Detailed Description

This file contains API for BLE 4 Click driver.