42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define LTEIOT2_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.sta = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.pwk = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define LTEIOT2_RETVAL uint8_t
87#define LTEIOT2_NMEA_GPGGA 1
88#define LTEIOT2_NMEA_GPGGA_NUM_ELEMENT 15
95#define LTEIOT2_GPGGA_TIME 1
96#define LTEIOT2_GPGGA_LATITUDE 2
97#define LTEIOT2_GPGGA_LATITUDE_SIDE 3
98#define LTEIOT2_GPGGA_LONGITUDE 4
99#define LTEIOT2_GPGGA_LONGITUDE_SIDE 5
100#define LTEIOT2_GPGGA_QUALITY_INDICATOR 6
101#define LTEIOT2_GPGGA_NUMBER_OF_SATELLITES 7
102#define LTEIOT2_GPGGA_H_DILUTION_OF_POS 8
103#define LTEIOT2_GPGGA_ALTITUDE 9
104#define LTEIOT2_GPGGA_ALTITUDE_UNIT 10
105#define LTEIOT2_GPGGA_GEOIDAL_SEPARATION 11
106#define LTEIOT2_GPGGA_GEOIDAL_SEPARATION_UNIT 12
107#define LTEIOT2_GPGGA_TIME_SINCE_LAST_DGPS 13
108#define LTEIOT2_GPGGA_DGPS_REFERENCE_STATION_ID 14
115#define LTEIOT2_ERROR_COMMAND_OR_ELEMENT 0xFF
116#define LTEIOT2_ERROR_START_OR_END_COMMAND 0x8F
117#define LTEIOT2_ERROR_NEXT_ELEMENT 0x4F
118#define LTEIOT2_ERROR_CURRENT_ELEMENT 0x2F
119#define LTEIOT2_NO_ERROR 0x00
126#define LTEIOT2_MODULE_POWER_ON 1
127#define LTEIOT2_MODULE_POWER_OFF 0
134#define LTEIOT2_CMD_AT "AT"
135#define LTEIOT2_CMD_ATI "ATI"
136#define LTEIOT2_CMD_CGMR "AT+CGMR"
138#define LTEIOT2_CMD_CFUN "AT+CFUN"
139#define LTEIOT2_CMD_CREG "AT+CREG"
140#define LTEIOT2_CMD_CGDCONT "AT+CGDCONT"
141#define LTEIOT2_CMD_CIMI "AT+CIMI"
142#define LTEIOT2_CMD_CGATT "AT+CGATT"
143#define LTEIOT2_CMD_CSQ "AT+CSQ"
144#define LTEIOT2_CMD_COPS "AT+COPS"
145#define LTEIOT2_CMD_CMGS "AT+CMGS"
146#define LTEIOT2_CMD_CMGF "AT+CMGF"
147#define LTEIOT2_CMD_QGPS "AT+QGPS"
148#define LTEIOT2_CMD_QGPSCFG "AT+QGPSCFG"
149#define LTEIOT2_CMD_QGPSGNMEA "AT+QGPSGNMEA"
150#define LTEIOT2_CMD_QGPSLOC "AT+QGPSLOC"
157#define DRV_RX_BUFFER_SIZE 256
158#define DRV_TX_BUFFER_SIZE 256
395 char *phone_number,
char *sms_text );
407 char *rsp, uint8_t command,
408 uint8_t element,
char *parser_buf
#define DRV_RX_BUFFER_SIZE
Definition lteiot2.h:157
#define LTEIOT2_RETVAL
Definition lteiot2.h:80
LTEIOT2_RETVAL lteiot2_init(lteiot2_t *ctx, lteiot2_cfg_t *cfg)
Initialization function.
err_t lteiot2_send_sms_pdu(lteiot2_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
LTE IoT 2 send SMS in PDU mode.
int32_t lteiot2_generic_read(lteiot2_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void lteiot2_module_power(lteiot2_t *ctx, uint8_t state)
Power ON/OFF the module.
void lteiot2_send_cmd_check(lteiot2_t *ctx, char *at_cmd_buf)
Check the sent command.
uint8_t lteiot2_get_cts(lteiot2_t *ctx)
CTS Pin Get function.
void lteiot2_set_rts(lteiot2_t *ctx, uint8_t state)
Sets state of the RTS pin.
void lteiot2_send_cmd_with_parameter(lteiot2_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void lteiot2_cfg_setup(lteiot2_cfg_t *cfg)
Config Object Initialization function.
void lteiot2_send_sms_text(lteiot2_t *ctx, char *phone_number, char *sms_text)
LTE IoT 2 send SMS in text mode.
void lteiot2_send_cmd(lteiot2_t *ctx, char *cmd)
Send command function.
lteiot2_error_t lteiot2_generic_parser(char *rsp, uint8_t command, uint8_t element, char *parser_buf)
Generic parser function.
void lteiot2_set_sim_apn(lteiot2_t *ctx, char *sim_apn)
Set sim card APN.
void lteiot2_send_cmd_parameter_check(lteiot2_t *ctx, char *at_cmd_buf)
Check the command parameters.
void lteiot2_generic_write(lteiot2_t *ctx, char *data_buf, uint16_t len)
Generic write function.
lteiot2_return_value_t
LTE IoT 2 Click return value data.
Definition lteiot2.h:226
uint8_t lteiot2_error_t
Error type.
Definition lteiot2.h:235
@ LTEIOT2_OK
Definition lteiot2.h:227
@ LTEIOT2_ERROR
Definition lteiot2.h:228
Click configuration structure definition.
Definition lteiot2.h:197
pin_name_t sta
Definition lteiot2.h:205
pin_name_t rts
Definition lteiot2.h:207
uint32_t baud_rate
Definition lteiot2.h:213
pin_name_t pwk
Definition lteiot2.h:206
pin_name_t cts
Definition lteiot2.h:209
bool uart_blocking
Definition lteiot2.h:214
pin_name_t ri
Definition lteiot2.h:208
uart_data_bits_t data_bit
Definition lteiot2.h:215
pin_name_t tx_pin
Definition lteiot2.h:201
pin_name_t rx_pin
Definition lteiot2.h:200
uart_stop_bits_t stop_bit
Definition lteiot2.h:217
uart_parity_t parity_bit
Definition lteiot2.h:216
Click ctx object definition.
Definition lteiot2.h:171
digital_in_t sta
Definition lteiot2.h:180
digital_out_t rts
Definition lteiot2.h:175
digital_in_t ri
Definition lteiot2.h:181
uart_t uart
Definition lteiot2.h:186
digital_in_t cts
Definition lteiot2.h:182
digital_out_t pwk
Definition lteiot2.h:174