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 ANYNET2G_CMD_AT "AT"
74#define ANYNET2G_CMD_QCCID "AT+QCCID"
75#define ANYNET2G_CMD_GSN "AT+GSN"
76#define ANYNET2G_CMD_AWSVER "AT+AWSVER"
77#define ANYNET2G_CMD_AWSRESET "AT+AWSRESET"
78#define ANYNET2G_CMD_AWSSTATE "AT+AWSSTATE"
79#define ANYNET2G_CMD_AWSBUTTON "AT+AWSBUTTON"
80#define ANYNET2G_CMD_AWSPUBOPEN "AT+AWSPUBOPEN"
81#define ANYNET2G_CMD_AWSPUBLISH "AT+AWSPUBLISH"
82#define ANYNET2G_CMD_AWSSUBOPEN "AT+AWSSUBOPEN"
83#define ANYNET2G_CMD_AWSPUBCLOSE "AT+AWSPUBCLOSE"
89#define ANYNET2G_RSP_OK "OK"
90#define ANYNET2G_RSP_ERROR "ERROR"
91#define ANYNET2G_RSP_READY_FOR_SEND ">"
92#define ANYNET2G_RSP_SEND_OK "SEND OK"
93#define ANYNET2G_RSP_SEND_FAIL "SEND FAIL"
100#define ANYNET2G_RX_DRV_BUFFER_SIZE 256
101#define ANYNET2G_TX_DRV_BUFFER_SIZE 256
119#define ANYNET2G_MAP_MIKROBUS( cfg, mikrobus ) \
120 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
121 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
122 cfg.slp = MIKROBUS( mikrobus, MIKROBUS_RST ); \
123 cfg.dsr = MIKROBUS( mikrobus, MIKROBUS_CS ); \
124 cfg.dtr = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
125 cfg.iot = MIKROBUS( mikrobus, MIKROBUS_INT )
anynet2g_return_value_t
AnyNet 2G Click return value data.
Definition anynet2g.h:183
@ ANYNET2G_ERROR
Definition anynet2g.h:185
@ ANYNET2G_ERROR_SEND
Definition anynet2g.h:188
@ ANYNET2G_ERROR_UNKNOWN
Definition anynet2g.h:189
@ ANYNET2G_ERROR_CMD
Definition anynet2g.h:187
@ ANYNET2G_OK
Definition anynet2g.h:184
@ ANYNET2G_ERROR_TIMEOUT
Definition anynet2g.h:186
#define ANYNET2G_TX_DRV_BUFFER_SIZE
Definition anynet2g.h:101
#define ANYNET2G_RX_DRV_BUFFER_SIZE
AnyNet 2G driver buffer size.
Definition anynet2g.h:100
void anynet2g_send_cmd_with_par(anynet2g_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
void anynet2g_cfg_setup(anynet2g_cfg_t *cfg)
AnyNet 2G configuration object setup function.
void anynet2g_send_cmd_par_check(anynet2g_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
err_t anynet2g_generic_write(anynet2g_t *ctx, uint8_t *data_in, uint16_t len)
AnyNet 2G data writing function.
err_t anynet2g_generic_read(anynet2g_t *ctx, uint8_t *data_out, uint16_t len)
AnyNet 2G data reading function.
void anynet2g_set_slp_pin(anynet2g_t *ctx, uint8_t state)
AnyNet 2G set slp pin function.
void anynet2g_send_cmd_check(anynet2g_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
void anynet2g_send_cmd(anynet2g_t *ctx, uint8_t *cmd)
Send command function.
void anynet2g_set_iot_pin(anynet2g_t *ctx, uint8_t state)
AnyNet 2G set iot pin function.
err_t anynet2g_init(anynet2g_t *ctx, anynet2g_cfg_t *cfg)
AnyNet 2G initialization function.
void anynet2g_set_dtr_pin(anynet2g_t *ctx, uint8_t state)
AnyNet 2G set dtr pin function.
uint8_t anynet2g_get_dsr_pin(anynet2g_t *ctx)
AnyNet 2G get dsr pin function.
AnyNet 2G Click configuration object.
Definition anynet2g.h:158
pin_name_t dtr
Definition anynet2g.h:165
uint32_t baud_rate
Definition anynet2g.h:170
pin_name_t iot
Definition anynet2g.h:166
pin_name_t slp
Definition anynet2g.h:164
bool uart_blocking
Definition anynet2g.h:171
uart_data_bits_t data_bit
Definition anynet2g.h:172
pin_name_t tx_pin
Definition anynet2g.h:161
pin_name_t rx_pin
Definition anynet2g.h:160
uart_stop_bits_t stop_bit
Definition anynet2g.h:174
pin_name_t dsr
Definition anynet2g.h:167
uart_parity_t parity_bit
Definition anynet2g.h:173
AnyNet 2G Click context object.
Definition anynet2g.h:135
digital_out_t slp
Definition anynet2g.h:137
uart_t uart
Definition anynet2g.h:145
digital_out_t iot
Definition anynet2g.h:139
digital_out_t dtr
Definition anynet2g.h:138
digital_in_t dsr
Definition anynet2g.h:142