Synergy Software Package User's Manual

#include <r_spi_api.h>

Data Fields

ssp_err_t(* open )(spi_ctrl_t *p_ctrl, spi_cfg_t const *const p_cfg)
 
ssp_err_t(* read )(spi_ctrl_t *const p_ctrl, void const *p_dest, uint32_t const length, spi_bit_width_t const bit_width)
 
ssp_err_t(* write )(spi_ctrl_t *const p_ctrl, void const *p_src, uint32_t const length, spi_bit_width_t const bit_width)
 
ssp_err_t(* writeRead )(spi_ctrl_t *const p_ctrl, void const *p_src, void const *p_dest, uint32_t const length, spi_bit_width_t const bit_width)
 
ssp_err_t(* close )(spi_ctrl_t *const p_ctrl)
 
ssp_err_t(* versionGet )(ssp_version_t *p_version)
 

Detailed Description

Shared Interface definition for SPI

Field Documentation

◆ close

ssp_err_t(* spi_api_t::close) (spi_ctrl_t *const p_ctrl)

Remove power to the SPI channel designated by the handle and disable the associated interrupts.

Implemented as
Parameters
[in]p_ctrlPointer to the control block for the channel.

◆ open

ssp_err_t(* spi_api_t::open) (spi_ctrl_t *p_ctrl, spi_cfg_t const *const p_cfg)

Initialize a channel for SPI communication mode.

Implemented as
Parameters
[in,out]p_ctrlPointer to user-provided storage for the control block.
[in]p_cfgPointer to SPI configuration structure.

◆ read

ssp_err_t(* spi_api_t::read) (spi_ctrl_t *const p_ctrl, void const *p_dest, uint32_t const length, spi_bit_width_t const bit_width)

Receive data from an SPI device.

Implemented as
Parameters
[in]p_ctrlPointer to the control block for the channel.
[in]lengthNumber of units of data to be transferred (unit size specified by the bit_width).
[in]bit_widthData bit width to be transferred.
[out]p_destPointer to destination buffer into which data will be copied that is received from a SPI device. It is the responsibility of the caller to ensure that adequate space is available to hold the requested data count.

◆ versionGet

ssp_err_t(* spi_api_t::versionGet) (ssp_version_t *p_version)

Get the version information of the underlying driver.

Implemented as
Parameters
[out]p_versionpointer to memory location to return version number

◆ write

ssp_err_t(* spi_api_t::write) (spi_ctrl_t *const p_ctrl, void const *p_src, uint32_t const length, spi_bit_width_t const bit_width)

Transmit data to an SPI device.

Implemented as
Parameters
[in]p_ctrlPointer to the control block for the channel.
[in]p_srcPointer to a source data buffer from which data will be transmitted to a SPI device. The argument must not be NULL.
[in]lengthNumber of units of data to be transferred (unit size specified by the bit_width).
[in]bit_widthData bit width to be transferred.

◆ writeRead

ssp_err_t(* spi_api_t::writeRead) (spi_ctrl_t *const p_ctrl, void const *p_src, void const *p_dest, uint32_t const length, spi_bit_width_t const bit_width)

Simultaneously transmit data to an SPI device while receiving data from a SPI device (full duplex).

Implemented as
Parameters
[in]p_ctrlPointer to the control block for the channel.
[in]p_srcPointer to a source data buffer from which data will be transmitted to a SPI device. The argument must not be NULL.
[out]p_destPointer to destination buffer into which data will be copied that is received from a SPI device. It is the responsibility of the caller to ensure that adequate space is available to hold the requested data count. The argument must not be NULL.
[in]lengthNumber of units of data to be transferred (unit size specified by the bit_width).
[in]bit_widthData bit width to be transferred.

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