![]() |
RAFW Flexible Software Package Documentation
Release v2.1.0
|
|
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_cfg_t |
| struct | atcmd_w_api_t |
| struct | atcmd_w_instance_t |
Typedefs | |
| typedef void | atcmd_w_ctrl_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_cfg_t |
AT Configuration
| Data Fields | ||
|---|---|---|
| transfer_instance_t const * | 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 * | 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. |
| i2c_master_instance_t const * | p_i2c_master | |
| spi_instance_t const * | p_spi | |
| spi_flash_instance_t const * | p_spi_flash | |
| adc_instance_t const * | p_adc | |
| timer_instance_t const * | p_gpt | |
|
atcmd_transport_w_instance_t const * |
p_transport_instance | |
| void const * | p_extend | AT hardware dependent configuration. |
| 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(* | dataRead )(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(* | close )(atcmd_w_ctrl_t *const p_ctrl) |
| 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 internal read buffer is used until the available data is read. When internal read buffer is empty, a new data is requested from the device. 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::dataRead) (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 available data is read. When internal read buffer is empty, a new data is requested from the device only if the command is not complete. In case of complete command is expected and no data in the buffer left - corresponding error is thrown. 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 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] | p_info | Pointer to AT status information. |
| 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. |
| 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.