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 LTEIOT11_CMD_AT "AT"
74#define LTEIOT11_CMD_ATI "ATI"
75#define LTEIOT11_CMD_CFUN "AT+CFUN"
76#define LTEIOT11_CMD_CREG "AT+CREG"
77#define LTEIOT11_CMD_CGDCONT "AT+CGDCONT"
78#define LTEIOT11_CMD_CESQ "AT+CESQ"
79#define LTEIOT11_CMD_COPS "AT+COPS"
80#define LTEIOT11_CMD_CMGS "AT+CMGS"
81#define LTEIOT11_CMD_CMGF "AT+CMGF"
82#define LTEIOT11_CMD_CGPADDR "AT+CGPADDR"
83#define LTEIOT11_CMD_SICA "AT^SICA"
84#define LTEIOT11_CMD_SISS "AT^SISS"
85#define LTEIOT11_CMD_SISO "AT^SISO"
86#define LTEIOT11_CMD_SISW "AT^SISW"
87#define LTEIOT11_CMD_SISR "AT^SISR"
88#define LTEIOT11_CMD_SISC "AT^SISC"
89#define LTEIOT11_CMD_SGPSC "AT^SGPSC"
95#define LTEIOT11_RSP_OK "OK"
96#define LTEIOT11_RSP_ERROR "ERROR"
97#define LTEIOT11_RSP_SYSSTART "^SYSSTART"
103#define LTEIOT11_RSP_START "$"
104#define LTEIOT11_RSP_DELIMITER ","
105#define LTEIOT11_RSP_END "\r\n"
106#define LTEIOT11_RSP_GGA "GGA"
112#define LTEIOT11_GGA_ELEMENT_SIZE 15
113#define LTEIOT11_GGA_TIME 1
114#define LTEIOT11_GGA_LATITUDE 2
115#define LTEIOT11_GGA_LATITUDE_SIDE 3
116#define LTEIOT11_GGA_LONGITUDE 4
117#define LTEIOT11_GGA_LONGITUDE_SIDE 5
118#define LTEIOT11_GGA_QUALITY_INDICATOR 6
119#define LTEIOT11_GGA_NUMBER_OF_SATELLITES 7
120#define LTEIOT11_GGA_H_DILUTION_OF_POS 8
121#define LTEIOT11_GGA_ALTITUDE 9
122#define LTEIOT11_GGA_ALTITUDE_UNIT 10
123#define LTEIOT11_GGA_GEOIDAL_SEPARATION 11
124#define LTEIOT11_GGA_GEOIDAL_SEPARATION_UNIT 12
125#define LTEIOT11_GGA_TIME_SINCE_LAST_DGPS 13
126#define LTEIOT11_GGA_DGPS_REFERENCE_STATION_ID 14
133#define LTEIOT11_RX_DRV_BUFFER_SIZE 256
134#define LTEIOT11_TX_DRV_BUFFER_SIZE 256
152#define LTEIOT11_MAP_MIKROBUS( cfg, mikrobus ) \
153 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
154 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
155 cfg.smi = MIKROBUS( mikrobus, MIKROBUS_AN ); \
156 cfg.on = MIKROBUS( mikrobus, MIKROBUS_RST ); \
157 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
158 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
159 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT );
#define LTEIOT11_RX_DRV_BUFFER_SIZE
LTE IoT 11 driver buffer size.
Definition lteiot11.h:133
#define LTEIOT11_TX_DRV_BUFFER_SIZE
Definition lteiot11.h:134
void lteiot11_cfg_setup(lteiot11_cfg_t *cfg)
LTE IoT 11 configuration object setup function.
void lteiot11_send_cmd_check(lteiot11_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
void lteiot11_set_on_pin(lteiot11_t *ctx, uint8_t state)
LTE IoT 11 set on pin function.
void lteiot11_send_cmd_par_check(lteiot11_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
void lteiot11_send_cmd_with_par(lteiot11_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
void lteiot11_set_sim_apn(lteiot11_t *ctx, uint8_t *sim_apn)
Set sim card APN.
err_t lteiot11_init(lteiot11_t *ctx, lteiot11_cfg_t *cfg)
LTE IoT 11 initialization function.
err_t lteiot11_parse_gga(uint8_t *rsp_buf, uint8_t gga_element, uint8_t *element_data)
LTE IoT 11 parse GGA function.
void lteiot11_send_cmd(lteiot11_t *ctx, uint8_t *cmd)
Send command function.
void lteiot11_set_cs_pin(lteiot11_t *ctx, uint8_t state)
LTE IoT 11 set cs pin function.
uint8_t lteiot11_get_cts_pin(lteiot11_t *ctx)
LTE IoT 11 get cts pin function.
void lteiot11_send_sms_text(lteiot11_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
LTE IoT 11 send SMS in text mode.
err_t lteiot11_send_sms_pdu(lteiot11_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
LTE IoT 11 send SMS in PDU mode.
uint8_t lteiot11_get_smi_pin(lteiot11_t *ctx)
LTE IoT 11 get smi pin function.
err_t lteiot11_generic_write(lteiot11_t *ctx, uint8_t *data_in, uint16_t len)
LTE IoT 11 data writing function.
void lteiot11_set_rts_pin(lteiot11_t *ctx, uint8_t state)
LTE IoT 11 set rts pin function.
err_t lteiot11_generic_read(lteiot11_t *ctx, uint8_t *data_out, uint16_t len)
LTE IoT 11 data reading function.
lteiot11_return_value_t
LTE IoT 11 Click return value data.
Definition lteiot11.h:219
@ LTEIOT11_ERROR_CMD
Definition lteiot11.h:223
@ LTEIOT11_ERROR_UNKNOWN
Definition lteiot11.h:224
@ LTEIOT11_ERROR_TIMEOUT
Definition lteiot11.h:222
@ LTEIOT11_ERROR
Definition lteiot11.h:221
@ LTEIOT11_OK
Definition lteiot11.h:220
LTE IoT 11 Click configuration object.
Definition lteiot11.h:193
pin_name_t rts
Definition lteiot11.h:203
uint32_t baud_rate
Definition lteiot11.h:206
pin_name_t cts
Definition lteiot11.h:201
bool uart_blocking
Definition lteiot11.h:207
pin_name_t smi
Definition lteiot11.h:202
uart_data_bits_t data_bit
Definition lteiot11.h:208
pin_name_t on
Definition lteiot11.h:199
pin_name_t tx_pin
Definition lteiot11.h:196
pin_name_t rx_pin
Definition lteiot11.h:195
uart_stop_bits_t stop_bit
Definition lteiot11.h:210
uart_parity_t parity_bit
Definition lteiot11.h:209
pin_name_t cs
Definition lteiot11.h:200
LTE IoT 11 Click context object.
Definition lteiot11.h:169
digital_out_t cs
Definition lteiot11.h:172
digital_out_t on
Definition lteiot11.h:171
digital_out_t rts
Definition lteiot11.h:173
uart_t uart
Definition lteiot11.h:180
digital_in_t smi
Definition lteiot11.h:176
digital_in_t cts
Definition lteiot11.h:177