39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
74#define LTECAT1US_CMD_AT "AT"
75#define LTECAT1US_CMD_ATI "ATI"
76#define LTECAT1US_CMD_CGMR "AT+CGMR"
78#define LTECAT1US_CMD_CFUN "AT+CFUN"
79#define LTECAT1US_CMD_CREG "AT+CREG"
80#define LTECAT1US_CMD_CEREG "AT+CEREG"
81#define LTECAT1US_CMD_CGDCONT "AT+CGDCONT"
82#define LTECAT1US_CMD_CIMI "AT+CIMI"
83#define LTECAT1US_CMD_CGATT "AT+CGATT"
84#define LTECAT1US_CMD_CSQ "AT+CSQ"
85#define LTECAT1US_CMD_CESQ "AT+CESQ"
86#define LTECAT1US_CMD_COPS "AT+COPS"
94#define DRV_RX_BUFFER_SIZE 500
95#define DRV_TX_BUFFER_SIZE 100
113#define LTECAT1US_MAP_MIKROBUS( cfg, mikrobus ) \
114 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
115 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
116 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
117 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
118 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
119 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
#define DRV_RX_BUFFER_SIZE
LTE Cat.1-US driver buffer size.
Definition ltecat1us.h:94
#define DRV_TX_BUFFER_SIZE
Definition ltecat1us.h:95
err_t ltecat1us_init(ltecat1us_t *ctx, ltecat1us_cfg_t *cfg)
LTE Cat.1-US initialization function.
void ltecat1us_send_text_message(ltecat1us_t *ctx, char *phone_number, char *message_context)
LTE Cat.1-US send text message.
void ltecat1us_generic_write(ltecat1us_t *ctx, char *data_buf, uint16_t len)
LTE Cat.1-US data writing function.
err_t ltecat1us_generic_read(ltecat1us_t *ctx, char *data_buf, uint16_t max_len)
LTE Cat.1-US data reading function.
void ltecat1us_send_cmd(ltecat1us_t *ctx, char *cmd)
Send command function.
uint8_t ltecat1us_get_cts(ltecat1us_t *ctx)
CTS Pin Get function.
void ltecat1us_send_cmd_parameter_check(ltecat1us_t *ctx, char *at_cmd_buf)
Check the command parameters.
void ltecat1us_set_rst(ltecat1us_t *ctx, uint8_t state)
Sets state of the RST pin.
void ltecat1us_cfg_setup(ltecat1us_cfg_t *cfg)
LTE Cat.1-US configuration object setup function.
void ltecat1us_set_rts(ltecat1us_t *ctx, uint8_t state)
Sets state of the RTS pin.
void ltecat1us_send_cmd_with_parameter(ltecat1us_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void ltecat1us_set_sim_apn(ltecat1us_t *ctx, char *sim_apn)
Set sim card APN.
void ltecat1us_power_on(ltecat1us_t *ctx)
LTE Cat.1-US module power on.
void ltecat1us_send_cmd_check(ltecat1us_t *ctx, char *at_cmd_buf)
Check the sent command.
ltecat1us_return_value_t
LTE Cat.1-US Click return value data.
Definition ltecat1us.h:178
@ LTECAT1US_ERROR
Definition ltecat1us.h:180
@ LTECAT1US_OK
Definition ltecat1us.h:179
LTE Cat.1-US Click configuration object.
Definition ltecat1us.h:152
pin_name_t rts
Definition ltecat1us.h:162
uint32_t baud_rate
Definition ltecat1us.h:165
pin_name_t cts
Definition ltecat1us.h:160
bool uart_blocking
Definition ltecat1us.h:166
uart_data_bits_t data_bit
Definition ltecat1us.h:167
pin_name_t tx_pin
Definition ltecat1us.h:155
pin_name_t rx_pin
Definition ltecat1us.h:154
uart_stop_bits_t stop_bit
Definition ltecat1us.h:169
uart_parity_t parity_bit
Definition ltecat1us.h:168
pin_name_t rst
Definition ltecat1us.h:159
pin_name_t cs
Definition ltecat1us.h:161
LTE Cat.1-US Click context object.
Definition ltecat1us.h:129
digital_out_t cs
Definition ltecat1us.h:132
digital_out_t rts
Definition ltecat1us.h:133
uart_t uart
Definition ltecat1us.h:139
digital_in_t cts
Definition ltecat1us.h:136
digital_out_t rst
Definition ltecat1us.h:131