XIsf_SectorProtect - 2020.2 English

OS and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2020-11-24
Version
2020.2 English

This API is used for performing Sector Protect related operations.

Note:
  • The SPR content is stored at the fourth location pointed by the BufferPtr when performing XISF_SPR_READ operation.
  • For Intel, STM, Winbond and Spansion Serial Flash, the user application must call the XIsf_WriteEnable() API by passing XISF_WRITE_ENABLE as an argument, before calling the XIsf_SectorProtect() API, for Sector Protect Register Write (XISF_SPR_WRITE) operation.
  • Atmel Flash supports all these Sector Protect operations.
  • Intel, STM, Winbond and Spansion Flash support only Sector Protect Read and Sector Protect Write operations.

Prototype

int XIsf_SectorProtect(XIsf *InstancePtr, XIsf_SpOperation Operation, u8 *BufferPtr);

Parameters

The following table lists the XIsf_SectorProtect function arguments.

Table 1. XIsf_SectorProtect Arguments
Type Name Description
XIsf * InstancePtr Pointer to the XIsf instance.
XIsf_SpOperation Operation Type of Sector Protect operation to be performed on the Serial Flash. The different operations are
  • XISF_SPR_READ: Read Sector Protection Register
  • XISF_SPR_WRITE: Write Sector Protection Register
  • XISF_SPR_ERASE: Erase Sector Protection Register
  • XISF_SP_ENABLE: Enable Sector Protection
  • XISF_SP_DISABLE: Disable Sector Protection
u8 * BufferPtr Pointer to the memory where the SPR content is read to/written from. This argument can be NULL if the Operation is SprErase, SpEnable and SpDisable.

Returns

  • XST_SUCCESS if successful.
  • XST_FAILURE if it fails.