42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define C5GNBIOT_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.on = MIKROBUS( mikrobus, MIKROBUS_RST ); \
71 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
79#define C5GNBIOT_MODULE_POWER_ON 1
80#define C5GNBIOT_MODULE_POWER_OFF 0
87#define C5GNBIOT_CMD_AT "AT"
88#define C5GNBIOT_CMD_ATI "ATI"
89#define C5GNBIOT_CMD_CGMR "AT+CGMR"
91#define C5GNBIOT_CMD_CFUN "AT+CFUN"
92#define C5GNBIOT_CMD_CREG "AT+CREG"
93#define C5GNBIOT_CMD_CEREG "AT+CEREG"
94#define C5GNBIOT_CMD_CGDCONT "AT+CGDCONT"
95#define C5GNBIOT_CMD_CIMI "AT+CIMI"
96#define C5GNBIOT_CMD_CGATT "AT+CGATT"
97#define C5GNBIOT_CMD_CESQ "AT+CESQ"
98#define C5GNBIOT_CMD_COPS "AT+COPS"
99#define C5GNBIOT_CMD_CMGS "AT+CMGS"
106#define DRV_RX_BUFFER_SIZE 300
107#define DRV_TX_BUFFER_SIZE 300
354 char *phone_number,
char *sms_text );
#define DRV_RX_BUFFER_SIZE
Definition c5gnbiot.h:106
#define DRV_TX_BUFFER_SIZE
Definition c5gnbiot.h:107
void c5gnbiot_send_cmd_with_parameter(c5gnbiot_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
err_t c5gnbiot_send_text_message(c5gnbiot_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
5G NB IoT send SMS in PDU mode.
err_t c5gnbiot_init(c5gnbiot_t *ctx, c5gnbiot_cfg_t *cfg)
5G NB IoT initialization function.
uint8_t c5gnbiot_get_cts(c5gnbiot_t *ctx)
CTS Pin Get function.
void c5gnbiot_send_cmd_parameter_check(c5gnbiot_t *ctx, char *at_cmd_buf)
Check the command parameters.
void c5gnbiot_power_on(c5gnbiot_t *ctx)
5G NB IoT module power on.
void c5gnbiot_send_cmd(c5gnbiot_t *ctx, char *cmd)
Send command function.
void c5gnbiot_cfg_setup(c5gnbiot_cfg_t *cfg)
5G NB IoT configuration object setup function.
void c5gnbiot_set_rts(c5gnbiot_t *ctx, uint8_t state)
Sets state of the RTS pin.
void c5gnbiot_set_on(c5gnbiot_t *ctx, uint8_t state)
Sets state of the ON pin.
void c5gnbiot_send_cmd_check(c5gnbiot_t *ctx, char *at_cmd_buf)
Check the sent command.
err_t c5gnbiot_generic_write(c5gnbiot_t *ctx, char *data_buf, uint16_t len)
5G NB IoT data writing function.
err_t c5gnbiot_generic_read(c5gnbiot_t *ctx, char *data_buf, uint16_t max_len)
5G NB IoT data reading function.
void c5gnbiot_set_sim_apn(c5gnbiot_t *ctx, char *sim_apn)
Set sim card APN.
c5gnbiot_return_value_t
5G NB IoT Click return value data.
Definition c5gnbiot.h:170
@ C5GNBIOT_OK
Definition c5gnbiot.h:171
@ C5GNBIOT_ERROR
Definition c5gnbiot.h:172
Click configuration structure definition.
Definition c5gnbiot.h:143
pin_name_t rts
Definition c5gnbiot.h:153
uint32_t baud_rate
Definition c5gnbiot.h:157
pin_name_t cts
Definition c5gnbiot.h:152
bool uart_blocking
Definition c5gnbiot.h:158
uart_data_bits_t data_bit
Definition c5gnbiot.h:159
pin_name_t on
Definition c5gnbiot.h:151
pin_name_t tx_pin
Definition c5gnbiot.h:147
pin_name_t rx_pin
Definition c5gnbiot.h:146
uart_stop_bits_t stop_bit
Definition c5gnbiot.h:161
uart_parity_t parity_bit
Definition c5gnbiot.h:160
Click ctx object definition.
Definition c5gnbiot.h:120
digital_out_t on
Definition c5gnbiot.h:123
digital_out_t rts
Definition c5gnbiot.h:124
uart_t uart
Definition c5gnbiot.h:132
digital_in_t cts
Definition c5gnbiot.h:128