iLLD_TC27xC  1.0
Communication
Collaboration diagram for Communication:

Functions

IFX_EXTERN SpiIf_Status IfxQspi_SpiMaster_exchange (IfxQspi_SpiMaster_Channel *chHandle, const void *src, void *dest, Ifx_SizeT count)
 Exchanges data between source and data. More...
 
IFX_EXTERN SpiIf_Status IfxQspi_SpiMaster_getStatus (IfxQspi_SpiMaster_Channel *chHandle)
 Gets the transmission status. More...
 

Detailed Description

Function Documentation

IFX_EXTERN SpiIf_Status IfxQspi_SpiMaster_exchange ( IfxQspi_SpiMaster_Channel chHandle,
const void *  src,
void *  dest,
Ifx_SizeT  count 
)

Exchanges data between source and data.

Parameters
chHandleModule Channel handle
srcSource of data. Can be set to NULL_PTR if nothing to receive (transmit only)
destDestination to which to be sent. Can be set to NULL_PTR if nothing to transmit (receive only) - in this case, all-1 will be sent.
countNumber of data in pending
Returns
Status of exchange of data

In following examples we assume, that following buffers are declared globally:

// declared somewhere globally
uint8 spiTxBuffer[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
uint8 spiRxBuffer[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };

Sending and Receiving a data stream:

// wait until transfer of previous data stream is finished
// send/receive new stream
IfxQspi_SpiMaster_exchange(&spiChannel, &spiTxBuffer[i], &spiRxBuffer[i], 8);

Send only, discard received data:

// wait until transfer of previous data stream is finished
// send new stream
IfxQspi_SpiMaster_exchange(&spiChannel, &spiTxBuffer[i], NULL_PTR, 8);

Receive only, send all-1

// wait until transfer of previous data stream is finished
// receive new stream
IfxQspi_SpiMaster_exchange(&spiChannel, NULL_PTR, &spiRxBuffer[i], 8);

The handling of slave transfers is identical.

Definition at line 142 of file IfxQspi_SpiMaster.c.

Referenced by IfxQspi_SpiMaster_initModule().

IFX_EXTERN SpiIf_Status IfxQspi_SpiMaster_getStatus ( IfxQspi_SpiMaster_Channel chHandle)

Gets the transmission status.

Parameters
chHandleModule Channel handle
Returns
Transmission status

Usage example: see IfxQspi_SpiMaster_exchange

Definition at line 170 of file IfxQspi_SpiMaster.c.

Referenced by IfxQspi_SpiMaster_initModule().