Go to the documentation of this file.
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 LTEIOT_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
70 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
80 #define LTEIOT_RETVAL uint8_t
82 #define LTEIOT_OK 0x00
83 #define LTEIOT_INIT_ERROR 0xFF
90 #define LTEIOT_MODULE_POWER_ON 1
91 #define LTEIOT_MODULE_POWER_OFF 0
98 #define LTEIOT_CMD_AT "AT"
99 #define LTEIOT_CMD_ATI "ATI"
100 #define LTEIOT_CMD_CGMR "AT+CGMR"
102 #define LTEIOT_CMD_CFUN "AT+CFUN"
103 #define LTEIOT_CMD_CREG "AT+CREG"
104 #define LTEIOT_CMD_CEREG "AT+CEREG"
105 #define LTEIOT_CMD_CGDCONT "AT+CGDCONT"
106 #define LTEIOT_CMD_CIMI "AT+CIMI"
107 #define LTEIOT_CMD_CGATT "AT+CGATT"
108 #define LTEIOT_CMD_CSQ "AT+CSQ"
109 #define LTEIOT_CMD_CESQ "AT+CESQ"
110 #define LTEIOT_CMD_COPS "AT+COPS"
117 #define DRV_RX_BUFFER_SIZE 500
118 #define DRV_TX_BUFFER_SIZE 100
pin_name_t ri
Definition: lteiot.h:167
void lteiot_power_on(lteiot_t *ctx)
LTE IoT module power on.
#define DRV_RX_BUFFER_SIZE
Definition: lteiot.h:117
void lteiot_set_rst(lteiot_t *ctx, uint8_t state)
Sets state of the RST pin.
pin_name_t tx_pin
Definition: lteiot.h:160
pin_name_t pwr
Definition: lteiot.h:164
bool uart_blocking
Definition: lteiot.h:173
void lteiot_cfg_setup(lteiot_cfg_t *cfg)
LTE IoT configuration object setup function.
pin_name_t rts
Definition: lteiot.h:168
pin_name_t rst
Definition: lteiot.h:165
void lteiot_send_text_message(lteiot_t *ctx, char *phone_number, char *message_context)
LTE IoT send text message.
err_t lteiot_init(lteiot_t *ctx, lteiot_cfg_t *cfg)
LTE IoT initialization function.
uint8_t lteiot_get_cts(lteiot_t *ctx)
CTS Pin Get function.
uart_t uart
Definition: lteiot.h:145
digital_in_t cts
Definition: lteiot.h:141
digital_out_t rts
Definition: lteiot.h:136
void lteiot_send_cmd_with_parameter(lteiot_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
digital_in_t ri
Definition: lteiot.h:140
void lteiot_set_sim_apn(lteiot_t *ctx, char *sim_apn)
Set sim card APN.
void lteiot_set_rts(lteiot_t *ctx, uint8_t state)
Sets state of the RTS pin.
Click ctx object definition.
Definition: lteiot.h:131
pin_name_t rx_pin
Definition: lteiot.h:159
void lteiot_send_cmd_check(lteiot_t *ctx, char *at_cmd_buf)
Check the sent command.
void lteiot_send_cmd_parameter_check(lteiot_t *ctx, char *at_cmd_buf)
Check the command parameters.
uart_stop_bits_t stop_bit
Definition: lteiot.h:176
digital_out_t pwr
Definition: lteiot.h:134
pin_name_t cts
Definition: lteiot.h:166
Click configuration structure definition.
Definition: lteiot.h:156
digital_out_t rst
Definition: lteiot.h:135
void lteiot_send_cmd(lteiot_t *ctx, char *cmd)
Send command function.
err_t lteiot_generic_read(lteiot_t *ctx, char *data_buf, uint16_t max_len)
LTE IoT data reading function.
uint32_t baud_rate
Definition: lteiot.h:172
err_t lteiot_generic_write(lteiot_t *ctx, char *data_buf, uint16_t len)
LTE IoT data writing function.
#define DRV_TX_BUFFER_SIZE
Definition: lteiot.h:118
uart_parity_t parity_bit
Definition: lteiot.h:175
uart_data_bits_t data_bit
Definition: lteiot.h:174