xilisf_v5_14
Xilinx SDK Drivers API Documentation
xilisf_atmel_buffer_rdwr_example.c File Reference

Overview

This file contains a design example using the Xilinx In-system and Serial Flash Library (XilIsf).

This example shows the Buffer Write, Buffer to Page Program with Built-in Erase, Page to Buffer Transfer and Buffer Read features.

This example

  • Writes to a SRAM page buffer using Buffer Write feature
  • Erase a Page and data is transferred to this page from the SRAM page buffer using the Buffer to Page Program with Built-in Erase feature.
  • Transfers the data to a SRAM Page using Page to Buffer Transfer feature.
  • Reads back the Buffer that is written using the Buffer Read feature and compares the data.

The example works for AT45DB011D/AT45DB021D/AT45DB041D/AT45DB081D Serial Flash devices. The bytes per page (ISF_PAGE_SIZE) in these devices is 264 for Default addressing mode and 256 in Power-of-2 addressing mode.

For AT45DB161D/AT45DB321D the Bytes Per Page (ISF_PAGE_SIZE) is 528 for Default addressing mode and 512 in Power-Of-2 addressing mode.

For AT45DB642D the Bytes Per Page (ISF_PAGE_SIZE) is 1056 for Default addressing mode and 1024 in Power-Of-2 addressing mode.

The ISF_PAGE_SIZE should be defined by the user according to the Device used.

For further details of each device refer to the Spartan-3AN Serial Flash User Guide and data sheets of Atmel AT45XXXD .

This example has been tested with the In-system Flash Memory available on the Spartan-3AN on a Xilinx Spartan-3AN Starter Kit board.

Note

None.

  MODIFICATION HISTORY:
  Ver   Who      Date     Changes


1.00a ksu/sdm 03/22/08 First release 2.00a ktn 11/22/09 Updated to use HAL processor APIs. 5.0 sb 08/05/14 Registering to Xilisf Interrupt handler instead of driver handler. 5.14 akm 08/01/19 Initialized Status variable to XST_FAILURE. *

Functions

void SpiHandler (void *CallBackRef, u32 StatusEvent, u16 ByteCount)
 This function is the handler which performs processing for the SPI driver. More...
 
int main (void)
 Main function to call the Atmel Serial Flash example. More...
 

Function Documentation

int main ( void  )

Main function to call the Atmel Serial Flash example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
None
void SpiHandler ( void *  CallBackRef,
u32  StatusEvent,
u16  ByteCount 
)

This function is the handler which performs processing for the SPI driver.

It is called from an interrupt context such that the amount of processing performed should be minimized. It is called when a transfer of SPI data completes or an error occurs.

This handler provides an example of how to handle SPI interrupts and is application specific.

Parameters
CallBackRefis the upper layer callback reference passed back when the callback function is invoked.
StatusEventis the event that just occurred.
ByteCountis the number of bytes transferred up until the event occurred.
Returns
None.
Note
None.