This function programs the flash device(s) with data specified in the user buffer.
The source and destination address must be aligned to the width of the flash's data bus.
The device is polled until an error or the operation completes successfully.
int XFlash_Write(XFlash *InstancePtr, u32 Offset, u32 Bytes, void *SrcPtr);
The following table lists the
XFlash_Write function arguments.
|Pointer to the XFlash instance.
|Offset into the device(s) address space from which to begin programming. Must be aligned to the width of the flash's data bus.
|Number of bytes to program.
|Source address containing data to be programmed. Must be aligned to the width of the flash's data bus. The SrcPtr doesn't have to be aligned to the flash width if the processor supports unaligned access. But, since this library is generic, and some processors(eg. Microblaze) do not support unaligned access; this API requires the SrcPtr to be aligned.
- XST_SUCCESS if successful.
XFLASH_ERROR if a write error occurred. This error is usually device specific. Use
XFlash_DeviceControl()to retrieve specific error conditions. When this error is returned, it is possible that the target address range was only partially programmed.