spips
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Groups Pages
Xspips_slave_polled_example

Macros

#define MAX_DATA   100
 Max data size in bytes. More...
 
#define UNIQUE_VALUE   0xAA
 Unique test data value. More...
 

Functions

int SpiPsSlavePolledExample (UINTPTR BaseAddress)
 Illustrates how to use the XSpiPs device driver in Slave mode. More...
 
int main (void)
 Calls the SPI Slave Example. More...
 

Variables

u8 ReadBuffer [MAX_DATA]
 Data received from the master. More...
 
u8 WriteBuffer [MAX_DATA]
 Data to send to the master. More...
 

Macro Definition Documentation

#define MAX_DATA   100

Max data size in bytes.

Referenced by SpiPsSlavePolledExample().

#define UNIQUE_VALUE   0xAA

Unique test data value.

Referenced by SpiPsSlavePolledExample().

Function Documentation

int main ( void  )

Calls the SPI Slave Example.

Returns
  • XST_SUCCESS if successful
  • XST_FAILURE if not successful

References SpiPsSlavePolledExample().

int SpiPsSlavePolledExample ( UINTPTR  BaseAddress)

Illustrates how to use the XSpiPs device driver in Slave mode.

The function reads data from a SPI Master and echoes it back to the Master.

Parameters
[in]BaseAddressThe base address of the device.
Returns
  • XST_SUCCESS if successful
  • XST_FAILURE if not successful
Note
In XSCT/classic flow, the device configuration is looked up based on DeviceId.

References XSpiPs_Config::BaseAddress, MAX_DATA, ReadBuffer, UNIQUE_VALUE, WriteBuffer, XSpiPs_CfgInitialize(), XSpiPs_LookupConfig(), and XSpiPs_PolledTransfer().

Referenced by main().

Variable Documentation

u8 ReadBuffer[MAX_DATA]

Data received from the master.

u8 WriteBuffer[MAX_DATA]

Data to send to the master.