![]() |
Synergy Software Package User's Manual
|
#include <sf_comms_api.h>
Data Fields | |
| ssp_err_t(* | open )(sf_comms_ctrl_t *const p_ctrl, sf_comms_cfg_t const *const p_cfg) |
| ssp_err_t(* | close )(sf_comms_ctrl_t *const p_ctrl) |
| ssp_err_t(* | read )(sf_comms_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes, UINT const timeout) |
| ssp_err_t(* | write )(sf_comms_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint32_t const bytes, UINT const timeout) |
| ssp_err_t(* | lock )(sf_comms_ctrl_t *const p_ctrl, sf_comms_lock_t lock_type, UINT timeout) |
| ssp_err_t(* | unlock )(sf_comms_ctrl_t *const p_ctrl, sf_comms_lock_t lock_type) |
| ssp_err_t(* | versionGet )(ssp_version_t *const p_version) |
Framework communications API structure. Implementations will use the following API.
| ssp_err_t(* sf_comms_api_t::close) (sf_comms_ctrl_t *const p_ctrl) |
Clean up communications driver.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for communications driver. |
| ssp_err_t(* sf_comms_api_t::lock) (sf_comms_ctrl_t *const p_ctrl, sf_comms_lock_t lock_type, UINT timeout) |
Lock the communications driver. Reserve exclusive access to the communications driver.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for communications driver. |
| [in] | lock_type | Locking type, transmission channel or reception channel |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |
| ssp_err_t(* sf_comms_api_t::open) (sf_comms_ctrl_t *const p_ctrl, sf_comms_cfg_t const *const p_cfg) |
Initialize communications driver.
| [in,out] | p_ctrl | Pointer to a control structure allocated by user. The control structure is initialized in this function. |
| [in] | p_cfg | Pointer to configuration structure. All elements of the structure must be set by user. |
| ssp_err_t(* sf_comms_api_t::read) (sf_comms_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint32_t const bytes, UINT const timeout) |
Read data from communications driver. This call will return after the number of bytes requested is read or if a timeout occurs while waiting for access to the driver.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for communications driver. |
| [in] | p_dest | Destination address to read data out |
| [in] | bytes | Read data length |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |
| ssp_err_t(* sf_comms_api_t::unlock) (sf_comms_ctrl_t *const p_ctrl, sf_comms_lock_t lock_type) |
Unlock the communications driver. Release exclusive access to the communications driver.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for communications driver. |
| [in] | lock_type | Locking type, transmission channel or reception channel |
| ssp_err_t(* sf_comms_api_t::versionGet) (ssp_version_t *const p_version) |
Store the driver version in the provided p_version.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for communications driver. |
| [in] | p_version | Pointer to memory version to be stored. |
| ssp_err_t(* sf_comms_api_t::write) (sf_comms_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint32_t const bytes, UINT const timeout) |
Write data to communications driver. This call will return after all bytes are written or if a timeout occurs while waiting for access to the driver.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for communications driver. |
| [in] | p_src | Source address to read data out from |
| [in] | bytes | Write data length |
| [in] | timeout | ThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts. |