42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define BLE8_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.dtr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.dsr = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define BLE8_RETVAL uint8_t
83#define BLE8_INIT_ERROR 0xFF
90#define BLE8_END_BUFF 0
97#define BLE8_RSP_READY 1
98#define BLE8_RSP_NOT_READY 0
105#define BLE8_ECHO_ON 1
106#define BLE8_ECHO_OFF 0
113#define BLE8_COMMAND_MODE 0
114#define BLE8_DATA_MODE 1
115#define BLE8_EXT_DATA_MODE 2
116#define BLE8_PPP_MODE 3
123#define BLE8_DISABLED_ROLE 0
124#define BLE8_CENTRAL_ROLE 1
125#define BLE8_PERIPHERAL_ROLE 2
126#define BLE8_SIMULTANEOUS_ROLE 3
133#define BLE8_SEC_DISABLED 1
134#define BLE8_SEC_JUST_WORKS 2
135#define BLE8_SEC_DISPLAY_ONLY 3
136#define BLE8_SEC_DISPLAY_YES_NO 4
137#define BLE8_SEC_KEYBOARD_ONLY 5
138#define BLE8_SEC_OUT_OF_BAND 6
145#define BLE8_GAP_NON_PAIRING_MODE 1
146#define BLE8_GAP_PAIRING_MODE 2
153#define BLE8_GAP_NON_CONNECTABLE_MODE 1
154#define BLE8_GAP_CONNECTABLE_MODE 2
161#define BLE8_GAP_NON_DISCOVERABLE_MODE 1
162#define BLE8_GAP_LIMITED_DISCOVERABLE_MODE 2
163#define BLE8_GAP_GENERAL_DISCOVERABLE_MODE 3
170#define DRV_RX_BUFFER_SIZE 100
171#define DRV_TX_BUFFER_SIZE 100
#define DRV_RX_BUFFER_SIZE
Definition ble8.h:170
#define DRV_TX_BUFFER_SIZE
Definition ble8.h:171
#define BLE8_RETVAL
Definition ble8.h:80
void ble8_set_echo_cmd(ble8_t *ctx, uint8_t echo_en)
Echo On/Off command.
void ble8_reset(ble8_t *ctx)
Reset function.
void ble8_set_local_name_cmd(ble8_t *ctx, char *local_name)
Local Name Setting command.
void ble8_set_low_energy_role_cmd(ble8_t *ctx, uint8_t le_role)
Bluetooth Low Energy Role Setting command.
int32_t ble8_generic_read(ble8_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void ble8_set_cts_pin(ble8_t *ctx, uint8_t state)
CTS Pin Setting function.
void ble8_get_start_mode_cmd(ble8_t *ctx)
Get Module Start Mode command.
BLE8_RETVAL ble8_init(ble8_t *ctx, ble8_cfg_t *cfg)
Initialization function.
uint8_t ble8_get_dtr_pin(ble8_t *ctx)
Check DTR Pin function.
void ble8_store_cnfg_cmd(ble8_t *ctx)
Store Current Configuration command.
uint8_t ble8_sps_central_pairing(ble8_t *ctx, uint8_t *local_addr)
SPS Pairing As Central Device command.
void ble8_fact_rst_cmd(ble8_t *ctx)
Factory Reset command.
void ble8_sps_peripheral_pairing(ble8_t *ctx)
SPS Pairing As Peripheral Device command.
void ble8_enter_mode_cmd(ble8_t *ctx, uint8_t mode)
Enter Data Mode command.
void ble8_get_info(ble8_t *ctx)
Get Info command.
void ble8_set_default_cmd(ble8_t *ctx)
Default Configuration command.
void ble8_get_low_energy_role_cmd(ble8_t *ctx)
Get Bluetooth Low Energy Role command.
void ble8_check_connectability_cmd(ble8_t *ctx)
Get Connectability Mode command.
void ble8_get_local_addr_cmd(ble8_t *ctx)
Get Local Address command.
void ble8_discoverability_en_cmd(ble8_t *ctx, uint8_t discover_mode)
Discoverability Mode Setting command.
void ble8_set_dsr_pin(ble8_t *ctx, uint8_t state)
Set DSR Pin function.
void ble8_get_sec_mode_cmd(ble8_t *ctx)
Get Security Mode command.
void ble8_check_discoverability_cmd(ble8_t *ctx)
Get Discoverability Mode command.
void ble8_connectability_en_cmd(ble8_t *ctx, uint8_t conn_mode)
Connectability Mode Setting command.
void ble8_set_start_mode_cmd(ble8_t *ctx, uint8_t start_mode)
Module Start Mode Setting command.
void ble8_check_pairing_cmd(ble8_t *ctx)
Get Pairing Mode command.
uint8_t ble8_response_ready(ble8_t *ctx)
Response Ready function.
void ble8_get_server_cnfg_cmd(ble8_t *ctx)
Get Server Configuration command.
void ble8_set_sec_mode_cmd(ble8_t *ctx, uint8_t sec_mode)
Security Mode Setting command.
void ble8_pairing_en_cmd(ble8_t *ctx, uint8_t pairing_mode)
Pairing Mode Setting command.
void ble8_cfg_setup(ble8_cfg_t *cfg)
Config Object Initialization function.
void ble8_get_echo_cmd(ble8_t *ctx)
Get Echo Setting command.
void ble8_get_list_peers_cmd(ble8_t *ctx)
Get Peer List command.
void ble8_generic_write(ble8_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void ble8_send_command(ble8_t *ctx, char *command, uint8_t term_char)
Transmit function.
uint8_t ble8_get_rts_pin(ble8_t *ctx)
Check RTS Pin function.
void ble8_get_local_name_cmd(ble8_t *ctx)
Get Local Name command.
Click configuration structure definition.
Definition ble8.h:213
pin_name_t dtr
Definition ble8.h:221
pin_name_t rts
Definition ble8.h:225
uint32_t baud_rate
Definition ble8.h:229
pin_name_t cts
Definition ble8.h:223
bool uart_blocking
Definition ble8.h:230
uart_data_bits_t data_bit
Definition ble8.h:231
pin_name_t tx_pin
Definition ble8.h:217
pin_name_t rx_pin
Definition ble8.h:216
uart_stop_bits_t stop_bit
Definition ble8.h:233
pin_name_t dsr
Definition ble8.h:224
uart_parity_t parity_bit
Definition ble8.h:232
pin_name_t rst
Definition ble8.h:222
Click ctx object definition.
Definition ble8.h:185
digital_out_t dsr
Definition ble8.h:190
uint8_t termination_char
Definition ble8.h:205
uart_t uart
Definition ble8.h:199
uint8_t rsp_rdy
Definition ble8.h:204
digital_in_t rts
Definition ble8.h:195
digital_out_t rst
Definition ble8.h:188
digital_out_t cts
Definition ble8.h:189
digital_in_t dtr
Definition ble8.h:194