![]() |
RAFW Flexible Software Package Documentation
Release v2.0.1
|
|
Interface for AT communications.
The AT interface provides common APIs for AT HAL drivers. The AT interface supports the following features:
Data Structures | |
| struct | atcmd_w_info_t |
| struct | atcmd_w_callback_args_t |
| struct | atcmd_w_cfg_t |
| struct | atcmd_w_api_t |
| struct | atcmd_w_instance_t |
Typedefs | |
| typedef void | atcmd_w_ctrl_t |
Enumerations | |
| enum | atcmd_w_event_t |
| struct atcmd_w_info_t |
AT driver specific information
| Data Fields | ||
|---|---|---|
| uint32_t | write_bytes_max |
Maximum bytes that can be written at this time. Only applies if atcmd_w_cfg_t::p_transfer_tx is not NULL. |
| uint32_t | read_bytes_max |
Maximum bytes that are available to read at one time. Only applies if atcmd_w_cfg_t::p_transfer_rx is not NULL. |
| struct atcmd_w_callback_args_t |
AT Callback parameter definition
| Data Fields | ||
|---|---|---|
| atcmd_w_event_t | event | Event code. |
| uint32_t | data |
Contains the next character received for the events ATCMD_W_EVENT_RX_CHAR, ATCMD_W_EVENT_ERR_PARITY, ATCMD_W_EVENT_ERR_FRAMING, or ATCMD_W_EVENT_ERR_OVERFLOW. Otherwise unused. |
| char | at_data | |
| char | at_buff[ATCMD_W_BUFF_MAX] | |
| void const * | p_context | Context provided to user during callback. |
| struct atcmd_w_cfg_t |
AT Configuration
Data Fields | |
| transfer_instance_t const * | p_transfer_rx |
| transfer_instance_t const * | p_transfer_tx |
| void(* | p_callback )(atcmd_w_callback_args_t *p_args) |
| Pointer to callback function. | |
| void const * | p_context |
| User defined context passed into callback function. | |
| void const * | p_extend |
| AT hardware dependent configuration. | |
| transfer_instance_t const* atcmd_w_cfg_t::p_transfer_rx |
Optional transfer instance used to receive multiple bytes without interrupts. Set to NULL if unused. If NULL, the number of bytes allowed in the read API is limited to one byte at a time.
| transfer_instance_t const* atcmd_w_cfg_t::p_transfer_tx |
Optional transfer instance used to send multiple bytes without interrupts. Set to NULL if unused. If NULL, the number of bytes allowed in the write APIs is limited to one byte at a time.
| struct atcmd_w_api_t |
Shared Interface definition for AT
Data Fields | |
| fsp_err_t(* | open )(atcmd_w_ctrl_t *const p_ctrl, atcmd_w_cfg_t const *const p_cfg) |
| fsp_err_t(* | read )(atcmd_w_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes) |
| fsp_err_t(* | write )(atcmd_w_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint32_t const bytes) |
| fsp_err_t(* | infoGet )(atcmd_w_ctrl_t *const p_ctrl, atcmd_w_info_t *const p_info) |
| fsp_err_t(* | communicationAbort )(atcmd_w_ctrl_t *const p_ctrl) |
| fsp_err_t(* | callbackSet )(atcmd_w_ctrl_t *const p_ctrl, void(*p_callback)(atcmd_w_callback_args_t *), void const *const p_context, atcmd_w_callback_args_t *const p_callback_memory) |
| fsp_err_t(* | close )(atcmd_w_ctrl_t *const p_ctrl) |
| fsp_err_t(* | readStop )(atcmd_w_ctrl_t *const p_ctrl, uint32_t *remaining_bytes) |
| fsp_err_t(* atcmd_w_api_t::open) (atcmd_w_ctrl_t *const p_ctrl, atcmd_w_cfg_t const *const p_cfg) |
Open AT device.
| [in,out] | p_ctrl | Pointer to the AT control block. Must be declared by user. Value set here. |
| [in] | atcmd_w_cfg_t | Pointer to AT configuration structure. All elements of this structure must be set by user. |
| fsp_err_t(* atcmd_w_api_t::read) (atcmd_w_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes) |
Read from AT device. The read buffer is used until the read is complete. When a transfer is complete, the callback is called with event ATCMD_W_EVENT_RX_COMPLETE. Bytes received outside an active transfer are received in the callback function with event ATCMD_W_EVENT_RX_CHAR. The maximum transfer size is reported by infoGet().
| [in] | p_ctrl | Pointer to the AT control block for the channel. |
| [in] | p_dest | Destination address to read data from. |
| [in] | bytes | Read data length. |
| fsp_err_t(* atcmd_w_api_t::write) (atcmd_w_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint32_t const bytes) |
Write to AT device. The write buffer is used until write is complete. Do not overwrite write buffer contents until the write is finished. When the write is complete (all bytes are fully transmitted on the wire), the callback called with event ATCMD_W_EVENT_TX_COMPLETE. The maximum transfer size is reported by infoGet().
| [in] | p_ctrl | Pointer to the AT control block. |
| [in] | p_src | Source address to write data to. |
| [in] | bytes | Write data length. |
| fsp_err_t(* atcmd_w_api_t::infoGet) (atcmd_w_ctrl_t *const p_ctrl, atcmd_w_info_t *const p_info) |
Get the driver specific information.
| [in] | p_ctrl | Pointer to the AT control block. |
| [in] | baudrate | Baud rate in bps. |
| fsp_err_t(* atcmd_w_api_t::communicationAbort) (atcmd_w_ctrl_t *const p_ctrl) |
Abort ongoing transfer.
| [in] | p_ctrl | Pointer to the AT control block. |
| fsp_err_t(* atcmd_w_api_t::callbackSet) (atcmd_w_ctrl_t *const p_ctrl, void(*p_callback)(atcmd_w_callback_args_t *), void const *const p_context, atcmd_w_callback_args_t *const p_callback_memory) |
Specify callback function and optional context pointer and working memory pointer.
| [in] | p_ctrl | Pointer to the AT control block. |
| [in] | p_callback | Callback function |
| [in] | p_context | Pointer to send to callback function |
| [in] | p_working_memory | Pointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback. |
| fsp_err_t(* atcmd_w_api_t::close) (atcmd_w_ctrl_t *const p_ctrl) |
Close AT device.
| [in] | p_ctrl | Pointer to the AT control block. |
| fsp_err_t(* atcmd_w_api_t::readStop) (atcmd_w_ctrl_t *const p_ctrl, uint32_t *remaining_bytes) |
Stop ongoing read and return the number of bytes remaining in the read.
| [in] | p_ctrl | Pointer to the AT control block. |
| [in,out] | remaining_bytes | Pointer to location to store remaining bytes for read. |
| struct atcmd_w_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| atcmd_w_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| atcmd_w_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| atcmd_w_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void atcmd_w_ctrl_t |
AT control block. Allocate an instance specific control block to pass into the AT API calls.
| enum atcmd_w_event_t |
AT Event codes