28#ifndef C4GLTE2VOICENA_H
29#define C4GLTE2VOICENA_H
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 C4GLTE2VOICENA_CMD_AT "AT"
74#define C4GLTE2VOICENA_CMD_ATI "ATI"
75#define C4GLTE2VOICENA_CMD_CGMR "AT+CGMR"
76#define C4GLTE2VOICENA_CMD_CFUN "AT+CFUN"
77#define C4GLTE2VOICENA_CMD_CREG "AT+CREG"
78#define C4GLTE2VOICENA_CMD_CGREG "AT+CGREG"
79#define C4GLTE2VOICENA_CMD_CGDCONT "AT+CGDCONT"
80#define C4GLTE2VOICENA_CMD_CIMI "AT+CIMI"
81#define C4GLTE2VOICENA_CMD_CMEE "AT+CMEE"
82#define C4GLTE2VOICENA_CMD_CGATT "AT+CGATT"
83#define C4GLTE2VOICENA_CMD_CSQ "AT+CSQ"
84#define C4GLTE2VOICENA_CMD_COPS "AT+COPS"
85#define C4GLTE2VOICENA_CMD_CMGS "AT+CMGS"
86#define C4GLTE2VOICENA_CMD_CMGF "AT+CMGF"
87#define C4GLTE2VOICENA_CMD_CGACT "AT+CGACT"
88#define C4GLTE2VOICENA_CMD_USOCR "AT+USOCR"
89#define C4GLTE2VOICENA_CMD_USOCO "AT+USOCO"
90#define C4GLTE2VOICENA_CMD_USOWR "AT+USOWR"
91#define C4GLTE2VOICENA_CMD_USOST "AT+USOST"
92#define C4GLTE2VOICENA_CMD_USORD "AT+USORD"
93#define C4GLTE2VOICENA_CMD_USORF "AT+USORF"
94#define C4GLTE2VOICENA_CMD_USOCL "AT+USOCL"
95#define C4GLTE2VOICENA_CMD_UGPS "AT+UGPS"
96#define C4GLTE2VOICENA_CMD_UGGGA "AT+UGGGA"
102#define C4GLTE2VOICENA_RSP_OK "OK"
103#define C4GLTE2VOICENA_RSP_ERROR "ERROR"
109#define C4GLTE2VOICENA_POWER_STATE_OFF 0
110#define C4GLTE2VOICENA_POWER_STATE_ON 1
117#define C4GLTE2VOICENA_DRV_BUFFER_SIZE 256
135#define C4GLTE2VOICENA_MAP_MIKROBUS( cfg, mikrobus ) \
136 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
137 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
138 cfg.sts = MIKROBUS( mikrobus, MIKROBUS_AN ); \
139 cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_RST ); \
140 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
141 cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
142 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
c4glte2voicena_return_value_t
4G LTE 2 Voice-NA Click return value data.
Definition c4glte2voicena.h:202
@ C4GLTE2VOICENA_OK
Definition c4glte2voicena.h:203
@ C4GLTE2VOICENA_ERROR
Definition c4glte2voicena.h:204
@ C4GLTE2VOICENA_ERROR_CMD
Definition c4glte2voicena.h:206
@ C4GLTE2VOICENA_ERROR_UNKNOWN
Definition c4glte2voicena.h:207
@ C4GLTE2VOICENA_ERROR_TIMEOUT
Definition c4glte2voicena.h:205
#define C4GLTE2VOICENA_DRV_BUFFER_SIZE
4G LTE 2 Voice-NA driver buffer size.
Definition c4glte2voicena.h:117
void c4glte2voicena_set_sim_apn(c4glte2voicena_t *ctx, char *sim_apn)
Set sim card APN.
void c4glte2voicena_set_power_state(c4glte2voicena_t *ctx, uint8_t state)
4G LTE 2 Voice-NA set power state function.
err_t c4glte2voicena_init(c4glte2voicena_t *ctx, c4glte2voicena_cfg_t *cfg)
4G LTE 2 Voice-NA initialization function.
err_t c4glte2voicena_generic_write(c4glte2voicena_t *ctx, char *data_in, uint16_t len)
4G LTE 2 Voice-NA data writing function.
void c4glte2voicena_set_rts_pin(c4glte2voicena_t *ctx, uint8_t state)
4G LTE 2 Voice-NA set RTS pin function.
err_t c4glte2voicena_generic_read(c4glte2voicena_t *ctx, char *data_out, uint16_t len)
4G LTE 2 Voice-NA data reading function.
err_t c4glte2voicena_send_sms_pdu(c4glte2voicena_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
4G LTE 2 Voice-NA send SMS in PDU mode.
void c4glte2voicena_send_cmd_par(c4glte2voicena_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
void c4glte2voicena_send_cmd(c4glte2voicena_t *ctx, char *cmd)
Send command function.
void c4glte2voicena_send_cmd_check(c4glte2voicena_t *ctx, char *at_cmd_buf)
Check the sent command.
void c4glte2voicena_cfg_setup(c4glte2voicena_cfg_t *cfg)
4G LTE 2 Voice-NA configuration object setup function.
void c4glte2voicena_set_sts_pin(c4glte2voicena_t *ctx, uint8_t state)
4G LTE 2 Voice-NA set STS pin function.
uint8_t c4glte2voicena_get_cts_pin(c4glte2voicena_t *ctx)
4G LTE 2 Voice-NA get CTS pin function.
void c4glte2voicena_set_pwr_pin(c4glte2voicena_t *ctx, uint8_t state)
4G LTE 2 Voice-NA set PWR pin function.
void c4glte2voicena_send_sms_text(c4glte2voicena_t *ctx, char *phone_number, char *sms_text)
4G LTE 2 Voice-NA send SMS in text mode.
uint8_t c4glte2voicena_get_ri_pin(c4glte2voicena_t *ctx)
4G LTE 2 Voice-NA get RI pin function.
4G LTE 2 Voice-NA Click configuration object.
Definition c4glte2voicena.h:176
pin_name_t rts
Definition c4glte2voicena.h:184
uint32_t baud_rate
Definition c4glte2voicena.h:189
pin_name_t sts
Definition c4glte2voicena.h:182
pin_name_t cts
Definition c4glte2voicena.h:186
bool uart_blocking
Definition c4glte2voicena.h:190
pin_name_t ri
Definition c4glte2voicena.h:185
uart_data_bits_t data_bit
Definition c4glte2voicena.h:191
pin_name_t tx_pin
Definition c4glte2voicena.h:179
pin_name_t pwr
Definition c4glte2voicena.h:183
pin_name_t rx_pin
Definition c4glte2voicena.h:178
uart_stop_bits_t stop_bit
Definition c4glte2voicena.h:193
uart_parity_t parity_bit
Definition c4glte2voicena.h:192
4G LTE 2 Voice-NA Click context object.
Definition c4glte2voicena.h:152
digital_out_t pwr
Definition c4glte2voicena.h:155
digital_out_t rts
Definition c4glte2voicena.h:156
digital_in_t ri
Definition c4glte2voicena.h:159
uart_t uart
Definition c4glte2voicena.h:163
digital_out_t sts
Definition c4glte2voicena.h:154
digital_in_t cts
Definition c4glte2voicena.h:160