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 NBIOT4_CMD_AT "AT"
74#define NBIOT4_CMD_ATE1 "ATE1"
75#define NBIOT4_CMD_CFUN "AT+CFUN"
76#define NBIOT4_CMD_CREG "AT+CREG"
77#define NBIOT4_CMD_CEREG "AT+CEREG"
78#define NBIOT4_CMD_CGDCONT "AT+CGDCONT"
79#define NBIOT4_CMD_CSQ "AT+CSQ"
80#define NBIOT4_CMD_COPS "AT+COPS"
81#define NBIOT4_CMD_CMGS "AT+CMGS"
82#define NBIOT4_CMD_CMGF "AT+CMGF"
83#define NBIOT4_CMD_SIMSWAP "AT^SIMSWAP"
84#define NBIOT4_CMD_TRB "AT+TRB"
85#define NBIOT4_CMD_CIPMUX "AT+CIPMUX"
86#define NBIOT4_CMD_CIPSTART "AT+CIPSTART"
87#define NBIOT4_CMD_CIPCLOSE "AT+CIPCLOSE"
88#define NBIOT4_CMD_CIPSEND "AT+CIPSEND"
89#define NBIOT4_CMD_CIPHEAD "AT+CIPHEAD"
95#define NBIOT4_RSP_OK "OK"
96#define NBIOT4_RSP_ERROR "ERROR"
97#define NBIOT4_RSP_REBOOTING "REBOOTING"
104#define NBIOT4_RX_DRV_BUFFER_SIZE 256
105#define NBIOT4_TX_DRV_BUFFER_SIZE 256
123#define NBIOT4_MAP_MIKROBUS( cfg, mikrobus ) \
124 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
125 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
126 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
127 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
128 cfg.ring = MIKROBUS( mikrobus, MIKROBUS_INT )
#define NBIOT4_TX_DRV_BUFFER_SIZE
Definition nbiot4.h:105
#define NBIOT4_RX_DRV_BUFFER_SIZE
NB IoT 4 driver buffer size.
Definition nbiot4.h:104
err_t nbiot4_send_sms_pdu(nbiot4_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
NB IoT 4 send SMS in PDU mode.
void nbiot4_set_sim_apn(nbiot4_t *ctx, uint8_t *sim_apn)
Set sim card APN.
err_t nbiot4_generic_read(nbiot4_t *ctx, uint8_t *data_out, uint16_t len)
NB IoT 4 data reading function.
void nbiot4_set_cs_pin(nbiot4_t *ctx, uint8_t state)
NB IoT 4 set cs pin function.
void nbiot4_send_sms_text(nbiot4_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
NB IoT 4 send SMS in text mode.
uint8_t nbiot4_get_ring_pin(nbiot4_t *ctx)
NB IoT 4 get ring pin function.
void nbiot4_send_cmd_check(nbiot4_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
void nbiot4_send_cmd_par_check(nbiot4_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
void nbiot4_cfg_setup(nbiot4_cfg_t *cfg)
NB IoT 4 configuration object setup function.
err_t nbiot4_generic_write(nbiot4_t *ctx, uint8_t *data_in, uint16_t len)
NB IoT 4 data writing function.
void nbiot4_send_cmd_with_par(nbiot4_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
err_t nbiot4_init(nbiot4_t *ctx, nbiot4_cfg_t *cfg)
NB IoT 4 initialization function.
void nbiot4_send_cmd(nbiot4_t *ctx, uint8_t *cmd)
Send command function.
void nbiot4_set_rst_pin(nbiot4_t *ctx, uint8_t state)
NB IoT 4 set rst pin function.
nbiot4_return_value_t
NB IoT 4 Click return value data.
Definition nbiot4.h:184
@ NBIOT4_ERROR_UNKNOWN
Definition nbiot4.h:189
@ NBIOT4_ERROR_CMD
Definition nbiot4.h:188
@ NBIOT4_OK
Definition nbiot4.h:185
@ NBIOT4_ERROR_TIMEOUT
Definition nbiot4.h:187
@ NBIOT4_ERROR
Definition nbiot4.h:186
NB IoT 4 Click configuration object.
Definition nbiot4.h:160
uint32_t baud_rate
Definition nbiot4.h:171
pin_name_t ring
Definition nbiot4.h:168
bool uart_blocking
Definition nbiot4.h:172
uart_data_bits_t data_bit
Definition nbiot4.h:173
pin_name_t tx_pin
Definition nbiot4.h:163
pin_name_t rx_pin
Definition nbiot4.h:162
uart_stop_bits_t stop_bit
Definition nbiot4.h:175
uart_parity_t parity_bit
Definition nbiot4.h:174
pin_name_t rst
Definition nbiot4.h:166
pin_name_t cs
Definition nbiot4.h:167
NB IoT 4 Click context object.
Definition nbiot4.h:138
digital_out_t cs
Definition nbiot4.h:141
uart_t uart
Definition nbiot4.h:147
digital_out_t rst
Definition nbiot4.h:140
digital_in_t ring
Definition nbiot4.h:144