Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
59 #define LTEIOT7_CMD_AT "AT"
60 #define LTEIOT7_CMD_ATI "ATI"
61 #define LTEIOT7_CMD_CGMR "AT+CGMR"
62 #define LTEIOT7_CMD_CFUN "AT+CFUN"
63 #define LTEIOT7_CMD_CREG "AT+CREG"
64 #define LTEIOT7_CMD_CGREG "AT+CGREG"
65 #define LTEIOT7_CMD_CGDCONT "AT+CGDCONT"
66 #define LTEIOT7_CMD_CIMI "AT+CIMI"
67 #define LTEIOT7_CMD_CMEE "AT+CMEE"
68 #define LTEIOT7_CMD_CGATT "AT+CGATT"
69 #define LTEIOT7_CMD_CSQ "AT+CSQ"
70 #define LTEIOT7_CMD_COPS "AT+COPS"
71 #define LTEIOT7_CMD_CMGS "AT+CMGS"
72 #define LTEIOT7_CMD_CMGF "AT+CMGF"
73 #define LTEIOT7_CMD_CGACT "AT+CGACT"
74 #define LTEIOT7_CMD_USOCR "AT+USOCR"
75 #define LTEIOT7_CMD_USOCO "AT+USOCO"
76 #define LTEIOT7_CMD_USOWR "AT+USOWR"
77 #define LTEIOT7_CMD_USORD "AT+USORD"
78 #define LTEIOT7_CMD_USORF "AT+USORF"
79 #define LTEIOT7_CMD_USOCL "AT+USOCL"
80 #define LTEIOT7_CMD_UGPS "AT+UGPS"
81 #define LTEIOT7_CMD_UGGGA "AT+UGGGA"
87 #define LTEIOT7_RSP_OK "OK"
88 #define LTEIOT7_RSP_ERROR "ERROR"
94 #define LTEIOT7_POWER_STATE_SWITCH 0
95 #define LTEIOT7_POWER_STATE_ON 1
96 #define LTEIOT7_POWER_STATE_REBOOT 2
102 #define LTEIOT7_RSP_START "$"
103 #define LTEIOT7_RSP_DELIMITER ","
104 #define LTEIOT7_RSP_GPGGA "$GPGGA"
110 #define LTEIOT7_GPGGA_ELEMENT_SIZE 15
111 #define LTEIOT7_GPGGA_TIME 1
112 #define LTEIOT7_GPGGA_LATITUDE 2
113 #define LTEIOT7_GPGGA_LATITUDE_SIDE 3
114 #define LTEIOT7_GPGGA_LONGITUDE 4
115 #define LTEIOT7_GPGGA_LONGITUDE_SIDE 5
116 #define LTEIOT7_GPGGA_QUALITY_INDICATOR 6
117 #define LTEIOT7_GPGGA_NUMBER_OF_SATELLITES 7
118 #define LTEIOT7_GPGGA_H_DILUTION_OF_POS 8
119 #define LTEIOT7_GPGGA_ALTITUDE 9
120 #define LTEIOT7_GPGGA_ALTITUDE_UNIT 10
121 #define LTEIOT7_GPGGA_GEOIDAL_SEPARATION 11
122 #define LTEIOT7_GPGGA_GEOIDAL_SEPARATION_UNIT 12
123 #define LTEIOT7_GPGGA_TIME_SINCE_LAST_DGPS 13
124 #define LTEIOT7_GPGGA_DGPS_REFERENCE_STATION_ID 14
131 #define DRV_BUFFER_SIZE 256
149 #define LTEIOT7_MAP_MIKROBUS( cfg, mikrobus ) \
150 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
151 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
152 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
153 cfg.ein = MIKROBUS( mikrobus, MIKROBUS_RST ); \
154 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
155 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
156 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
pin_name_t pwr
Definition: lteiot7.h:196
bool uart_blocking
Definition: lteiot7.h:204
pin_name_t ein
Definition: lteiot7.h:197
uint8_t lteiot7_get_ri_pin(lteiot7_t *ctx)
LTE IoT 7 get RI pin function.
@ LTEIOT7_ERROR
Definition: lteiot7.h:218
uint8_t lteiot7_get_cts_pin(lteiot7_t *ctx)
LTE IoT 7 get CTS pin function.
void lteiot7_cfg_setup(lteiot7_cfg_t *cfg)
LTE IoT 7 configuration object setup function.
@ LTEIOT7_ERROR_CMD
Definition: lteiot7.h:220
err_t lteiot7_parse_gpgga(char *rsp_buf, uint8_t gpgga_element, char *element_data)
LTE IoT 7 parse GPGGA function.
digital_in_t ri
Definition: lteiot7.h:173
void lteiot7_set_rts_pin(lteiot7_t *ctx, uint8_t state)
LTE IoT 7 set RTS pin function.
void lteiot7_set_pwr_pin(lteiot7_t *ctx, uint8_t state)
LTE IoT 7 set PWR pin function.
@ LTEIOT7_ERROR_UNKNOWN
Definition: lteiot7.h:221
pin_name_t tx_pin
Definition: lteiot7.h:193
uart_data_bits_t data_bit
Definition: lteiot7.h:205
@ LTEIOT7_ERROR_TIMEOUT
Definition: lteiot7.h:219
void lteiot7_send_cmd_parameter_check(lteiot7_t *ctx, char *at_cmd_buf)
Check the command parameters.
void lteiot7_set_sim_apn(lteiot7_t *ctx, char *sim_apn)
Set sim card APN.
LTE IoT 7 Click context object.
Definition: lteiot7.h:166
digital_in_t cts
Definition: lteiot7.h:174
LTE IoT 7 Click configuration object.
Definition: lteiot7.h:190
err_t lteiot7_generic_write(lteiot7_t *ctx, char *data_in, uint16_t len)
LTE IoT 7 data writing function.
uart_stop_bits_t stop_bit
Definition: lteiot7.h:207
pin_name_t rts
Definition: lteiot7.h:198
void lteiot7_send_cmd(lteiot7_t *ctx, char *cmd)
Send command function.
lteiot7_return_value_t
LTE IoT 7 Click return value data.
Definition: lteiot7.h:216
#define DRV_BUFFER_SIZE
LTE IoT 7 driver buffer size.
Definition: lteiot7.h:131
void lteiot7_send_sms_text(lteiot7_t *ctx, char *phone_number, char *sms_text)
LTE IoT 7 send SMS in text mode.
digital_out_t ein
Definition: lteiot7.h:169
@ LTEIOT7_OK
Definition: lteiot7.h:217
digital_out_t rts
Definition: lteiot7.h:170
err_t lteiot7_send_sms_pdu(lteiot7_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
LTE IoT 7 send SMS in PDU mode.
void lteiot7_set_ein_pin(lteiot7_t *ctx, uint8_t state)
LTE IoT 7 set EIN pin function.
void lteiot7_send_cmd_check(lteiot7_t *ctx, char *at_cmd_buf)
Check the sent command.
void lteiot7_send_cmd_with_parameter(lteiot7_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
pin_name_t ri
Definition: lteiot7.h:199
uint32_t baud_rate
Definition: lteiot7.h:203
err_t lteiot7_generic_read(lteiot7_t *ctx, char *data_out, uint16_t len)
LTE IoT 7 data reading function.
uart_t uart
Definition: lteiot7.h:177
pin_name_t cts
Definition: lteiot7.h:200
void lteiot7_set_power_state(lteiot7_t *ctx, uint8_t state)
LTE IoT 7 set power state function.
pin_name_t rx_pin
Definition: lteiot7.h:192
err_t lteiot7_init(lteiot7_t *ctx, lteiot7_cfg_t *cfg)
LTE IoT 7 initialization function.
digital_out_t pwr
Definition: lteiot7.h:168
uart_parity_t parity_bit
Definition: lteiot7.h:206