This API when called initializes the SPI interface with default settings.
With custom settings, user should call
XIsf_SetSpiConfiguration()
and then call this API. The geometry of the underlying Serial Flash is determined by reading the Joint Electron Device Engineering Council (JEDEC) Device Information and the Status Register of the Serial Flash.
Note:
-
The
XIsf_Initialize()
API is a blocking call (for both polled and interrupt modes of the Spi driver). It reads the JEDEC information of the device and waits till the transfer is complete before checking if the information is valid. - This library can support multiple instances of Serial Flash at a time, provided they are of the same device family (either Atmel, Intel or STM, Winbond or Spansion) as the device family is selected at compile time.
Prototype
int XIsf_Initialize(XIsf *InstancePtr, XIsf_Iface *SpiInstPtr, u8 SlaveSelect, u8 *WritePtr);
Parameters
The following table lists the XIsf_Initialize
function arguments.
Type | Name | Description |
---|---|---|
XIsf * | InstancePtr | Pointer to the XIsf instance. |
XIsf_Iface * | SpiInstPtr | Pointer to XIsf_Iface instance to be worked on. |
u8 | SlaveSelect | It is a 32-bit mask with a 1 in the bit position of slave being selected. Only one slave can be selected at a time. |
u8 * | WritePtr |
Pointer to the buffer allocated by the user to be used by the In-system and Serial Flash Library to perform any read/write operations on the Serial Flash device. User applications must pass the address of this buffer for the Library to work.
|
Returns
- XST_SUCCESS if successful.
- XST_DEVICE_IS_STOPPED if the device must be started before transferring data.
- XST_FAILURE, otherwise.