ADuCM4x50 Device Drivers API Reference Manual  Release 4.0.0.0
ADI_SPI_TRANSCEIVER Struct Reference

#include <adi_spi.h>

Data Fields

uint8_t * pTransmitter
 
uint8_t * pReceiver
 
uint16_t TransmitterBytes
 
uint16_t ReceiverBytes
 
uint8_t nTxIncrement
 
uint8_t nRxIncrement
 
bool bDMA
 
bool bRD_CTL
 

Detailed Description

SPI Device Command/Data Transceiver Structure. Data structure used by the adi_spi_MasterReadWrite(),adi_spi_MasterSubmitBuffer() API to convey all parameters, consisting of prologue, transmit and receive data and size, and buffer increment flags. DMA and Half-Duplex operation are also specified in this structure as T/F.

Each call to adi_spi_MasterReadWrite or adi_spi_MasterSubmitBuffer() must populate the following fields of the ADI_SPI_TRANSCEIVER block:

TransmitterBytes
The number of bytes to be transmitted. If the value is zero, data will not be transmitted from the buffer pointed by pTransmitter.
ReceiverBytes
The number of bytes to be received. If the value is zero, data will not be stored in the buffer pointed by pReceiver.
pTransmitter
Pointer to the application-defined transmit data buffer. This is the data sent out over the SPI transmit wire (MOSI for Master-mode, MISO for Slave-mode) during the SPI transaction. For SPI DMA mode (which is 16-bit based), the transmit buffer must be 16-bit aligned.
pReceiver
Pointer to the application-defined receive data buffer. This is where the receive data will be stored from the SPI receive wire (MISO for Master-mode, MOSI for Slave-mode) during the SPI transaction. For SPI DMA mode (which is 16-bit based), the receive buffer must be 16-bit aligned.
bTxIncrement
Increment to be done for the transmit buffer after every transaction . The transmit data buffer pointer is advanced as each byte is sent. If it is set to zero, the transmit data pointer is stationary. A stationary buffer pointer is useful for sending the same data to an external device or if the source data is from a fixed memory address.
bRxIncrement
Increment to be done for the receive buffer. The transmit data buffer pointer is advanced as each byte is sent. If it is value is set to zero, the receive data pointer is stationary. A stationary buffer pointer is useful for monitoring commands from an external device or if the receive data is going to a fixed memory address.
bDMA
Indicate whether the transaction is to use DMA (true) or not (false). If using DMA SPI transactions are limited to 2048 bytes. If more than 2048 bytes are needed then the application must use multiple transactions (DMA ping pong mode is not supported in the driver). For SPI DMA mode (which is 16-bit based), TransmitterBytes/ReceiverBytes is rounded up to an even number by the SPI driver before submitting to DMA. Please align the buffer to 16 bit word boundary since the data transfer is 16bit.
bRD_CTL
Indicate whether the transaction should enable RD_CTL (true) or not (false). RD_CTL effectively provides half-duplex operation as outlined in the HRM.
 

Definition at line 212 of file adi_spi.h.

Field Documentation

◆ pTransmitter

uint8_t* pTransmitter

Pointer to transmit data.

Definition at line 215 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ pReceiver

uint8_t* pReceiver

Pointer to receive data.

Definition at line 217 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ TransmitterBytes

uint16_t TransmitterBytes

Data size for TX(bytes).

Definition at line 219 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ ReceiverBytes

uint16_t ReceiverBytes

Data size for RX(bytes).

Definition at line 221 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ nTxIncrement

uint8_t nTxIncrement

Transmit pointer increment flag.

Definition at line 223 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ nRxIncrement

uint8_t nRxIncrement

Receive pointer increment flag.

Definition at line 225 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ bDMA

bool bDMA

DMA mode operation

Definition at line 227 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().

◆ bRD_CTL

bool bRD_CTL

RD_CTL, half-duplex, operation

Definition at line 229 of file adi_spi.h.

Referenced by adi_spi_MasterSubmitBuffer(), and adi_spi_SlaveSubmitBuffer().