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 C4GLTE2VOICE_CMD_AT "AT"
74#define C4GLTE2VOICE_CMD_ATI "ATI"
75#define C4GLTE2VOICE_CMD_CGMR "AT+CGMR"
76#define C4GLTE2VOICE_CMD_CFUN "AT+CFUN"
77#define C4GLTE2VOICE_CMD_CREG "AT+CREG"
78#define C4GLTE2VOICE_CMD_CGREG "AT+CGREG"
79#define C4GLTE2VOICE_CMD_CGDCONT "AT+CGDCONT"
80#define C4GLTE2VOICE_CMD_CIMI "AT+CIMI"
81#define C4GLTE2VOICE_CMD_CMEE "AT+CMEE"
82#define C4GLTE2VOICE_CMD_CGATT "AT+CGATT"
83#define C4GLTE2VOICE_CMD_CSQ "AT+CSQ"
84#define C4GLTE2VOICE_CMD_COPS "AT+COPS"
85#define C4GLTE2VOICE_CMD_CMGS "AT+CMGS"
86#define C4GLTE2VOICE_CMD_CMGF "AT+CMGF"
87#define C4GLTE2VOICE_CMD_CGACT "AT+CGACT"
88#define C4GLTE2VOICE_CMD_USOCR "AT+USOCR"
89#define C4GLTE2VOICE_CMD_USOCO "AT+USOCO"
90#define C4GLTE2VOICE_CMD_USOWR "AT+USOWR"
91#define C4GLTE2VOICE_CMD_USOST "AT+USOST"
92#define C4GLTE2VOICE_CMD_USORD "AT+USORD"
93#define C4GLTE2VOICE_CMD_USORF "AT+USORF"
94#define C4GLTE2VOICE_CMD_USOCL "AT+USOCL"
95#define C4GLTE2VOICE_CMD_UGPS "AT+UGPS"
96#define C4GLTE2VOICE_CMD_UGGGA "AT+UGGGA"
102#define C4GLTE2VOICE_RSP_OK "OK"
103#define C4GLTE2VOICE_RSP_ERROR "ERROR"
109#define C4GLTE2VOICE_POWER_STATE_OFF 0
110#define C4GLTE2VOICE_POWER_STATE_ON 1
117#define DRV_BUFFER_SIZE 256
135#define C4GLTE2VOICE_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 );
c4glte2voice_return_value_t
4G LTE 2 Voice Click return value data.
Definition c4glte2voice.h:202
@ C4GLTE2VOICE_ERROR_CMD
Definition c4glte2voice.h:206
@ C4GLTE2VOICE_ERROR_UNKNOWN
Definition c4glte2voice.h:207
@ C4GLTE2VOICE_OK
Definition c4glte2voice.h:203
@ C4GLTE2VOICE_ERROR_TIMEOUT
Definition c4glte2voice.h:205
@ C4GLTE2VOICE_ERROR
Definition c4glte2voice.h:204
#define DRV_BUFFER_SIZE
4G LTE 2 Voice driver buffer size.
Definition c4glte2voice.h:117
err_t c4glte2voice_send_sms_pdu(c4glte2voice_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
4G LTE 2 Voice send SMS in PDU mode.
uint8_t c4glte2voice_get_ri_pin(c4glte2voice_t *ctx)
4G LTE 2 Voice get RI pin function.
uint8_t c4glte2voice_get_cts_pin(c4glte2voice_t *ctx)
4G LTE 2 Voice get CTS pin function.
void c4glte2voice_send_sms_text(c4glte2voice_t *ctx, char *phone_number, char *sms_text)
4G LTE 2 Voice send SMS in text mode.
void c4glte2voice_set_sts_pin(c4glte2voice_t *ctx, uint8_t state)
4G LTE 2 Voice set STS pin function.
err_t c4glte2voice_init(c4glte2voice_t *ctx, c4glte2voice_cfg_t *cfg)
4G LTE 2 Voice initialization function.
err_t c4glte2voice_generic_write(c4glte2voice_t *ctx, char *data_in, uint16_t len)
4G LTE 2 Voice data writing function.
void c4glte2voice_send_cmd_parameter_check(c4glte2voice_t *ctx, char *at_cmd_buf)
Check the command parameters.
void c4glte2voice_set_rts_pin(c4glte2voice_t *ctx, uint8_t state)
4G LTE 2 Voice set RTS pin function.
void c4glte2voice_set_pwr_pin(c4glte2voice_t *ctx, uint8_t state)
4G LTE 2 Voice set PWR pin function.
void c4glte2voice_send_cmd_with_parameter(c4glte2voice_t *ctx, char *at_cmd_buf, char *param_buf)
Send command function with parameter.
err_t c4glte2voice_generic_read(c4glte2voice_t *ctx, char *data_out, uint16_t len)
4G LTE 2 Voice data reading function.
void c4glte2voice_send_cmd_check(c4glte2voice_t *ctx, char *at_cmd_buf)
Check the sent command.
void c4glte2voice_set_power_state(c4glte2voice_t *ctx, uint8_t state)
4G LTE 2 Voice set power state function.
void c4glte2voice_cfg_setup(c4glte2voice_cfg_t *cfg)
4G LTE 2 Voice configuration object setup function.
void c4glte2voice_send_cmd(c4glte2voice_t *ctx, char *cmd)
Send command function.
void c4glte2voice_set_sim_apn(c4glte2voice_t *ctx, char *sim_apn)
Set sim card APN.
4G LTE 2 Voice Click configuration object.
Definition c4glte2voice.h:176
pin_name_t rts
Definition c4glte2voice.h:184
uint32_t baud_rate
Definition c4glte2voice.h:189
pin_name_t sts
Definition c4glte2voice.h:182
pin_name_t cts
Definition c4glte2voice.h:186
bool uart_blocking
Definition c4glte2voice.h:190
pin_name_t ri
Definition c4glte2voice.h:185
uart_data_bits_t data_bit
Definition c4glte2voice.h:191
pin_name_t tx_pin
Definition c4glte2voice.h:179
pin_name_t pwr
Definition c4glte2voice.h:183
pin_name_t rx_pin
Definition c4glte2voice.h:178
uart_stop_bits_t stop_bit
Definition c4glte2voice.h:193
uart_parity_t parity_bit
Definition c4glte2voice.h:192
4G LTE 2 Voice Click context object.
Definition c4glte2voice.h:152
digital_out_t pwr
Definition c4glte2voice.h:155
digital_out_t rts
Definition c4glte2voice.h:156
digital_in_t ri
Definition c4glte2voice.h:159
uart_t uart
Definition c4glte2voice.h:163
digital_out_t sts
Definition c4glte2voice.h:154
digital_in_t cts
Definition c4glte2voice.h:160