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)
 

Detailed Description

Framework communications API structure. Implementations will use the following API.

Field Documentation

◆ close

ssp_err_t(* sf_comms_api_t::close) (sf_comms_ctrl_t *const p_ctrl)

Clean up communications driver.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for communications driver.

◆ lock

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.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for communications driver.
[in]lock_typeLocking type, transmission channel or reception channel
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

◆ open

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.

Parameters
[in,out]p_ctrlPointer to a control structure allocated by user. The control structure is initialized in this function.
[in]p_cfgPointer to configuration structure. All elements of the structure must be set by user.

◆ read

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.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for communications driver.
[in]p_destDestination address to read data out
[in]bytesRead data length
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

◆ unlock

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.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for communications driver.
[in]lock_typeLocking type, transmission channel or reception channel

◆ versionGet

ssp_err_t(* sf_comms_api_t::versionGet) (ssp_version_t *const p_version)

Store the driver version in the provided p_version.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for communications driver.
[in]p_versionPointer to memory version to be stored.

◆ write

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.

Parameters
[in]p_ctrlPointer to device control block initialized in Open call for communications driver.
[in]p_srcSource address to read data out from
[in]bytesWrite data length
[in]timeoutThreadX timeout. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout value (0x00000001 through 0xFFFFFFFE) in ThreadX tick counts.

The documentation for this struct was generated from the following file: