bluetooth_2 2.0.0.0
bluetooth2.h File Reference

This file contains API for Bluetooth 2 Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  bluetooth2_s
 Bluetooth 2 Click context object. More...
 
struct  bluetooth2_cfg_t
 Bluetooth 2 Click configuration object. More...
 

Macros

#define BLUETOOTH2_ESCAPE_SEQUENCE   "+++"
 Bluetooth 2 list of AT commands.
 
#define BLUETOOTH2_FACTORY_RESET   "SET RESET"
 
#define BLUETOOTH2_LIST_PAIRINGS   "SET BT PAIR"
 
#define BLUETOOTH2_REMOVE_PAIRINGS   "SET BT PAIR *"
 
#define BLUETOOTH2_SW_RESET   "RESET"
 
#define BLUETOOTH2_SET_DEVICE_NAME   "SET BT NAME "
 
#define BLUETOOTH2_FIND_OTHER_DEVICES   "INQUIRY "
 
#define BLUETOOTH2_PAIR   "PAIR "
 
#define BLUETOOTH2_SET_CONTROL_CONFIG   "SET CONTROL CONFIG "
 
#define BLUETOOTH2_ENABLE_OK_WITH_DEFAULT_VALUES   "0040 1100"
 
#define BLUETOOTH2_DEV_ADDRESS_FORMAT   "xx:xx:xx:xx:xx:xx"
 
#define DRV_BUFFER_SIZE   200
 Bluetooth 2 driver buffer size.
 
#define BLUETOOTH2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef struct bluetooth2_s bluetooth2_t
 Bluetooth 2 Click context object.
 

Enumerations

enum  bluetooth2_return_value_t { BLUETOOTH2_OK = 0 , BLUETOOTH2_ERROR = -1 }
 Bluetooth 2 Click return value data. More...
 

Functions

void bluetooth2_cfg_setup (bluetooth2_cfg_t *cfg)
 Bluetooth 2 configuration object setup function.
 
err_t bluetooth2_init (bluetooth2_t *ctx, bluetooth2_cfg_t *cfg)
 Bluetooth 2 initialization function.
 
void bluetooth2_default_cfg (bluetooth2_t *ctx)
 Bluetooth 2 default configuration function.
 
err_t bluetooth2_generic_write (bluetooth2_t *ctx, char *data_buf, uint16_t len)
 Bluetooth 2 data writing function.
 
err_t bluetooth2_generic_read (bluetooth2_t *ctx, char *data_buf, uint16_t max_len)
 Bluetooth 2 data reading function.
 
err_t bluetooth2_read_an_pin_value (bluetooth2_t *ctx, uint16_t *data_out)
 Bluetooth 2 read AN pin value function.
 
err_t bluetooth2_read_an_pin_voltage (bluetooth2_t *ctx, float *data_out)
 Bluetooth 2 read AN pin voltage level function.
 
void bluetooth2_set_cts_pin (bluetooth2_t *ctx, uint8_t state)
 Bluetooth 2 set clear to send pin function.
 
void bluetooth2_set_rst_pin (bluetooth2_t *ctx, uint8_t state)
 Bluetooth 2 set reset pin function.
 
void bluetooth2_set_io7_pin (bluetooth2_t *ctx, uint8_t state)
 Bluetooth 2 set PIO7 pin function.
 
uint8_t bluetooth2_get_rts_pin (bluetooth2_t *ctx)
 Bluetooth 2 get request to send pin function.
 
err_t bluetooth2_write_command (bluetooth2_t *ctx, char *data_buf)
 Bluetooth 2 write command function.
 
void bluetooth2_hw_reset (bluetooth2_t *ctx)
 Bluetooth 2 hw reset function.
 
err_t bluetooth2_toggle_mode (bluetooth2_t *ctx)
 Bluetooth 2 toggle mode function.
 
err_t bluetooth2_factory_reset (bluetooth2_t *ctx)
 Bluetooth 2 factory reset function.
 
err_t bluetooth2_sw_reset (bluetooth2_t *ctx)
 Bluetooth 2 sw reset function.
 
err_t bluetooth2_remove_pairings (bluetooth2_t *ctx)
 Bluetooth 2 remove pairings function.
 
err_t bluetooth2_list_pairings (bluetooth2_t *ctx)
 Bluetooth 2 list current pairings function.
 
err_t bluetooth2_set_device_name (bluetooth2_t *ctx, char *dev_name)
 Bluetooth 2 set local device name function.
 
err_t bluetooth2_find_other_devices (bluetooth2_t *ctx, uint8_t timeout)
 Bluetooth 2 find other devices function.
 
err_t bluetooth2_pair (bluetooth2_t *ctx, uint8_t *dev_addr)
 Bluetooth 2 set local device name function.
 
err_t bluetooth2_enable_ok_response (bluetooth2_t *ctx)
 Bluetooth 2 enable OK response function.
 

Detailed Description

This file contains API for Bluetooth 2 Click Driver.

Typedef Documentation

◆ bluetooth2_t

typedef struct bluetooth2_s bluetooth2_t

Bluetooth 2 Click context object.

Context object definition of Bluetooth 2 Click driver.

Enumeration Type Documentation

◆ bluetooth2_return_value_t

Bluetooth 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
BLUETOOTH2_OK 
BLUETOOTH2_ERROR