ospipsv
Xilinx SDK Drivers API Documentation
Xospipsv_v1_1

Functions

u32 XOspiPsv_CfgInitialize (XOspiPsv *InstancePtr, const XOspiPsv_Config *ConfigPtr)
 Initializes a specific XOspiPsv instance such that the driver is ready to use. More...
 
void XOspiPsv_Reset (const XOspiPsv *InstancePtr)
 This function reset the configuration register. More...
 
u32 XOspiPsv_DeviceReset (u8 Type)
 This function reset the OSPI flash device. More...
 
u32 XOspiPsv_PollTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function performs a transfer on the bus in polled mode. More...
 
u32 XOspiPsv_IntrTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function performs a transfer on the bus in interrupt mode. More...
 
u32 XOspiPsv_IntrHandler (XOspiPsv *InstancePtr)
 This function handles interrupt based transfers. More...
 
void XOspiPsv_Idle (const XOspiPsv *InstancePtr)
 Stops the transfer of data to internal DST FIFO from stream interface and also stops the issuing of new write commands to memory. More...
 
void XOspiPsv_SetStatusHandler (XOspiPsv *InstancePtr, void *CallBackRef, XOspiPsv_StatusHandler FuncPointer)
 Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to upper layer software. More...
 

Function Documentation

u32 XOspiPsv_CfgInitialize ( XOspiPsv InstancePtr,
const XOspiPsv_Config ConfigPtr 
)

Initializes a specific XOspiPsv instance such that the driver is ready to use.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
ConfigPtris a reference to a structure containing information about a specific OSPIPSV device. This function initializes an InstancePtr object for a specific device specified by the contents of Config.
EffectiveAddris the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, use ConfigPtr->Config.BaseAddress for this device.
Returns
  • XST_SUCCESS if successful.
  • XST_DEVICE_IS_STARTED if the device is already started. It must be stopped to re-initialize.
Note
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv_Config::InputClockHz, XOspiPsv::IsBusy, XOspiPsv_Config::IsCacheCoherent, XOspiPsv::IsReady, XOspiPsv::OpMode, XOspiPsv::RecvBufferPtr, XOspiPsv::RxBytes, XOspiPsv::SdrDdrMode, XOspiPsv::SendBufferPtr, XOspiPsv::TxBytes, XOspiPsv_Reset(), and XOspiPsv_SetSdrDdrMode().

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_DeviceReset ( u8  Type)

This function reset the OSPI flash device.

Parameters
Typeis Reset type.
Returns
- XST_SUCCESS if successful.
  • XST_FAILURE for invalid Reset Type.
Note
None

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

void XOspiPsv_Idle ( const XOspiPsv InstancePtr)

Stops the transfer of data to internal DST FIFO from stream interface and also stops the issuing of new write commands to memory.

By calling this API, any ongoing Dma transfers will be paused and DMA will not issue AXI write commands to memory

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
None.
Note
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOSPIPSV_CONFIG_REG, and XOSPIPSV_OSPIDMA_DST_CTRL.

u32 XOspiPsv_IntrHandler ( XOspiPsv InstancePtr)

This function handles interrupt based transfers.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_DEVICE_BUSY if a transfer is already in progress.
Note
None.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Msg::Flags, XOspiPsv::IsBusy, XOspiPsv_Config::IsCacheCoherent, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv::StatusRef, XOSPIPSV_CONFIG_REG, XOSPIPSV_INDIRECT_READ_XFER_CTRL_REG, XOSPIPSV_IRQ_MASK_REG, XOSPIPSV_IRQ_STATUS_REG, XOSPIPSV_OSPIDMA_DST_I_DIS, and XOSPIPSV_OSPIDMA_DST_I_STS.

u32 XOspiPsv_IntrTransfer ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)
u32 XOspiPsv_PollTransfer ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

This function performs a transfer on the bus in polled mode.

The messages passed are all transferred on the bus between one CS assert and de-assert.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.
  • XST_DEVICE_BUSY if a transfer is already in progress.
Note
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::IsBusy, XOspiPsv::IsReady, and XOSPIPSV_CONFIG_REG.

Referenced by FlashLinearWrite().

void XOspiPsv_Reset ( const XOspiPsv InstancePtr)

This function reset the configuration register.

The Upper layer software is responsible for re-configuring (if necessary) and restarting the OSPIPSV device after the reset.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
None.
Note
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOSPIPSV_CONFIG_REG, and XOSPIPSV_DEV_DELAY_REG.

Referenced by XOspiPsv_CfgInitialize().

void XOspiPsv_SetStatusHandler ( XOspiPsv InstancePtr,
void *  CallBackRef,
XOspiPsv_StatusHandler  FuncPointer 
)

Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to upper layer software.

The handler executes in an interrupt context, so it must minimize the amount of processing performed. One of the following status events is passed to the status handler.

XST_SPI_TRANSFER_DONE           The requested data transfer is done
 
Parameters
InstancePtris a pointer to the XOspiPsv instance.
CallBackRefis the upper layer callback reference passed back when the callback function is invoked.
FuncPointeris the pointer to the callback function.
Returns
None.
Note

The handler is called within interrupt context, so it should do its work quickly and queue potentially time-consuming work to a task-level thread.

References XOspiPsv::IsReady, and XOspiPsv::StatusRef.

Referenced by OspiPsvInterruptFlashExample().