28#ifndef IOTEXPRESSLINK2_H
29#define IOTEXPRESSLINK2_H
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 IOTEXPRESSLINK2_CMD_AT "AT"
74#define IOTEXPRESSLINK2_CMD_CONNECT "AT+CONNECT"
75#define IOTEXPRESSLINK2_CMD_CONNECT_CHECK "AT+CONNECT?"
76#define IOTEXPRESSLINK2_CMD_DISCONNECT "AT+DISCONNECT"
77#define IOTEXPRESSLINK2_CMD_SLEEP "AT+SLEEP"
78#define IOTEXPRESSLINK2_CMD_CONFMODE "AT+CONFMODE"
79#define IOTEXPRESSLINK2_CMD_RESET "AT+RESET"
80#define IOTEXPRESSLINK2_CMD_FACTORY_RESET "AT+FACTORY_RESET"
81#define IOTEXPRESSLINK2_CMD_SEND "AT+SEND"
82#define IOTEXPRESSLINK2_CMD_GET "AT+GET"
83#define IOTEXPRESSLINK2_CMD_SUBSCRIBE "AT+SUBSCRIBE"
84#define IOTEXPRESSLINK2_CMD_UNSUBSCRIBE "AT+UNSUBSCRIBE"
85#define IOTEXPRESSLINK2_CMD_CONF "AT+CONF"
86#define IOTEXPRESSLINK2_CMD_CONF_CHECK "AT+CONF?"
87#define IOTEXPRESSLINK2_CMD_EVENT "AT+EVENT?"
88#define IOTEXPRESSLINK2_CMD_TIME "AT+TIME"
89#define IOTEXPRESSLINK2_CMD_WHERE "AT+WHERE"
90#define IOTEXPRESSLINK2_CMD_SEPARATOR " "
91#define IOTEXPRESSLINK2_CMD_SIGN_EQUAL "="
97#define IOTEXPRESSLINK2_CONF_KEY_ABOUT "About"
98#define IOTEXPRESSLINK2_CONF_KEY_VERSION "Version"
99#define IOTEXPRESSLINK2_CONF_KEY_TECH_SPEC "TechSpec"
100#define IOTEXPRESSLINK2_CONF_KEY_THING_NAME "ThingName"
101#define IOTEXPRESSLINK2_CONF_KEY_CERTIFICATE "Certificate"
102#define IOTEXPRESSLINK2_CONF_KEY_CERTIFICATE_PEM "Certificate pem"
103#define IOTEXPRESSLINK2_CONF_KEY_CUSTOM_NAME "CustomName"
104#define IOTEXPRESSLINK2_CONF_KEY_ENDPOINT "Endpoint"
105#define IOTEXPRESSLINK2_CONF_KEY_ROOT_CA "RootCA"
106#define IOTEXPRESSLINK2_CONF_KEY_DEFENDER "Defender"
107#define IOTEXPRESSLINK2_CONF_KEY_HOTA_CERTIFICATE "HOTAcertificate"
108#define IOTEXPRESSLINK2_CONF_KEY_OTA_CERTIFICATE "OTAcertificate"
109#define IOTEXPRESSLINK2_CONF_KEY_APN "APN"
110#define IOTEXPRESSLINK2_CONF_KEY_QOS "QOS"
111#define IOTEXPRESSLINK2_CONF_KEY_TOPIC "Topic"
117#define IOTEXPRESSLINK2_RSP_OK "OK"
118#define IOTEXPRESSLINK2_RSP_ERR "ERR"
124#define IOTEXPRESSLINK2_EVENT_TIMEOUT 10000ul
125#define IOTEXPRESSLINK2_CONNECT_TIMEOUT 1000000ul
126#define IOTEXPRESSLINK2_NORMAL_TIMEOUT 5000ul
132#define IOTEXPRESSLINK2_POWER_ON_DELAY 15
133#define IOTEXPRESSLINK2_EMERGENCY_SD_DELAY 25
134#define IOTEXPRESSLINK2_EMERGENCY_SD_RETRY 5
141#define IOTEXPRESSLINK2_TX_DRV_BUFFER_SIZE 200
142#define IOTEXPRESSLINK2_RX_DRV_BUFFER_SIZE 900
160#define IOTEXPRESSLINK2_MAP_MIKROBUS( cfg, mikrobus ) \
161 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
162 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
163 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
164 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
165 cfg.wake = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
166 cfg.event = MIKROBUS( mikrobus, MIKROBUS_INT );
#define IOTEXPRESSLINK2_RX_DRV_BUFFER_SIZE
Definition iotexpresslink2.h:142
#define IOTEXPRESSLINK2_TX_DRV_BUFFER_SIZE
IoT ExpressLink 2 driver buffer size.
Definition iotexpresslink2.h:141
void iotexpresslink2_set_rst_pin(iotexpresslink2_t *ctx, uint8_t state)
IoT ExpressLink 2 set rst pin function.
uint8_t iotexpresslink2_get_wake_pin(iotexpresslink2_t *ctx)
IoT ExpressLink 2 get wake pin function.
err_t iotexpresslink2_generic_write(iotexpresslink2_t *ctx, uint8_t *data_in, uint16_t len)
IoT ExpressLink 2 data writing function.
uint8_t iotexpresslink2_get_event_pin(iotexpresslink2_t *ctx)
IoT ExpressLink 2 get event pin function.
void iotexpresslink2_cfg_setup(iotexpresslink2_cfg_t *cfg)
IoT ExpressLink 2 configuration object setup function.
err_t iotexpresslink2_init(iotexpresslink2_t *ctx, iotexpresslink2_cfg_t *cfg)
IoT ExpressLink 2 initialization function.
err_t iotexpresslink2_generic_read(iotexpresslink2_t *ctx, uint8_t *data_out, uint16_t len)
IoT ExpressLink 2 data reading function.
void iotexpresslink2_reset_device(iotexpresslink2_t *ctx)
IoT ExpressLink 2 reset device function.
void iotexpresslink2_send_cmd(iotexpresslink2_t *ctx, uint8_t *cmd)
IoT ExpressLink 2 send cmd function.
void iotexpresslink2_set_pwr_pin(iotexpresslink2_t *ctx, uint8_t state)
IoT ExpressLink 2 set pwr pin function.
void iotexpresslink2_power_on(iotexpresslink2_t *ctx)
IoT ExpressLink 2 power on function.
iotexpresslink2_return_value_t
IoT ExpressLink 2 Click return value data.
Definition iotexpresslink2.h:224
@ IOTEXPRESSLINK2_ERROR_CMD
Definition iotexpresslink2.h:228
@ IOTEXPRESSLINK2_ERROR
Definition iotexpresslink2.h:226
@ IOTEXPRESSLINK2_OK
Definition iotexpresslink2.h:225
@ IOTEXPRESSLINK2_ERROR_TIMEOUT
Definition iotexpresslink2.h:227
IoT ExpressLink 2 Click configuration object.
Definition iotexpresslink2.h:199
uint32_t baud_rate
Definition iotexpresslink2.h:211
pin_name_t wake
Definition iotexpresslink2.h:207
bool uart_blocking
Definition iotexpresslink2.h:212
uart_data_bits_t data_bit
Definition iotexpresslink2.h:213
pin_name_t tx_pin
Definition iotexpresslink2.h:202
pin_name_t pwr
Definition iotexpresslink2.h:205
pin_name_t rx_pin
Definition iotexpresslink2.h:201
uart_stop_bits_t stop_bit
Definition iotexpresslink2.h:215
uart_parity_t parity_bit
Definition iotexpresslink2.h:214
pin_name_t event
Definition iotexpresslink2.h:208
pin_name_t rst
Definition iotexpresslink2.h:206
IoT ExpressLink 2 Click context object.
Definition iotexpresslink2.h:176
digital_in_t event
Definition iotexpresslink2.h:183
digital_out_t pwr
Definition iotexpresslink2.h:178
digital_in_t wake
Definition iotexpresslink2.h:182
uart_t uart
Definition iotexpresslink2.h:186
digital_out_t rst
Definition iotexpresslink2.h:179