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 ANYNET3GEA_CMD_AT "AT"
74#define ANYNET3GEA_CMD_QCCID "AT+QCCID"
75#define ANYNET3GEA_CMD_GSN "AT+GSN"
76#define ANYNET3GEA_CMD_AWSVER "AT+AWSVER"
77#define ANYNET3GEA_CMD_AWSRESET "AT+AWSRESET"
78#define ANYNET3GEA_CMD_AWSSTATE "AT+AWSSTATE"
79#define ANYNET3GEA_CMD_AWSBUTTON "AT+AWSBUTTON"
80#define ANYNET3GEA_CMD_AWSPUBOPEN "AT+AWSPUBOPEN"
81#define ANYNET3GEA_CMD_AWSPUBLISH "AT+AWSPUBLISH"
82#define ANYNET3GEA_CMD_AWSSUBOPEN "AT+AWSSUBOPEN"
83#define ANYNET3GEA_CMD_AWSPUBCLOSE "AT+AWSPUBCLOSE"
89#define ANYNET3GEA_RSP_OK "OK"
90#define ANYNET3GEA_RSP_ERROR "ERROR"
91#define ANYNET3GEA_RSP_READY_FOR_SEND ">"
92#define ANYNET3GEA_RSP_SEND_OK "SEND OK"
93#define ANYNET3GEA_RSP_SEND_FAIL "SEND FAIL"
100#define ANYNET3GEA_RX_DRV_BUFFER_SIZE 256
101#define ANYNET3GEA_TX_DRV_BUFFER_SIZE 256
119#define ANYNET3GEA_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 )
anynet3gea_return_value_t
AnyNet 3G-EA Click return value data.
Definition anynet3gea.h:183
@ ANYNET3GEA_OK
Definition anynet3gea.h:184
@ ANYNET3GEA_ERROR_TIMEOUT
Definition anynet3gea.h:186
@ ANYNET3GEA_ERROR_UNKNOWN
Definition anynet3gea.h:189
@ ANYNET3GEA_ERROR
Definition anynet3gea.h:185
@ ANYNET3GEA_ERROR_SEND
Definition anynet3gea.h:188
@ ANYNET3GEA_ERROR_CMD
Definition anynet3gea.h:187
#define ANYNET3GEA_TX_DRV_BUFFER_SIZE
Definition anynet3gea.h:101
#define ANYNET3GEA_RX_DRV_BUFFER_SIZE
AnyNet 3G-EA driver buffer size.
Definition anynet3gea.h:100
void anynet3gea_set_dtr_pin(anynet3gea_t *ctx, uint8_t state)
AnyNet 3G-EA set dtr pin function.
err_t anynet3gea_init(anynet3gea_t *ctx, anynet3gea_cfg_t *cfg)
AnyNet 3G-EA initialization function.
void anynet3gea_send_cmd_check(anynet3gea_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
void anynet3gea_set_slp_pin(anynet3gea_t *ctx, uint8_t state)
AnyNet 3G-EA set slp pin function.
void anynet3gea_send_cmd(anynet3gea_t *ctx, uint8_t *cmd)
Send command function.
void anynet3gea_send_cmd_with_par(anynet3gea_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
uint8_t anynet3gea_get_dsr_pin(anynet3gea_t *ctx)
AnyNet 3G-EA get dsr pin function.
err_t anynet3gea_generic_write(anynet3gea_t *ctx, uint8_t *data_in, uint16_t len)
AnyNet 3G-EA data writing function.
err_t anynet3gea_generic_read(anynet3gea_t *ctx, uint8_t *data_out, uint16_t len)
AnyNet 3G-EA data reading function.
void anynet3gea_cfg_setup(anynet3gea_cfg_t *cfg)
AnyNet 3G-EA configuration object setup function.
void anynet3gea_set_iot_pin(anynet3gea_t *ctx, uint8_t state)
AnyNet 3G-EA set iot pin function.
void anynet3gea_send_cmd_par_check(anynet3gea_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
AnyNet 3G-EA Click configuration object.
Definition anynet3gea.h:158
pin_name_t dtr
Definition anynet3gea.h:165
uint32_t baud_rate
Definition anynet3gea.h:170
pin_name_t iot
Definition anynet3gea.h:166
pin_name_t slp
Definition anynet3gea.h:164
bool uart_blocking
Definition anynet3gea.h:171
uart_data_bits_t data_bit
Definition anynet3gea.h:172
pin_name_t tx_pin
Definition anynet3gea.h:161
pin_name_t rx_pin
Definition anynet3gea.h:160
uart_stop_bits_t stop_bit
Definition anynet3gea.h:174
pin_name_t dsr
Definition anynet3gea.h:167
uart_parity_t parity_bit
Definition anynet3gea.h:173
AnyNet 3G-EA Click context object.
Definition anynet3gea.h:135
digital_out_t slp
Definition anynet3gea.h:137
uart_t uart
Definition anynet3gea.h:145
digital_out_t iot
Definition anynet3gea.h:139
digital_out_t dtr
Definition anynet3gea.h:138
digital_in_t dsr
Definition anynet3gea.h:142