ble12 2.0.0.0
ble12.h File Reference

This file contains API for BLE 12 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  ble12_t
 BLE 12 Click context object. More...
 
struct  ble12_cfg_t
 BLE 12 Click configuration object. More...
 

Macros

#define BLE12_CMD_AT   "AT"
 BLE 12 control commands.
 
#define BLE12_CMD_SW_RESET   "AT+RESET"
 
#define BLE12_CMD_GET_VERSION   "AT+VERSION?"
 
#define BLE12_CMD_GET_RSSI   "AT+RSSI?"
 
#define BLE12_CMD_SET_ADINTERVAL   "AT+ADINTERVAL="
 
#define BLE12_CMD_GET_ADINTERVAL   "AT+ADINTERVAL=?"
 
#define BLE12_CMD_SET_ADSTART   "AT+ADSTART="
 
#define BLE12_CMD_GET_ADSTART   "AT+ADSTART?"
 
#define BLE12_CMD_SET_ADVMANU   "AT+ADVMANU="
 
#define BLE12_CMD_GET_ADVMANU   "AT+ADVMANU?"
 
#define BLE12_CMD_SET_ADVRESP   "AT+ADVRESP="
 
#define BLE12_CMD_GET_ADVRESP   "AT+ADVRESP?"
 
#define BLE12_CMD_SET_SCANNER   "AT+SCANNER="
 
#define BLE12_CMD_GET_SCANNER   "AT+SCANNER?"
 
#define BLE12_CMD_SET_AUTOCON   "AT+AUTOCON="
 
#define BLE12_CMD_GET_AUTOCON   "AT+AUTOCON?"
 
#define BLE12_CMD_SET_DISCON   "AT+DISCON=1"
 
#define BLE12_CMD_SET_FILTERA   "AT+FILTERA="
 
#define BLE12_CMD_GET_FILTERA   "AT+FILTERA?"
 
#define BLE12_CMD_SET_FILTERR   "AT+FILTERR="
 
#define BLE12_CMD_GET_FILTERR   "AT+FILTERR?"
 
#define BLE12_CMD_SET_MANUAID   "AT+MANUAID="
 
#define BLE12_CMD_GET_MANUAID   "AT+MANUAID?"
 
#define BLE12_CMD_SET_MANURID   "AT+MANURID="
 
#define BLE12_CMD_GET_MANURID   "AT+MANURID?"
 
#define BLE12_CMD_SET_DCDC   "AT+DCDC="
 
#define BLE12_CMD_GET_DCDC   "AT+DCDC?"
 
#define BLE12_CMD_SET_SAVE   "AT+SAVE=1"
 
#define BLE12_CMD_SET_STOP   "AT+STOP="
 
#define BLE12_CMD_SET_NAME   "AT+NAME="
 
#define BLE12_CMD_GET_UART   "AT+UART?"
 
#define BLE12_CMD_SET_UART   "AT+UART="
 
#define BLE12_CMD_GET_ADDR   "AT+ADDR?"
 
#define BLE12_CMD_GET_RX   "AT+RX?"
 
#define BLE12_CMD_SET_DEFAULT   "AT+DEFAULT"
 
#define BLE12_CMD_GET_RFPW   "AT+RFPW?"
 
#define BLE12_CMD_SET_RFPW   "AT+RFPW="
 
#define BLE12_CMD_SET_GPIO   "AT+PIO="
 
#define BLE12_CMD_GET_GPIO   "AT+PIO?"
 
#define BLE12_CMD_SET_GPIO_IO   "AT+PIS="
 
#define BLE12_CMD_INIT_LED1   "AT+PIS=017,1"
 
#define BLE12_CMD_INIT_LED2   "AT+PIS=019,1"
 
#define BLE12_EVT_CONNECTED   "CONNECTED"
 BLE 12 respond event.
 
#define BLE12_EVT_DISCONNECTED   "DISCONNECTED"
 
#define BLE12_EVT_SCAN_TIMEOUT   "SCAN TIMEOUT"
 
#define BLE12_LED_YELLOW   0x00
 BLE 12 control led.
 
#define BLE12_LED_RED   0x01
 
#define BLE12_LED_ON   0x00
 
#define BLE12_LED_OFF   0x01
 
#define BLE12_OP_MODE_CMD   0x00
 
#define BLE12_OP_MODE_DATA   0x01
 
#define BLE12_SELECT_LED_YELLOW   "017,"
 
#define BLE12_SELECT_LED_RED   "019,"
 
#define BLE12_SET_LED_STATE_ON   "0"
 
#define BLE12_SET_LED_STATE_OFF   "1"
 
#define DRV_BUFFER_SIZE   200
 BLE 12 driver buffer size.
 
#define BLE12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ble12_return_value_t { BLE12_OK = 0 , BLE12_ERROR = -1 }
 BLE 12 Click return value data. More...
 

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

This file contains API for BLE 12 Click Driver.

Enumeration Type Documentation

◆ ble12_return_value_t

BLE 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
BLE12_OK 
BLE12_ERROR