Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
63 #define NBIOT_MAP_MIKROBUS( cfg, mikrobus ) \
64 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
65 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
66 cfg.stat = MIKROBUS( mikrobus, MIKROBUS_AN ); \
67 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
74 #define NBIOT_RETVAL uint8_t
77 #define NBIOT_INIT_ERROR 0xFF
84 #define NBIOT_CMD_AT "AT"
85 #define NBIOT_CMD_ATI "ATI"
86 #define NBIOT_CMD_CGMR "AT+CGMR"
88 #define NBIOT_CMD_CFUN "AT+CFUN"
89 #define NBIOT_CMD_CEREG "AT+CEREG"
90 #define NBIOT_CMD_CGDCONT "AT+CGDCONT"
91 #define NBIOT_CMD_CIMI "AT+CIMI"
92 #define NBIOT_CMD_CGATT "AT+CGATT"
93 #define NBIOT_CMD_CSQ "AT+CSQ"
94 #define NBIOT_CMD_CESQ "AT+CESQ"
95 #define NBIOT_CMD_COPS "AT+COPS"
102 #define DRV_RX_BUFFER_SIZE 500
103 #define DRV_TX_BUFFER_SIZE 100
#define DRV_RX_BUFFER_SIZE
Definition: nbiot.h:102
uint8_t nbiot_get_stat(nbiot_t *ctx)
STAT Pin Get function.
uart_t uart
Definition: nbiot.h:127
uint8_t nbiot_actuator_sw_t
Error type.
Definition: nbiot.h:163
int16_t nbiot_actuator_cnt_t
Definition: nbiot.h:166
Click configuration structure definition.
Definition: nbiot.h:138
Click ctx object definition.
Definition: nbiot.h:116
uart_stop_bits_t stop_bit
Definition: nbiot.h:155
pin_name_t rst
Definition: nbiot.h:147
void nbiot_send_cmd_with_parameter(nbiot_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void nbiot_set_rst(nbiot_t *ctx, uint8_t state)
Sets state of the RST pin.
void nbiot_set_sim_apn(nbiot_t *ctx, char *sim_apn)
Set sim card APN.
uint32_t baud_rate
Definition: nbiot.h:151
err_t nbiot_init(nbiot_t *ctx, nbiot_cfg_t *cfg)
NB IoT initialization function.
char nbiot_actuator_str_t
Definition: nbiot.h:169
void nbiot_send_cmd(nbiot_t *ctx, char *cmd)
Send command function.
bool uart_blocking
Definition: nbiot.h:152
pin_name_t rx_pin
Definition: nbiot.h:141
void nbiot_send_cmd_check(nbiot_t *ctx, char *at_cmd_buf)
Check the sent command.
digital_in_t stat
Definition: nbiot.h:123
uint8_t nbiot_error_t
Definition: nbiot.h:172
digital_out_t rst
Definition: nbiot.h:119
uart_data_bits_t data_bit
Definition: nbiot.h:153
#define DRV_TX_BUFFER_SIZE
Definition: nbiot.h:103
void nbiot_power_on(nbiot_t *ctx)
NB IoT module power on.
pin_name_t tx_pin
Definition: nbiot.h:142
void nbiot_send_cmd_parameter_check(nbiot_t *ctx, char *at_cmd_buf)
Check the command parameters.
uart_parity_t parity_bit
Definition: nbiot.h:154
err_t nbiot_generic_write(nbiot_t *ctx, char *data_buf, uint16_t len)
NB IoT data writing function.
void nbiot_cfg_setup(nbiot_cfg_t *cfg)
NB IoT configuration object setup function.
pin_name_t stat
Definition: nbiot.h:146
err_t nbiot_generic_read(nbiot_t *ctx, char *data_buf, uint16_t max_len)
NB IoT data reading function.