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 AIWB212F_CMD_AT "AT"
74#define AIWB212F_CMD_AT_HELP "AT+HELP"
75#define AIWB212F_CMD_AT_SW_RESET "AT+RST"
76#define AIWB212F_CMD_AT_GMR "AT+GMR"
77#define AIWB212F_CMD_AT_SLEEP "AT+SLEEP"
78#define AIWB212F_CMD_AT_SYSIOMAP "AT+SYSIOMAP"
79#define AIWB212F_CMD_AT_SYSGPIOWRITE "AT+SYSGPIOWRITE"
80#define AIWB212F_CMD_AT_SYSGPIOREAD "AT+SYSGPIOREAD"
81#define AIWB212F_CMD_AT_PWMCFG "AT+PWMCFG"
82#define AIWB212F_CMD_AT_PWMCFGS "AT+PWMCFGS"
83#define AIWB212F_CMD_AT_PWMSTOP "AT+PWMSTOP"
84#define AIWB212F_CMD_AT_PWMDUTYSET "AT+PWMDUTYSET"
85#define AIWB212F_CMD_AT_PWMDUTYSETS "AT+PWMDUTYSETS"
86#define AIWB212F_CMD_AT_WMODE "AT+WMODE"
87#define AIWB212F_CMD_AT_WSCAN "AT+WSCAN"
88#define AIWB212F_CMD_AT_WSDHCP "AT+WSDHCP"
89#define AIWB212F_CMD_AT_WJAP "AT+WJAP"
90#define AIWB212F_CMD_AT_WAUTOCONN "AT+WAUTOCONN"
91#define AIWB212F_CMD_AT_WAPDHCP "AT+WAPDHCP"
92#define AIWB212F_CMD_AT_WAP "AT+WAP"
93#define AIWB212F_CMD_AT_PING "AT+PING"
94#define AIWB212F_CMD_AT_CIPSTAMAC_DEF "AT+CIPSTAMAC_DEF"
95#define AIWB212F_CMD_AT_WCOUNTRY "AT+WCOUNTRY"
96#define AIWB212F_CMD_AT_WCONFIG "AT+WCONFIG"
97#define AIWB212F_CMD_AT_SOCKET "AT+SOCKET"
98#define AIWB212F_CMD_AT_SOCKETSEND "AT+SOCKETSEND"
99#define AIWB212F_CMD_AT_SOCKETSENDLINE "AT+SOCKETSENDLINE"
100#define AIWB212F_CMD_AT_SOCKETREAD "AT+SOCKETREAD"
101#define AIWB212F_CMD_AT_SOCKETDEL "AT+SOCKETDEL"
102#define AIWB212F_CMD_AT_SOCKETRECVCFG "AT+SOCKETRECVCFG"
103#define AIWB212F_CMD_AT_SOCKETTT "AT+SOCKETTT"
104#define AIWB212F_CMD_AT_MQTT "AT+MQTT"
105#define AIWB212F_CMD_AT_MQTTPUB "AT+MQTTPUB"
106#define AIWB212F_CMD_AT_MQTTPUBRAW "AT+MQTTPUBRAW"
107#define AIWB212F_CMD_AT_MQTTSUB "AT+MQTTSUB"
108#define AIWB212F_CMD_AT_BLEMAC "AT+BLEMAC"
109#define AIWB212F_CMD_AT_BLEMODE "AT+BLEMODE"
110#define AIWB212F_CMD_AT_BLERFPWR "AT+BLERFPWR"
111#define AIWB212F_CMD_AT_BLENAME "AT+BLENAME"
117#define AIWB212F_RSP_OK "OK"
118#define AIWB212F_RSP_ERROR "ERROR"
119#define AIWB212F_RSP_READY "ready"
126#define AIWB212F_TX_DRV_BUFFER_SIZE 100
127#define AIWB212F_RX_DRV_BUFFER_SIZE 300
145#define AIWB212F_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
147 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
148 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST )
aiwb212f_return_value_t
Ai-WB2-12F Click return value data.
Definition aiwb212f.h:198
@ AIWB212F_ERROR_CMD
Definition aiwb212f.h:202
@ AIWB212F_ERROR_TIMEOUT
Definition aiwb212f.h:201
@ AIWB212F_ERROR_UNKNOWN
Definition aiwb212f.h:203
@ AIWB212F_OK
Definition aiwb212f.h:199
@ AIWB212F_ERROR
Definition aiwb212f.h:200
#define AIWB212F_RX_DRV_BUFFER_SIZE
Definition aiwb212f.h:127
#define AIWB212F_TX_DRV_BUFFER_SIZE
Ai-WB2-12F driver buffer size.
Definition aiwb212f.h:126
void aiwb212f_send_cmd(aiwb212f_t *ctx, uint8_t *at_cmd_buf)
Ai-WB2-12F send command function.
void aiwb212f_send_cmd_with_par(aiwb212f_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Ai-WB2-12F send command with parameter function.
void aiwb212f_hw_reset(aiwb212f_t *ctx)
Ai-WB2-12F hardware reset function.
void aiwb212f_cfg_setup(aiwb212f_cfg_t *cfg)
Ai-WB2-12F configuration object setup function.
err_t aiwb212f_generic_write(aiwb212f_t *ctx, uint8_t *data_in, uint16_t len)
Ai-WB2-12F data writing function.
err_t aiwb212f_generic_read(aiwb212f_t *ctx, uint8_t *data_out, uint16_t len)
Ai-WB2-12F data reading function.
void aiwb212f_send_cmd_check(aiwb212f_t *ctx, uint8_t *at_cmd_buf)
Ai-WB2-12F send command check function.
void aiwb212f_set_gpio(aiwb212f_t *ctx, uint8_t *pin, uint8_t *state)
Ai-WB2-12F set gpio pin state function.
err_t aiwb212f_default_cfg(aiwb212f_t *ctx)
Ai-WB2-12F default configuration function.
err_t aiwb212f_init(aiwb212f_t *ctx, aiwb212f_cfg_t *cfg)
Ai-WB2-12F initialization function.
Ai-WB2-12F Click configuration object.
Definition aiwb212f.h:176
uint32_t baud_rate
Definition aiwb212f.h:185
bool uart_blocking
Definition aiwb212f.h:186
uart_data_bits_t data_bit
Definition aiwb212f.h:187
pin_name_t tx_pin
Definition aiwb212f.h:179
pin_name_t rx_pin
Definition aiwb212f.h:178
uart_stop_bits_t stop_bit
Definition aiwb212f.h:189
pin_name_t en
Definition aiwb212f.h:182
uart_parity_t parity_bit
Definition aiwb212f.h:188
Ai-WB2-12F Click context object.
Definition aiwb212f.h:158
uart_t uart
Definition aiwb212f.h:163
digital_out_t en
Definition aiwb212f.h:160