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 LTECAT43_CMD_AT "AT"
74#define LTECAT43_CMD_ATI "ATI"
75#define LTECAT43_CMD_CGMR "AT+CGMR"
76#define LTECAT43_CMD_CFUN "AT+CFUN"
77#define LTECAT43_CMD_CREG "AT+CREG"
78#define LTECAT43_CMD_CGREG "AT+CGREG"
79#define LTECAT43_CMD_CGDCONT "AT+CGDCONT"
80#define LTECAT43_CMD_CIMI "AT+CIMI"
81#define LTECAT43_CMD_CMEE "AT+CMEE"
82#define LTECAT43_CMD_CGATT "AT+CGATT"
83#define LTECAT43_CMD_CSQ "AT+CSQ"
84#define LTECAT43_CMD_COPS "AT+COPS"
85#define LTECAT43_CMD_CMGS "AT+CMGS"
86#define LTECAT43_CMD_CMGF "AT+CMGF"
87#define LTECAT43_CMD_CGACT "AT+CGACT"
88#define LTECAT43_CMD_USOCR "AT+USOCR"
89#define LTECAT43_CMD_USOCO "AT+USOCO"
90#define LTECAT43_CMD_USOWR "AT+USOWR"
91#define LTECAT43_CMD_USOST "AT+USOST"
92#define LTECAT43_CMD_USORD "AT+USORD"
93#define LTECAT43_CMD_USORF "AT+USORF"
94#define LTECAT43_CMD_USOCL "AT+USOCL"
95#define LTECAT43_CMD_UGPS "AT+UGPS"
96#define LTECAT43_CMD_UGGGA "AT+UGGGA"
102#define LTECAT43_RSP_OK "OK"
103#define LTECAT43_RSP_ERROR "ERROR"
109#define LTECAT43_POWER_STATE_OFF 0
110#define LTECAT43_POWER_STATE_ON 1
117#define LTECAT43_TX_DRV_BUFFER_SIZE 256
118#define LTECAT43_RX_DRV_BUFFER_SIZE 256
136#define LTECAT43_MAP_MIKROBUS( cfg, mikrobus ) \
137 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
138 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
139 cfg.sts = MIKROBUS( mikrobus, MIKROBUS_AN ); \
140 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_RST ); \
141 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
142 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
143 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
#define LTECAT43_RX_DRV_BUFFER_SIZE
Definition ltecat43.h:118
#define LTECAT43_TX_DRV_BUFFER_SIZE
LTE Cat.4 3 driver buffer size.
Definition ltecat43.h:117
void ltecat43_send_cmd_check(ltecat43_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
err_t ltecat43_send_sms_pdu(ltecat43_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
LTE Cat.4 3 send SMS in PDU mode.
uint8_t ltecat43_get_cts_pin(ltecat43_t *ctx)
LTE Cat.4 3 get CTS pin function.
void ltecat43_set_sts_pin(ltecat43_t *ctx, uint8_t state)
LTE Cat.4 3 set STS pin function.
void ltecat43_send_cmd(ltecat43_t *ctx, uint8_t *cmd)
Send command function.
void ltecat43_send_sms_text(ltecat43_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
LTE Cat.4 3 send SMS in text mode.
void ltecat43_set_pwr_pin(ltecat43_t *ctx, uint8_t state)
LTE Cat.4 3 set PWR pin function.
uint8_t ltecat43_get_ri_pin(ltecat43_t *ctx)
LTE Cat.4 3 get RI pin function.
err_t ltecat43_init(ltecat43_t *ctx, ltecat43_cfg_t *cfg)
LTE Cat.4 3 initialization function.
void ltecat43_set_power_state(ltecat43_t *ctx, uint8_t state)
LTE Cat.4 3 set power state function.
err_t ltecat43_generic_write(ltecat43_t *ctx, uint8_t *data_in, uint16_t len)
LTE Cat.4 3 data writing function.
void ltecat43_cfg_setup(ltecat43_cfg_t *cfg)
LTE Cat.4 3 configuration object setup function.
void ltecat43_set_rts_pin(ltecat43_t *ctx, uint8_t state)
LTE Cat.4 3 set RTS pin function.
err_t ltecat43_generic_read(ltecat43_t *ctx, uint8_t *data_out, uint16_t len)
LTE Cat.4 3 data reading function.
void ltecat43_send_cmd_par(ltecat43_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
void ltecat43_set_sim_apn(ltecat43_t *ctx, uint8_t *sim_apn)
Set sim card APN.
ltecat43_return_value_t
LTE Cat.4 3 Click return value data.
Definition ltecat43.h:203
@ LTECAT43_ERROR_TIMEOUT
Definition ltecat43.h:206
@ LTECAT43_ERROR_UNKNOWN
Definition ltecat43.h:208
@ LTECAT43_OK
Definition ltecat43.h:204
@ LTECAT43_ERROR_CMD
Definition ltecat43.h:207
@ LTECAT43_ERROR
Definition ltecat43.h:205
LTE Cat.4 3 Click configuration object.
Definition ltecat43.h:177
pin_name_t rts
Definition ltecat43.h:185
uint32_t baud_rate
Definition ltecat43.h:190
pin_name_t sts
Definition ltecat43.h:183
pin_name_t cts
Definition ltecat43.h:187
bool uart_blocking
Definition ltecat43.h:191
pin_name_t ri
Definition ltecat43.h:186
uart_data_bits_t data_bit
Definition ltecat43.h:192
pin_name_t tx_pin
Definition ltecat43.h:180
pin_name_t pwr
Definition ltecat43.h:184
pin_name_t rx_pin
Definition ltecat43.h:179
uart_stop_bits_t stop_bit
Definition ltecat43.h:194
uart_parity_t parity_bit
Definition ltecat43.h:193
LTE Cat.4 3 Click context object.
Definition ltecat43.h:153
digital_out_t pwr
Definition ltecat43.h:156
digital_out_t rts
Definition ltecat43.h:157
digital_in_t ri
Definition ltecat43.h:160
uart_t uart
Definition ltecat43.h:164
digital_out_t sts
Definition ltecat43.h:155
digital_in_t cts
Definition ltecat43.h:161