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 C3GAA_CMD_AT "AT"
74#define C3GAA_CMD_ATI "ATI"
75#define C3GAA_CMD_CFUN "AT+CFUN"
76#define C3GAA_CMD_CREG "AT+CREG"
77#define C3GAA_CMD_CGDCONT "AT+CGDCONT"
78#define C3GAA_CMD_CSQ "AT+CSQ"
79#define C3GAA_CMD_COPS "AT+COPS"
80#define C3GAA_CMD_CMGS "AT+CMGS"
81#define C3GAA_CMD_CMGF "AT+CMGF"
82#define C3GAA_CMD_QIACT "AT+QIACT"
83#define C3GAA_CMD_QIOPEN "AT+QIOPEN"
84#define C3GAA_CMD_QICLOSE "AT+QICLOSE"
85#define C3GAA_CMD_QISEND "AT+QISEND"
86#define C3GAA_CMD_QIRD "AT+QIRD"
92#define C3GAA_RSP_OK "OK"
93#define C3GAA_RSP_ERROR "ERROR"
100#define C3GAA_RX_DRV_BUFFER_SIZE 256
101#define C3GAA_TX_DRV_BUFFER_SIZE 256
119#define C3GAA_MAP_MIKROBUS( cfg, mikrobus ) \
120 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
121 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
122 cfg.sta = MIKROBUS( mikrobus, MIKROBUS_AN ); \
123 cfg.pwk = MIKROBUS( mikrobus, MIKROBUS_RST ); \
124 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
125 cfg.ring = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
126 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT )
c3gaa_return_value_t
3G-AA Click return value data.
Definition c3gaa.h:186
@ C3GAA_OK
Definition c3gaa.h:187
@ C3GAA_ERROR
Definition c3gaa.h:188
@ C3GAA_ERROR_CMD
Definition c3gaa.h:190
@ C3GAA_ERROR_UNKNOWN
Definition c3gaa.h:191
@ C3GAA_ERROR_TIMEOUT
Definition c3gaa.h:189
#define C3GAA_TX_DRV_BUFFER_SIZE
Definition c3gaa.h:101
#define C3GAA_RX_DRV_BUFFER_SIZE
3G-AA driver buffer size.
Definition c3gaa.h:100
err_t c3gaa_init(c3gaa_t *ctx, c3gaa_cfg_t *cfg)
3G-AA initialization function.
void c3gaa_send_cmd_par_check(c3gaa_t *ctx, uint8_t *at_cmd_buf)
Check the command parameters.
void c3gaa_send_cmd_check(c3gaa_t *ctx, uint8_t *at_cmd_buf)
Check the sent command.
uint8_t c3gaa_get_cts_pin(c3gaa_t *ctx)
3G-AA get cts pin function.
void c3gaa_cfg_setup(c3gaa_cfg_t *cfg)
3G-AA configuration object setup function.
void c3gaa_send_cmd_with_par(c3gaa_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
Send command function with parameter.
uint8_t c3gaa_get_sta_pin(c3gaa_t *ctx)
3G-AA get sta pin function.
void c3gaa_send_cmd(c3gaa_t *ctx, uint8_t *cmd)
Send command function.
void c3gaa_set_pwk_pin(c3gaa_t *ctx, uint8_t state)
3G-AA set pwk pin function.
err_t c3gaa_generic_read(c3gaa_t *ctx, uint8_t *data_out, uint16_t len)
3G-AA data reading function.
uint8_t c3gaa_get_ring_pin(c3gaa_t *ctx)
3G-AA get ring pin function.
err_t c3gaa_generic_write(c3gaa_t *ctx, uint8_t *data_in, uint16_t len)
3G-AA data writing function.
void c3gaa_send_sms_text(c3gaa_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
3G-AA send SMS in text mode.
void c3gaa_set_rts_pin(c3gaa_t *ctx, uint8_t state)
3G-AA set rts pin function.
err_t c3gaa_send_sms_pdu(c3gaa_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
3G-AA send SMS in PDU mode.
void c3gaa_set_sim_apn(c3gaa_t *ctx, uint8_t *sim_apn)
Set sim card APN.
3G-AA Click configuration object.
Definition c3gaa.h:160
pin_name_t sta
Definition c3gaa.h:166
pin_name_t rts
Definition c3gaa.h:168
uint32_t baud_rate
Definition c3gaa.h:173
pin_name_t pwk
Definition c3gaa.h:167
pin_name_t cts
Definition c3gaa.h:170
pin_name_t ring
Definition c3gaa.h:169
bool uart_blocking
Definition c3gaa.h:174
uart_data_bits_t data_bit
Definition c3gaa.h:175
pin_name_t tx_pin
Definition c3gaa.h:163
pin_name_t rx_pin
Definition c3gaa.h:162
uart_stop_bits_t stop_bit
Definition c3gaa.h:177
uart_parity_t parity_bit
Definition c3gaa.h:176
3G-AA Click context object.
Definition c3gaa.h:136
digital_in_t sta
Definition c3gaa.h:142
digital_out_t rts
Definition c3gaa.h:139
uart_t uart
Definition c3gaa.h:147
digital_in_t cts
Definition c3gaa.h:144
digital_out_t pwk
Definition c3gaa.h:138
digital_in_t ring
Definition c3gaa.h:143