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 C4GLTENA_CMD_AT "AT"
74#define C4GLTENA_CMD_ATI "ATI"
75#define C4GLTENA_CMD_CGMR "AT+CGMR"
76#define C4GLTENA_CMD_CFUN "AT+CFUN"
77#define C4GLTENA_CMD_CREG "AT+CREG"
78#define C4GLTENA_CMD_CGREG "AT+CGREG"
79#define C4GLTENA_CMD_CGDCONT "AT+CGDCONT"
80#define C4GLTENA_CMD_CIMI "AT+CIMI"
81#define C4GLTENA_CMD_CMEE "AT+CMEE"
82#define C4GLTENA_CMD_CGATT "AT+CGATT"
83#define C4GLTENA_CMD_CSQ "AT+CSQ"
84#define C4GLTENA_CMD_COPS "AT+COPS"
85#define C4GLTENA_CMD_CMGS "AT+CMGS"
86#define C4GLTENA_CMD_CMGF "AT+CMGF"
92#define DRV_RX_BUFFER_SIZE 256
93#define DRV_TX_BUFFER_SIZE 256
111#define C4GLTENA_MAP_MIKROBUS( cfg, mikrobus ) \
112 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
113 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
114 cfg.sta = MIKROBUS( mikrobus, MIKROBUS_AN ); \
115 cfg.pwk = MIKROBUS( mikrobus, MIKROBUS_RST ); \
116 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
117 cfg.ring = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
118 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
c4gltena_return_value_t
4G LTE-NA Click return value data.
Definition c4gltena.h:178
@ C4GLTENA_OK
Definition c4gltena.h:179
@ C4GLTENA_ERROR
Definition c4gltena.h:180
#define DRV_RX_BUFFER_SIZE
4G LTE-NA driver buffer size.
Definition c4gltena.h:92
#define DRV_TX_BUFFER_SIZE
Definition c4gltena.h:93
err_t c4gltena_generic_read(c4gltena_t *ctx, char *data_buf, uint16_t max_len)
4G LTE-NA data reading function.
void c4gltena_module_power_on(c4gltena_t *ctx)
Power ON the module function.
void c4gltena_send_cmd(c4gltena_t *ctx, char *cmd)
Send command function.
void c4gltena_set_rts_pin(c4gltena_t *ctx, uint8_t state)
Sets state of the RTS pin.
err_t c4gltena_send_sms_pdu(c4gltena_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
4G LTE-NA send SMS in PDU mode.
void c4gltena_send_cmd_with_parameter(c4gltena_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void c4gltena_cfg_setup(c4gltena_cfg_t *cfg)
4G LTE-NA configuration object setup function.
err_t c4gltena_generic_write(c4gltena_t *ctx, char *data_buf, uint16_t len)
4G LTE-NA data writing function.
uint8_t c4gltena_get_sta_pin(c4gltena_t *ctx)
STA Pin Get function.
err_t c4gltena_init(c4gltena_t *ctx, c4gltena_cfg_t *cfg)
4G LTE-NA initialization function.
void c4gltena_set_sim_apn(c4gltena_t *ctx, char *sim_apn)
Set sim card APN.
void c4gltena_send_cmd_check(c4gltena_t *ctx, char *at_cmd_buf)
Check the sent command.
void c4gltena_send_cmd_parameter_check(c4gltena_t *ctx, char *at_cmd_buf)
Check the command parameters.
void c4gltena_set_pwk_pin(c4gltena_t *ctx, uint8_t state)
Sets state of the PWK pin.
uint8_t c4gltena_get_ring_pin(c4gltena_t *ctx)
RING Pin Get function.
void c4gltena_send_sms_text(c4gltena_t *ctx, char *phone_number, char *sms_text)
4G LTE-NA send SMS in text mode.
uint8_t c4gltena_get_cts_pin(c4gltena_t *ctx)
CTS Pin Get function.
4G LTE-NA Click configuration object.
Definition c4gltena.h:152
pin_name_t sta
Definition c4gltena.h:158
pin_name_t rts
Definition c4gltena.h:160
uint32_t baud_rate
Definition c4gltena.h:165
pin_name_t pwk
Definition c4gltena.h:159
pin_name_t cts
Definition c4gltena.h:162
pin_name_t ring
Definition c4gltena.h:161
bool uart_blocking
Definition c4gltena.h:166
uart_data_bits_t data_bit
Definition c4gltena.h:167
pin_name_t tx_pin
Definition c4gltena.h:155
pin_name_t rx_pin
Definition c4gltena.h:154
uart_stop_bits_t stop_bit
Definition c4gltena.h:169
uart_parity_t parity_bit
Definition c4gltena.h:168
4G LTE-NA Click context object.
Definition c4gltena.h:128
digital_in_t sta
Definition c4gltena.h:134
digital_out_t rts
Definition c4gltena.h:131
uart_t uart
Definition c4gltena.h:139
digital_in_t cts
Definition c4gltena.h:136
digital_out_t pwk
Definition c4gltena.h:130
digital_in_t ring
Definition c4gltena.h:135