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 NBIOT2_CMD_AT "AT"
74#define NBIOT2_CMD_ATI "ATI"
75#define NBIOT2_CMD_CGMR "AT+CGMR"
76#define NBIOT2_CMD_CFUN "AT+CFUN"
77#define NBIOT2_CMD_CREG "AT+CREG"
78#define NBIOT2_CMD_CEREG "AT+CEREG"
79#define NBIOT2_CMD_CGDCONT "AT+CGDCONT"
80#define NBIOT2_CMD_CIMI "AT+CIMI"
81#define NBIOT2_CMD_CGATT "AT+CGATT"
82#define NBIOT2_CMD_CSQ "AT+CSQ"
83#define NBIOT2_CMD_CESQ "AT+CESQ"
84#define NBIOT2_CMD_COPS "AT+COPS"
85#define NBIOT2_CMD_CSCON "AT+CSCON"
86#define NBIOT2_CMD_CMEE "AT+CMEE"
87#define NBIOT2_CMD_CMGS "AT+CMGS"
88#define NBIOT2_CMD_CGACT "AT+CGACT"
89#define NBIOT2_CMD_URAT "AT+URAT"
90#define NBIOT2_CMD_UBANDMASK "AT+UBANDMASK"
91#define NBIOT2_CMD_URATCONF "AT+URATCONF"
92#define NBIOT2_CMD_UAUTHREQ "AT+UAUTHREQ"
93#define NBIOT2_CMD_UUICC "AT+UUICC"
94#define NBIOT2_CMD_UCGED "AT+UCGED"
95#define NBIOT2_CMD_UCELLINFO "AT+UCELLINFO"
96#define NBIOT2_CMD_UANTR "AT+UANTR"
97#define NBIOT2_CMD_CMGF "AT+CMGF"
98#define NBIOT2_CMD_QSPCHSC "AT+QSPCHSC"
99#define NBIOT2_CMD_CPSMS "AT+CPSMS"
100#define NBIOT2_CMD_QRST "AT+QRST"
101#define NBIOT2_CMD_QBAND "AT+QBAND"
102#define NBIOT2_CMD_QNBIOTEVENT "AT+QNBIOTEVENT"
103#define NBIOT2_CMD_SM "AT+SM"
104#define NBIOT2_CMD_QSCLK "AT+QSCLK"
105#define NBIOT2_CMD_QIOPEN "AT+QIOPEN"
106#define NBIOT2_CMD_QISEND "AT+QISEND"
107#define NBIOT2_CMD_QIRD "AT+QIRD"
108#define NBIOT2_CMD_QICLOSE "AT+QICLOSE"
114#define NBIOT2_PIN_STATE_HIGH 0x01
115#define NBIOT2_PIN_STATE_LOW 0x00
121#define NBIOT2_RSP_OK "OK"
122#define NBIOT2_RSP_ERROR "ERROR"
129#define NBIOT2_TX_DRV_BUFFER_SIZE 100
130#define NBIOT2_RX_DRV_BUFFER_SIZE 300
148#define NBIOT2_MAP_MIKROBUS( cfg, mikrobus ) \
149 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
150 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
151 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
152 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_INT );
#define NBIOT2_RX_DRV_BUFFER_SIZE
Definition nbiot2.h:130
#define NBIOT2_TX_DRV_BUFFER_SIZE
NB IoT 2 driver buffer size.
Definition nbiot2.h:129
void nbiot2_send_cmd_check(nbiot2_t *ctx, char *at_cmd_buf)
NB IoT 2 check the sent command.
err_t nbiot2_send_sms_pdu(nbiot2_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
NB IoT 2 send SMS in PDU mode.
void nbiot2_set_rst_pin_state(nbiot2_t *ctx, uint8_t state)
NB IoT 2 sets state of the RST pin.
void nbiot2_send_cmd(nbiot2_t *ctx, char *cmd)
NB IoT 2 send command function.
void nbiot2_hw_reset(nbiot2_t *ctx)
NB IoT 2 hardware reset function.
void nbiot2_send_cmd_with_parameter(nbiot2_t *ctx, char *at_cmd_buf, char *param_buf)
NB IoT 2 send command function with parameter.
void nbiot2_send_sms_text_mode(nbiot2_t *ctx, char *phone_number, char *message_context)
NB IoT 2 send SMS in text mode.
void nbiot2_cfg_setup(nbiot2_cfg_t *cfg)
NB IoT 2 configuration object setup function.
void nbiot2_set_wup_pin_state(nbiot2_t *ctx, uint8_t state)
NB IoT 2 sets state of the WUP pin.
void nbiot2_send_cmd_parameter_check(nbiot2_t *ctx, char *at_cmd_buf)
NB IoT 2 check the command parameters.
void nbiot2_set_apn(nbiot2_t *ctx, char *apn)
NB IoT 2 set sim card APN.
err_t nbiot2_generic_write(nbiot2_t *ctx, char *data_in, uint16_t len)
NB IoT 2 data writing function.
err_t nbiot2_generic_read(nbiot2_t *ctx, char *data_out, uint16_t len)
NB IoT 2 data reading function.
err_t nbiot2_init(nbiot2_t *ctx, nbiot2_cfg_t *cfg)
NB IoT 2 initialization function.
nbiot2_return_value_t
NB IoT 2 Click return value data.
Definition nbiot2.h:204
@ NBIOT2_ERROR_OVERFLOW
Definition nbiot2.h:207
@ NBIOT2_OK
Definition nbiot2.h:205
@ NBIOT2_ERROR_TIMEOUT
Definition nbiot2.h:208
@ NBIOT2_ERROR
Definition nbiot2.h:206
NB IoT 2 Click configuration object.
Definition nbiot2.h:181
uint32_t baud_rate
Definition nbiot2.h:191
pin_name_t wup
Definition nbiot2.h:188
bool uart_blocking
Definition nbiot2.h:192
uart_data_bits_t data_bit
Definition nbiot2.h:193
pin_name_t tx_pin
Definition nbiot2.h:184
pin_name_t rx_pin
Definition nbiot2.h:183
uart_stop_bits_t stop_bit
Definition nbiot2.h:195
uart_parity_t parity_bit
Definition nbiot2.h:194
pin_name_t rst
Definition nbiot2.h:187
NB IoT 2 Click context object.
Definition nbiot2.h:162
uart_t uart
Definition nbiot2.h:168
digital_out_t wup
Definition nbiot2.h:165
digital_out_t rst
Definition nbiot2.h:164