annab412 2.1.0.0
annab412.h File Reference

This file contains API for ANNA-B412 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  annab412_t
 ANNA-B412 Click context object. More...
 
struct  annab412_cfg_t
 ANNA-B412 Click configuration object. More...
 

Macros

#define ANNAB412_CMD_AT   "AT"
 ANNA-B412 control commands.
 
#define ANNAB412_CMD_ECHO_OFF   "ATE0"
 
#define ANNAB412_CMD_ECHO_ON   "ATE1"
 
#define ANNAB412_CMD_DEV_NAME   "AT+UBTLN"
 
#define ANNAB412_CMD_CONN_MODE   "AT+UBTCM"
 
#define ANNAB412_CMD_DISCOVER_MODE   "AT+UBTDM"
 
#define ANNAB412_CMD_ENTER_MODE   "ATO"
 
#define ANNAB412_DELIMITER_TERMINATION   13
 ANNA-B412 delimiters ascii codes data.
 
#define ANNAB412_DELIMITER_END_CMD   0
 
#define ANNAB412_DELIMITER_QUOTATION   0x22
 
#define ANNAB412_DELIMITER_EQUAL   0x3D
 
#define ANNAB412_ASCII_CHAR_0   48
 
#define ANNAB412_DEV_NAME_MIN   1
 ANNA-B412 device name length limits.
 
#define ANNAB412_DEV_NAME_MAX   38
 
#define ANNAB412_CONNECTABLE_MODE_OFF   1
 ANNA-B412 connectability mode selection data.
 
#define ANNAB412_CONNECTABLE_MODE_ON   2
 
#define ANNAB412_DISCOVERABLE_MODE_OFF   1
 ANNA-B412 discoverability mode selection data.
 
#define ANNAB412_DISCOVERABLE_MODE_LIM   2
 
#define ANNAB412_DISCOVERABLE_MODE_ON   3
 
#define ANNAB412_ENTER_MODE_COMMAND   0
 ANNA-B412 enter mode selection data.
 
#define ANNAB412_ENTER_MODE_DATA   1
 
#define ANNAB412_ENTER_MODE_EXT_DATA   2
 
#define ANNAB412_ENTER_MODE_PPP   3
 
#define ANNAB412_PIN_STATE_LOW   0
 ANNA-B412 I/O logic pin state.
 
#define ANNAB412_PIN_STATE_HIGH   1
 
#define ANNAB412_TX_DRV_BUFFER_SIZE   100
 ANNA-B412 driver buffer size.
 
#define ANNAB412_RX_DRV_BUFFER_SIZE   300
 
#define ANNAB412_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  annab412_return_value_t { ANNAB412_OK = 0 , ANNAB412_ERROR = -1 }
 ANNA-B412 Click return value data. More...
 

Functions

void annab412_cfg_setup (annab412_cfg_t *cfg)
 ANNA-B412 configuration object setup function.
 
err_t annab412_init (annab412_t *ctx, annab412_cfg_t *cfg)
 ANNA-B412 initialization function.
 
err_t annab412_default_cfg (annab412_t *ctx)
 ANNA-B412 default configuration function.
 
err_t annab412_generic_write (annab412_t *ctx, uint8_t *data_in, uint16_t len)
 ANNA-B412 data writing function.
 
err_t annab412_generic_read (annab412_t *ctx, uint8_t *data_out, uint16_t len)
 ANNA-B412 data reading function.
 
void annab412_set_rst_pin (annab412_t *ctx, uint8_t state)
 ANNA-B412 set reset pin function.
 
void annab412_set_dsr_pin (annab412_t *ctx, uint8_t state)
 ANNA-B412 set data set ready pin function.
 
void annab412_set_cts_pin (annab412_t *ctx, uint8_t state)
 ANNA-B412 set clear to send pin function.
 
uint8_t annab412_get_dtr_pin (annab412_t *ctx)
 ANNA-B412 get data terminal ready pin function.
 
uint8_t annab412_get_rts_pin (annab412_t *ctx)
 ANNA-B412 get request to send pin function.
 
void annab412_hw_reset (annab412_t *ctx)
 ANNA-B412 hw reset function.
 
err_t annab412_send_command (annab412_t *ctx, char *command)
 ANNA-B412 send command function.
 
err_t annab412_set_cmd_echo_on (annab412_t *ctx)
 ANNA-B412 set command echo on function.
 
err_t annab412_set_cmd_echo_off (annab412_t *ctx)
 ANNA-B412 set command echo on function.
 
err_t annab412_set_cmd_device_name (annab412_t *ctx, char *device_name)
 ANNA-B412 set device name function.
 
err_t annab412_set_cmd_conn_mode (annab412_t *ctx, uint8_t mode)
 ANNA-B412 set connectability mode function.
 
err_t annab412_set_cmd_discover_mode (annab412_t *ctx, uint8_t mode)
 ANNA-B412 set discoverability mode function.
 
err_t annab412_set_cmd_enter_mode (annab412_t *ctx, uint8_t mode)
 ANNA-B412 set enter mode function.
 

Detailed Description

This file contains API for ANNA-B412 Click Driver.

Enumeration Type Documentation

◆ annab412_return_value_t

ANNA-B412 Click return value data.

Predefined enum values for driver return values.

Enumerator
ANNAB412_OK 
ANNAB412_ERROR