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 NBIOT5_CMD_AT "AT"
74#define NBIOT5_CMD_CFUN "AT+CFUN"
75#define NBIOT5_CMD_CEREG "AT+CEREG"
76#define NBIOT5_CMD_CGDCONT "AT+CGDCONT"
77#define NBIOT5_CMD_CSQ "AT+CSQ"
78#define NBIOT5_CMD_COPS "AT+COPS"
79#define NBIOT5_CMD_CMGS "AT+CMGS"
80#define NBIOT5_CMD_CMGF "AT+CMGF"
81#define NBIOT5_CMD_ESOC "AT+ESOC"
82#define NBIOT5_CMD_ESOCON "AT+ESOCON"
83#define NBIOT5_CMD_ESOSEND "AT+ESOSEND"
84#define NBIOT5_CMD_ESOCL "AT+ESOCL"
90#define NBIOT5_RSP_OK "OK"
91#define NBIOT5_RSP_ERROR "ERROR"
98#define NBIOT5_RX_DRV_BUFFER_SIZE 256
99#define NBIOT5_TX_DRV_BUFFER_SIZE 256
117#define NBIOT5_MAP_MIKROBUS( cfg, mikrobus ) \
118 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
119 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
120 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_AN ); \
121 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
122 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
123 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM )
#define NBIOT5_TX_DRV_BUFFER_SIZE
Definition nbiot5.h:99
#define NBIOT5_RX_DRV_BUFFER_SIZE
NB IoT 5 driver buffer size.
Definition nbiot5.h:98
err_t nbiot5_send_sms_pdu(nbiot5_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
NB IoT 5 send SMS in PDU mode.
void nbiot5_send_cmd_with_par(nbiot5_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
void nbiot5_set_en_pin(nbiot5_t *ctx, uint8_t state)
NB IoT 5 set en pin function.
void nbiot5_set_wup_pin(nbiot5_t *ctx, uint8_t state)
NB IoT 5 set wup pin function.
void nbiot5_set_rst_pin(nbiot5_t *ctx, uint8_t state)
NB IoT 5 set rst pin function.
void nbiot5_send_sms_text(nbiot5_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
NB IoT 5 send SMS in text mode.
void nbiot5_send_cmd(nbiot5_t *ctx, uint8_t *cmd)
Send command function.
err_t nbiot5_init(nbiot5_t *ctx, nbiot5_cfg_t *cfg)
NB IoT 5 initialization function.
void nbiot5_send_cmd_check(nbiot5_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
err_t nbiot5_generic_read(nbiot5_t *ctx, uint8_t *data_out, uint16_t len)
NB IoT 5 data reading function.
void nbiot5_cfg_setup(nbiot5_cfg_t *cfg)
NB IoT 5 configuration object setup function.
void nbiot5_set_sim_apn(nbiot5_t *ctx, uint8_t *sim_apn)
Set sim card APN.
void nbiot5_set_cs_pin(nbiot5_t *ctx, uint8_t state)
NB IoT 5 set cs pin function.
void nbiot5_send_cmd_par_check(nbiot5_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
err_t nbiot5_generic_write(nbiot5_t *ctx, uint8_t *data_in, uint16_t len)
NB IoT 5 data writing function.
nbiot5_return_value_t
NB IoT 5 Click return value data.
Definition nbiot5.h:179
@ NBIOT5_ERROR_UNKNOWN
Definition nbiot5.h:184
@ NBIOT5_ERROR
Definition nbiot5.h:181
@ NBIOT5_OK
Definition nbiot5.h:180
@ NBIOT5_ERROR_CMD
Definition nbiot5.h:183
@ NBIOT5_ERROR_TIMEOUT
Definition nbiot5.h:182
NB IoT 5 Click configuration object.
Definition nbiot5.h:154
uint32_t baud_rate
Definition nbiot5.h:166
pin_name_t wup
Definition nbiot5.h:162
bool uart_blocking
Definition nbiot5.h:167
uart_data_bits_t data_bit
Definition nbiot5.h:168
pin_name_t tx_pin
Definition nbiot5.h:157
pin_name_t rx_pin
Definition nbiot5.h:156
uart_stop_bits_t stop_bit
Definition nbiot5.h:170
pin_name_t en
Definition nbiot5.h:163
uart_parity_t parity_bit
Definition nbiot5.h:169
pin_name_t rst
Definition nbiot5.h:160
pin_name_t cs
Definition nbiot5.h:161
NB IoT 5 Click context object.
Definition nbiot5.h:133
digital_out_t cs
Definition nbiot5.h:136
uart_t uart
Definition nbiot5.h:141
digital_out_t wup
Definition nbiot5.h:137
digital_out_t en
Definition nbiot5.h:138
digital_out_t rst
Definition nbiot5.h:135