| spi Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xspi_winbond_flash_xip_example.c File Reference

## Overview

This file contains a design example using the Spi driver (XSpi) and the Spi device configured in XIP Mode.

This example reads data from the Flash Memory in the way RAM is accessed.

Note

None.

      MODIFICATION HISTORY:

      Ver   Who  Date     Changes

      3.04a bss  03/21/12 First Release
      4.2   ms   01/23/17 Added xil_printf statement in main function to
                          ensure that "Successfully ran" and "Failed" strings
                          are available in all examples. This is a fix for
                          CR-965028.
            ms   04/10/17 Modified filename tag to include the file in doxygen
                          examples.
      4.11  sb   07/11/23 Added support for system device-tree flow.
    *

## Functions
int | SpiXipExample (XSpi *SpiInstancePtr, u16 SpiDeviceId)
| This function reads data from Flash memory in the way any memory is accessed. More...
int | main (void)
| Main function to call the Spi XIP example. More...

## Function Documentation

int main | ( | void |  | ) |

Main function to call the Spi XIP example.

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None

References SpiXipExample().

int SpiXipExample | ( | XSpi * | SpiInstancePtr,
|  | u16 | SpiDeviceId
| ) |  |

This function reads data from Flash memory in the way any memory is accessed.

The purpose of this function is to illustrate how to use SPI device in XIP Mode.

This function reads data from Flash in the same way any other memory is accessed

Parameters

  SpiInstancePtr | is a pointer to the instance of Spi component.
  SpiDeviceId | is the Device ID of the Spi Device and is the XPAR_<SPI_instance>_DEVICE_ID value from xparameters.h.

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None

References XSpi_Config::BaseAddress, XSpi::FlashBaseAddr, XSpi_CfgInitialize(), and XSpi_LookupConfig().

Referenced by main().