39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define ANNAB412_CMD_AT "AT"
74#define ANNAB412_CMD_ECHO_OFF "ATE0"
75#define ANNAB412_CMD_ECHO_ON "ATE1"
76#define ANNAB412_CMD_DEV_NAME "AT+UBTLN"
77#define ANNAB412_CMD_CONN_MODE "AT+UBTCM"
78#define ANNAB412_CMD_DISCOVER_MODE "AT+UBTDM"
79#define ANNAB412_CMD_ENTER_MODE "ATO"
85#define ANNAB412_DELIMITER_TERMINATION 13
86#define ANNAB412_DELIMITER_END_CMD 0
87#define ANNAB412_DELIMITER_QUOTATION 0x22
88#define ANNAB412_DELIMITER_EQUAL 0x3D
89#define ANNAB412_ASCII_CHAR_0 48
95#define ANNAB412_DEV_NAME_MIN 1
96#define ANNAB412_DEV_NAME_MAX 38
102#define ANNAB412_CONNECTABLE_MODE_OFF 1
103#define ANNAB412_CONNECTABLE_MODE_ON 2
109#define ANNAB412_DISCOVERABLE_MODE_OFF 1
110#define ANNAB412_DISCOVERABLE_MODE_LIM 2
111#define ANNAB412_DISCOVERABLE_MODE_ON 3
117#define ANNAB412_ENTER_MODE_COMMAND 0
118#define ANNAB412_ENTER_MODE_DATA 1
119#define ANNAB412_ENTER_MODE_EXT_DATA 2
120#define ANNAB412_ENTER_MODE_PPP 3
126#define ANNAB412_PIN_STATE_LOW 0
127#define ANNAB412_PIN_STATE_HIGH 1
134#define ANNAB412_TX_DRV_BUFFER_SIZE 100
135#define ANNAB412_RX_DRV_BUFFER_SIZE 300
153#define ANNAB412_MAP_MIKROBUS( cfg, mikrobus ) \
154 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
155 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
156 cfg.dtr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
157 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
158 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
159 cfg.dsr = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
160 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT );
annab412_return_value_t
ANNA-B412 Click return value data.
Definition annab412.h:220
@ ANNAB412_ERROR
Definition annab412.h:222
@ ANNAB412_OK
Definition annab412.h:221
#define ANNAB412_TX_DRV_BUFFER_SIZE
ANNA-B412 driver buffer size.
Definition annab412.h:134
#define ANNAB412_RX_DRV_BUFFER_SIZE
Definition annab412.h:135
err_t annab412_set_cmd_enter_mode(annab412_t *ctx, uint8_t mode)
ANNA-B412 set enter mode function.
void annab412_set_dsr_pin(annab412_t *ctx, uint8_t state)
ANNA-B412 set data set ready pin function.
uint8_t annab412_get_rts_pin(annab412_t *ctx)
ANNA-B412 get request to send pin function.
err_t annab412_default_cfg(annab412_t *ctx)
ANNA-B412 default configuration function.
err_t annab412_init(annab412_t *ctx, annab412_cfg_t *cfg)
ANNA-B412 initialization 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_discover_mode(annab412_t *ctx, uint8_t mode)
ANNA-B412 set discoverability mode function.
uint8_t annab412_get_dtr_pin(annab412_t *ctx)
ANNA-B412 get data terminal ready pin function.
err_t annab412_generic_read(annab412_t *ctx, uint8_t *data_out, uint16_t len)
ANNA-B412 data reading function.
err_t annab412_set_cmd_echo_off(annab412_t *ctx)
ANNA-B412 set command echo on function.
err_t annab412_set_cmd_echo_on(annab412_t *ctx)
ANNA-B412 set command echo on function.
err_t annab412_generic_write(annab412_t *ctx, uint8_t *data_in, uint16_t len)
ANNA-B412 data writing function.
void annab412_set_rst_pin(annab412_t *ctx, uint8_t state)
ANNA-B412 set reset pin function.
err_t annab412_send_command(annab412_t *ctx, char *command)
ANNA-B412 send command function.
void annab412_set_cts_pin(annab412_t *ctx, uint8_t state)
ANNA-B412 set clear to send pin function.
err_t annab412_set_cmd_conn_mode(annab412_t *ctx, uint8_t mode)
ANNA-B412 set connectability mode function.
void annab412_cfg_setup(annab412_cfg_t *cfg)
ANNA-B412 configuration object setup function.
void annab412_hw_reset(annab412_t *ctx)
ANNA-B412 hw reset function.
ANNA-B412 Click configuration object.
Definition annab412.h:194
pin_name_t dtr
Definition annab412.h:200
pin_name_t rts
Definition annab412.h:204
uint32_t baud_rate
Definition annab412.h:207
pin_name_t cts
Definition annab412.h:202
bool uart_blocking
Definition annab412.h:208
uart_data_bits_t data_bit
Definition annab412.h:209
pin_name_t tx_pin
Definition annab412.h:197
pin_name_t rx_pin
Definition annab412.h:196
uart_stop_bits_t stop_bit
Definition annab412.h:211
pin_name_t dsr
Definition annab412.h:203
uart_parity_t parity_bit
Definition annab412.h:210
pin_name_t rst
Definition annab412.h:201
ANNA-B412 Click context object.
Definition annab412.h:170
digital_out_t dsr
Definition annab412.h:174
uart_t uart
Definition annab412.h:181
digital_in_t rts
Definition annab412.h:178
digital_out_t rst
Definition annab412.h:172
digital_out_t cts
Definition annab412.h:173
digital_in_t dtr
Definition annab412.h:177