spi
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
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. *

#include "xparameters.h"
#include "xspi.h"
#include "xil_printf.h"

Functions

int SpiXipExample (XSpi *SpiInstancePtr, UINTPTR BaseAddress)
 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,
UINTPTR  BaseAddress 
)

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
SpiInstancePtris a pointer to the instance of Spi component.
BaseAddresscontains the base address of the device
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

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

Referenced by main().