ospipsv: Ospipsv_v1_1

| ospipsv Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Functions
Ospipsv_v1_1

## Data Structures
struct | XOspiPsv_Msg
| This typedef contains configuration information for a flash message. More...
struct | XOspiPsv_Config
| This typedef contains configuration information for the device. More...
struct | XOspiPsv
| The XOspiPsv driver instance data. More...

## Macros
#define | XOSPIPSV_BASEADDR 0XF1010000
| OSPI Base Address. More...
#define | XOSPIPSV_CONFIG_REG 0X00000000U
| Register: OSPI_CONFIG_REG. More...
#define | XOSPIPSV_DEV_INSTR_RD_CONFIG_REG 0X00000004U
| Register: OSPI_DEV_INSTR_RD_CONFIG_REG. More...
#define | XOSPIPSV_DEV_INSTR_WR_CONFIG_REG 0X00000008U
| Register: OSPI_DEV_INSTR_WR_CONFIG_REG. More...
#define | XOSPIPSV_DEV_DELAY_REG 0X0000000CU
| Register: OSPI_DEV_DELAY_REG. More...
#define | XOSPIPSV_RD_DATA_CAPTURE_REG 0X00000010U
| Register: OSPI_RD_DATA_CAPTURE_REG. More...
#define | XOSPIPSV_DEV_SIZE_CONFIG_REG 0X00000014U
| Register: OSPI_DEV_SIZE_CONFIG_REG. More...
#define | XOSPIPSV_SRAM_PARTITION_CFG_REG 0X00000018U
| Register: OSPI_SRAM_PARTITION_CFG_REG. More...
#define | XOSPIPSV_IND_AHB_ADDR_TRIGGER_REG 0X0000001CU
| Register: OSPI_IND_AHB_ADDR_TRIGGER_REG. More...
#define | XOSPIPSV_DMA_PERIPH_CONFIG_REG 0X00000020U
| Register: OSPI_DMA_PERIPH_CONFIG_REG. More...
#define | XOSPIPSV_REMAP_ADDR_REG 0X00000024U
| Register: OSPI_REMAP_ADDR_REG. More...
#define | XOSPIPSV_MODE_BIT_CONFIG_REG 0X00000028U
| Register: OSPI_MODE_BIT_CONFIG_REG. More...
#define | XOSPIPSV_SRAM_FILL_REG 0X0000002CU
| Register: OSPI_SRAM_FILL_REG. More...
#define | XOSPIPSV_TX_THRESH_REG 0X00000030U
| Register: OSPI_TX_THRESH_REG. More...
#define | XOSPIPSV_RX_THRESH_REG 0X00000034U
| Register: OSPI_RX_THRESH_REG. More...
#define | XOSPIPSV_WRITE_COMPLETION_CTRL_REG 0X00000038U
| Register: OSPI_WRITE_COMPLETION_CTRL_REG. More...
#define | XOSPIPSV_NO_OF_POLLS_BEF_EXP_REG 0X0000003CU
| Register: OSPI_NO_OF_POLLS_BEF_EXP_REG. More...
#define | XOSPIPSV_IRQ_STATUS_REG 0X00000040U
| Register: OSPI_IRQ_STATUS_REG. More...
#define | XOSPIPSV_IRQ_MASK_REG 0X00000044U
| Register: OSPI_IRQ_MASK_REG. More...
#define | XOSPIPSV_LOWER_WR_PROT_REG 0X00000050U
| Register: OSPI_LOWER_WR_PROT_REG. More...
#define | XOSPIPSV_UPPER_WR_PROT_REG 0X00000054U
| Register: OSPI_UPPER_WR_PROT_REG. More...
#define | XOSPIPSV_WR_PROT_CTRL_REG 0X00000058U
| Register: OSPI_WR_PROT_CTRL_REG. More...
#define | XOSPIPSV_INDIRECT_READ_XFER_CTRL_REG 0X00000060U
| Register: OSPI_INDIRECT_READ_XFER_CTRL_REG. More...
#define | XOSPIPSV_INDIRECT_READ_XFER_WATERMARK_REG 0X00000064U
| Register: OSPI_INDIRECT_READ_XFER_WATERMARK_REG. More...
#define | XOSPIPSV_INDIRECT_READ_XFER_START_REG 0X00000068U
| Register: OSPI_INDIRECT_READ_XFER_START_REG. More...
#define | XOSPIPSV_INDIRECT_READ_XFER_NUM_BYTES_REG 0X0000006CU
| Register: OSPI_INDIRECT_READ_XFER_NUM_BYTES_REG. More...
#define | XOSPIPSV_INDIRECT_WRITE_XFER_CTRL_REG 0X00000070U
| Register: OSPI_INDIRECT_WRITE_XFER_CTRL_REG. More...
#define | XOSPIPSV_INDIRECT_WRITE_XFER_WATERMARK_REG 0X00000074U
| Register: OSPI_INDIRECT_WRITE_XFER_WATERMARK_REG. More...
#define | XOSPIPSV_INDIRECT_WRITE_XFER_START_REG 0X00000078U
| Register: OSPI_INDIRECT_WRITE_XFER_START_REG. More...
#define | XOSPIPSV_INDIRECT_WRITE_XFER_NUM_BYTES_REG 0X0000007CU
| Register: OSPI_INDIRECT_WRITE_XFER_NUM_BYTES_REG. More...
#define | XOSPIPSV_INDIRECT_TRIGGER_ADDR_RANGE_REG 0X00000080U
| Register: OSPI_INDIRECT_TRIGGER_ADDR_RANGE_REG. More...
#define | XOSPIPSV_FLASH_COMMAND_CTRL_MEM_REG 0X0000008CU
| Register: OSPI_FLASH_COMMAND_CTRL_MEM_REG. More...
#define | XOSPIPSV_FLASH_CMD_CTRL_REG 0X00000090U
| Register: OSPI_FLASH_CMD_CTRL_REG. More...
#define | XOSPIPSV_FLASH_CMD_ADDR_REG 0X00000094U
| Register: OSPI_FLASH_CMD_ADDR_REG. More...
#define | XOSPIPSV_FLASH_RD_DATA_LOWER_REG 0X000000A0U
| Register: OSPI_FLASH_RD_DATA_LOWER_REG. More...
#define | XOSPIPSV_FLASH_RD_DATA_UPPER_REG 0X000000A4U
| Register: OSPI_FLASH_RD_DATA_UPPER_REG. More...
#define | XOSPIPSV_FLASH_WR_DATA_LOWER_REG 0X000000A8U
| Register: OSPI_FLASH_WR_DATA_LOWER_REG. More...
#define | XOSPIPSV_FLASH_WR_DATA_UPPER_REG 0X000000ACU
| Register: OSPI_FLASH_WR_DATA_UPPER_REG. More...
#define | XOSPIPSV_POLLING_FLASH_STATUS_REG 0X000000B0U
| Register: OSPI_POLLING_FLASH_STATUS_REG. More...
#define | XOSPIPSV_PHY_CONFIGURATION_REG 0X000000B4U
| Register: OSPI_PHY_CONFIGURATION_REG. More...
#define | XOSPIPSV_PHY_MASTER_CONTROL_REG 0X000000B8U
| Register: OSPI_PHY_MASTER_CONTROL_REG. More...
#define | XOSPIPSV_DLL_OBSERVABLE_LOWER_REG 0X000000BCU
| Register: OSPI_DLL_OBSERVABLE_LOWER_REG. More...
#define | XOSPIPSV_DLL_OBSERVABLE_UPPER_REG 0X000000C0U
| Register: OSPI_DLL_OBSERVABLE_UPPER_REG. More...
#define | XOSPIPSV_OPCODE_EXT_LOWER_REG 0X000000E0U
| Register: OSPI_OPCODE_EXT_LOWER_REG. More...
#define | XOSPIPSV_OPCODE_EXT_UPPER_REG 0X000000E4U
| Register: OSPI_OPCODE_EXT_UPPER_REG. More...
#define | XOSPIPSV_MODULE_ID_REG 0X000000FCU
| Register: OSPI_MODULE_ID_REG. More...
#define | XOSPIPSV_OSPIDMA_SRC_RD_ADDR 0X00001000U
| Register: OSPI_OSPIDMA_SRC_RD_ADDR. More...
#define | XOSPIPSV_OSPIDMA_SRC_SIZE 0X00001004U
| Register: OSPI_OSPIDMA_SRC_SIZE. More...
#define | XOSPIPSV_OSPIDMA_SRC_STS 0X00001008U
| Register: OSPI_OSPIDMA_SRC_STS. More...
#define | XOSPIPSV_OSPIDMA_SRC_CTRL 0X0000100CU
| Register: OSPI_OSPIDMA_SRC_CTRL. More...
#define | XOSPIPSV_OSPIDMA_SRC_CRC 0X00001010U
| Register: OSPI_OSPIDMA_SRC_CRC. More...
#define | XOSPIPSV_OSPIDMA_SRC_I_STS 0X00001014U
| Register: OSPI_OSPIDMA_SRC_I_STS. More...
#define | XOSPIPSV_OSPIDMA_SRC_I_EN 0X00001018U
| Register: OSPI_OSPIDMA_SRC_I_EN. More...
#define | XOSPIPSV_OSPIDMA_SRC_I_DIS 0X0000101CU
| Register: OSPI_OSPIDMA_SRC_I_DIS. More...
#define | XOSPIPSV_OSPIDMA_SRC_I_MASK 0X00001020U
| Register: OSPI_OSPIDMA_SRC_I_MASK. More...
#define | XOSPIPSV_OSPIDMA_SRC_CTRL2 0X00001024U
| Register: OSPI_OSPIDMA_SRC_CTRL2. More...
#define | XOSPIPSV_OSPIDMA_DST_ADDR 0X00001800U
| Register: OSPI_OSPIDMA_DST_ADDR. More...
#define | XOSPIPSV_OSPIDMA_DST_SIZE 0X00001804U
| Register: OSPI_OSPIDMA_DST_SIZE. More...
#define | XOSPIPSV_OSPIDMA_DST_STS 0X00001808U
| Register: OSPI_OSPIDMA_DST_STS. More...
#define | XOSPIPSV_OSPIDMA_DST_CTRL 0X0000180CU
| Register: OSPI_OSPIDMA_DST_CTRL. More...
#define | XOSPIPSV_OSPIDMA_DST_I_STS 0X00001814U
| Register: OSPI_OSPIDMA_DST_I_STS. More...
#define | XOSPIPSV_OSPIDMA_DST_I_EN 0X00001818U
| Register: OSPI_OSPIDMA_DST_I_EN. More...
#define | XOSPIPSV_OSPIDMA_DST_I_DIS 0X0000181CU
| Register: OSPI_OSPIDMA_DST_I_DIS. More...
#define | XOSPIPSV_OSPIDMA_DST_I_MASK 0X00001820U
| Register: OSPI_OSPIDMA_DST_I_MASK. More...
#define | XOSPIPSV_OSPIDMA_DST_CTRL2 0X00001824U
| Register: OSPI_OSPIDMA_DST_CTRL2. More...
#define | XOSPIPSV_OSPIDMA_DST_ADDR_MSB 0X00001828U
| Register: OSPI_OSPIDMA_DST_ADDR_MSB. More...
#define | XOSPIPSV_OSPIDMA_SAFETY_CHK 0X00001FF8U
| Register: OSPI_OSPIDMA_SAFETY_CHK. More...
#define | XOSPIPSV_OSPIDMA_FUTURE_ECO 0X00001FFCU
| Register: OSPI_OSPIDMA_FUTURE_ECO. More...

## Typedefs
typedef void(* | XOspiPsv_StatusHandler )(void *CallBackRef, u32 StatusEvent)
| The handler data type allows the user to define a callback function to handle the asynchronous processing for the OSPIPSV device. More...

## Functions
XOspiPsv_Config * | XOspiPsv_LookupConfig (u16 DeviceId)
| Looks up the device configuration based on the unique device ID. More...
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_SetClkPrescaler (XOspiPsv *InstancePtr, u8 Prescaler)
| Configures the clock according to the prescaler passed. More...
u32 | XOspiPsv_SelectFlash (XOspiPsv *InstancePtr, u8 chip_select)
| This function should be used to tell the OSPIPSV driver the HW flash configuration being used. More...
u32 | XOspiPsv_SetOptions (XOspiPsv *InstancePtr, u32 Options)
| This function sets the options for the OSPIPSV device driver.The options control how the device behaves relative to the OSPIPSV bus. More...
u32 | XOspiPsv_GetOptions (const XOspiPsv *InstancePtr)
| This function gets the options for the OSPIPSV 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_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...
u32 | XOspiPsv_SetSdrDdrMode (XOspiPsv *InstancePtr, u32 Mode)
| Configures the edge mode (SDR or DDR) More...
void | XOspiPsv_ConfigureAutoPolling (XOspiPsv *InstancePtr, u32 FlashMode)
| Configures how the controller will poll the device following a write transfer in DAC mode. 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...
u32 | XOspiPsv_DeviceReset (u8 Type)
| This function reset the OSPI flash device. More...

## Macro Definition Documentation

#define XOSPIPSV_BASEADDR 0XF1010000

OSPI Base Address.

#define XOSPIPSV_CONFIG_REG 0X00000000U

Register: OSPI_CONFIG_REG.

Referenced by XOspiPsv_GetOptions(), XOspiPsv_Idle(), XOspiPsv_IntrHandler(), XOspiPsv_IntrTransfer(), XOspiPsv_PollTransfer(), XOspiPsv_Reset(), XOspiPsv_SetClkPrescaler(), XOspiPsv_SetOptions(), and XOspiPsv_SetSdrDdrMode().

#define XOSPIPSV_DEV_DELAY_REG 0X0000000CU

Register: OSPI_DEV_DELAY_REG.

Referenced by XOspiPsv_Reset().

#define XOSPIPSV_DEV_INSTR_RD_CONFIG_REG 0X00000004U

Register: OSPI_DEV_INSTR_RD_CONFIG_REG.

#define XOSPIPSV_DEV_INSTR_WR_CONFIG_REG 0X00000008U

Register: OSPI_DEV_INSTR_WR_CONFIG_REG.

#define XOSPIPSV_DEV_SIZE_CONFIG_REG 0X00000014U

Register: OSPI_DEV_SIZE_CONFIG_REG.

#define XOSPIPSV_DLL_OBSERVABLE_LOWER_REG 0X000000BCU

Register: OSPI_DLL_OBSERVABLE_LOWER_REG.

#define XOSPIPSV_DLL_OBSERVABLE_UPPER_REG 0X000000C0U

Register: OSPI_DLL_OBSERVABLE_UPPER_REG.

#define XOSPIPSV_DMA_PERIPH_CONFIG_REG 0X00000020U

Register: OSPI_DMA_PERIPH_CONFIG_REG.

#define XOSPIPSV_FLASH_CMD_ADDR_REG 0X00000094U

Register: OSPI_FLASH_CMD_ADDR_REG.

Referenced by XOspiPsv_IntrTransfer().

#define XOSPIPSV_FLASH_CMD_CTRL_REG 0X00000090U

Register: OSPI_FLASH_CMD_CTRL_REG.

Referenced by XOspiPsv_IntrTransfer().

#define XOSPIPSV_FLASH_COMMAND_CTRL_MEM_REG 0X0000008CU

Register: OSPI_FLASH_COMMAND_CTRL_MEM_REG.

#define XOSPIPSV_FLASH_RD_DATA_LOWER_REG 0X000000A0U

Register: OSPI_FLASH_RD_DATA_LOWER_REG.

#define XOSPIPSV_FLASH_RD_DATA_UPPER_REG 0X000000A4U

Register: OSPI_FLASH_RD_DATA_UPPER_REG.

#define XOSPIPSV_FLASH_WR_DATA_LOWER_REG 0X000000A8U

Register: OSPI_FLASH_WR_DATA_LOWER_REG.

#define XOSPIPSV_FLASH_WR_DATA_UPPER_REG 0X000000ACU

Register: OSPI_FLASH_WR_DATA_UPPER_REG.

#define XOSPIPSV_IND_AHB_ADDR_TRIGGER_REG 0X0000001CU

Register: OSPI_IND_AHB_ADDR_TRIGGER_REG.

#define XOSPIPSV_INDIRECT_READ_XFER_CTRL_REG 0X00000060U

Register: OSPI_INDIRECT_READ_XFER_CTRL_REG.

Referenced by XOspiPsv_IntrHandler().

#define XOSPIPSV_INDIRECT_READ_XFER_NUM_BYTES_REG 0X0000006CU

Register: OSPI_INDIRECT_READ_XFER_NUM_BYTES_REG.

#define XOSPIPSV_INDIRECT_READ_XFER_START_REG 0X00000068U

Register: OSPI_INDIRECT_READ_XFER_START_REG.

#define XOSPIPSV_INDIRECT_READ_XFER_WATERMARK_REG 0X00000064U

Register: OSPI_INDIRECT_READ_XFER_WATERMARK_REG.

#define XOSPIPSV_INDIRECT_TRIGGER_ADDR_RANGE_REG 0X00000080U

Register: OSPI_INDIRECT_TRIGGER_ADDR_RANGE_REG.

#define XOSPIPSV_INDIRECT_WRITE_XFER_CTRL_REG 0X00000070U

Register: OSPI_INDIRECT_WRITE_XFER_CTRL_REG.

#define XOSPIPSV_INDIRECT_WRITE_XFER_NUM_BYTES_REG 0X0000007CU

Register: OSPI_INDIRECT_WRITE_XFER_NUM_BYTES_REG.

#define XOSPIPSV_INDIRECT_WRITE_XFER_START_REG 0X00000078U

Register: OSPI_INDIRECT_WRITE_XFER_START_REG.

#define XOSPIPSV_INDIRECT_WRITE_XFER_WATERMARK_REG 0X00000074U

Register: OSPI_INDIRECT_WRITE_XFER_WATERMARK_REG.

#define XOSPIPSV_IRQ_MASK_REG 0X00000044U

Register: OSPI_IRQ_MASK_REG.

Referenced by XOspiPsv_IntrHandler(), and XOspiPsv_IntrTransfer().

#define XOSPIPSV_IRQ_STATUS_REG 0X00000040U

Register: OSPI_IRQ_STATUS_REG.

Referenced by XOspiPsv_IntrHandler().

#define XOSPIPSV_LOWER_WR_PROT_REG 0X00000050U

Register: OSPI_LOWER_WR_PROT_REG.

#define XOSPIPSV_MODE_BIT_CONFIG_REG 0X00000028U

Register: OSPI_MODE_BIT_CONFIG_REG.

#define XOSPIPSV_MODULE_ID_REG 0X000000FCU

Register: OSPI_MODULE_ID_REG.

#define XOSPIPSV_NO_OF_POLLS_BEF_EXP_REG 0X0000003CU

Register: OSPI_NO_OF_POLLS_BEF_EXP_REG.

#define XOSPIPSV_OPCODE_EXT_LOWER_REG 0X000000E0U

Register: OSPI_OPCODE_EXT_LOWER_REG.

#define XOSPIPSV_OPCODE_EXT_UPPER_REG 0X000000E4U

Register: OSPI_OPCODE_EXT_UPPER_REG.

#define XOSPIPSV_OSPIDMA_DST_ADDR 0X00001800U

Register: OSPI_OSPIDMA_DST_ADDR.

#define XOSPIPSV_OSPIDMA_DST_ADDR_MSB 0X00001828U

Register: OSPI_OSPIDMA_DST_ADDR_MSB.

#define XOSPIPSV_OSPIDMA_DST_CTRL 0X0000180CU

Register: OSPI_OSPIDMA_DST_CTRL.

Referenced by XOspiPsv_Idle().

#define XOSPIPSV_OSPIDMA_DST_CTRL2 0X00001824U

Register: OSPI_OSPIDMA_DST_CTRL2.

#define XOSPIPSV_OSPIDMA_DST_I_DIS 0X0000181CU

Register: OSPI_OSPIDMA_DST_I_DIS.

Referenced by XOspiPsv_IntrHandler().

#define XOSPIPSV_OSPIDMA_DST_I_EN 0X00001818U

Register: OSPI_OSPIDMA_DST_I_EN.

Referenced by XOspiPsv_IntrTransfer().

#define XOSPIPSV_OSPIDMA_DST_I_MASK 0X00001820U

Register: OSPI_OSPIDMA_DST_I_MASK.

#define XOSPIPSV_OSPIDMA_DST_I_STS 0X00001814U

Register: OSPI_OSPIDMA_DST_I_STS.

Referenced by XOspiPsv_IntrHandler().

#define XOSPIPSV_OSPIDMA_DST_SIZE 0X00001804U

Register: OSPI_OSPIDMA_DST_SIZE.

#define XOSPIPSV_OSPIDMA_DST_STS 0X00001808U

Register: OSPI_OSPIDMA_DST_STS.

#define XOSPIPSV_OSPIDMA_FUTURE_ECO 0X00001FFCU

Register: OSPI_OSPIDMA_FUTURE_ECO.

#define XOSPIPSV_OSPIDMA_SAFETY_CHK 0X00001FF8U

Register: OSPI_OSPIDMA_SAFETY_CHK.

#define XOSPIPSV_OSPIDMA_SRC_CRC 0X00001010U

Register: OSPI_OSPIDMA_SRC_CRC.

#define XOSPIPSV_OSPIDMA_SRC_CTRL 0X0000100CU

Register: OSPI_OSPIDMA_SRC_CTRL.

#define XOSPIPSV_OSPIDMA_SRC_CTRL2 0X00001024U

Register: OSPI_OSPIDMA_SRC_CTRL2.

#define XOSPIPSV_OSPIDMA_SRC_I_DIS 0X0000101CU

Register: OSPI_OSPIDMA_SRC_I_DIS.

#define XOSPIPSV_OSPIDMA_SRC_I_EN 0X00001018U

Register: OSPI_OSPIDMA_SRC_I_EN.

#define XOSPIPSV_OSPIDMA_SRC_I_MASK 0X00001020U

Register: OSPI_OSPIDMA_SRC_I_MASK.

#define XOSPIPSV_OSPIDMA_SRC_I_STS 0X00001014U

Register: OSPI_OSPIDMA_SRC_I_STS.

#define XOSPIPSV_OSPIDMA_SRC_RD_ADDR 0X00001000U

Register: OSPI_OSPIDMA_SRC_RD_ADDR.

#define XOSPIPSV_OSPIDMA_SRC_SIZE 0X00001004U

Register: OSPI_OSPIDMA_SRC_SIZE.

#define XOSPIPSV_OSPIDMA_SRC_STS 0X00001008U

Register: OSPI_OSPIDMA_SRC_STS.

#define XOSPIPSV_PHY_CONFIGURATION_REG 0X000000B4U

Register: OSPI_PHY_CONFIGURATION_REG.

#define XOSPIPSV_PHY_MASTER_CONTROL_REG 0X000000B8U

Register: OSPI_PHY_MASTER_CONTROL_REG.

#define XOSPIPSV_POLLING_FLASH_STATUS_REG 0X000000B0U

Register: OSPI_POLLING_FLASH_STATUS_REG.

Referenced by XOspiPsv_ConfigureAutoPolling().

#define XOSPIPSV_RD_DATA_CAPTURE_REG 0X00000010U

Register: OSPI_RD_DATA_CAPTURE_REG.

Referenced by XOspiPsv_SetSdrDdrMode().

#define XOSPIPSV_REMAP_ADDR_REG 0X00000024U

Register: OSPI_REMAP_ADDR_REG.

Referenced by XOspiPsv_SetOptions().

#define XOSPIPSV_RX_THRESH_REG 0X00000034U

Register: OSPI_RX_THRESH_REG.

#define XOSPIPSV_SRAM_FILL_REG 0X0000002CU

Register: OSPI_SRAM_FILL_REG.

#define XOSPIPSV_SRAM_PARTITION_CFG_REG 0X00000018U

Register: OSPI_SRAM_PARTITION_CFG_REG.

#define XOSPIPSV_TX_THRESH_REG 0X00000030U

Register: OSPI_TX_THRESH_REG.

#define XOSPIPSV_UPPER_WR_PROT_REG 0X00000054U

Register: OSPI_UPPER_WR_PROT_REG.

#define XOSPIPSV_WR_PROT_CTRL_REG 0X00000058U

Register: OSPI_WR_PROT_CTRL_REG.

#define XOSPIPSV_WRITE_COMPLETION_CTRL_REG 0X00000038U

Register: OSPI_WRITE_COMPLETION_CTRL_REG.

Referenced by XOspiPsv_SetSdrDdrMode().

## Typedef Documentation

typedef void(* XOspiPsv_StatusHandler)(void *CallBackRef, u32 StatusEvent)

The handler data type allows the user to define a callback function to handle the asynchronous processing for the OSPIPSV device.

The application using this driver is expected to define a handler of this type to support interrupt driven mode. The handler executes in an interrupt context, so only minimal processing should be performed.

Parameters

  CallBackRef | is the callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. Its type is not important to the driver, so it is a void pointer.
  StatusEvent | holds one or more status events that have occurred. See the XOspiPsv_SetStatusHandler() for details on the status events that can be passed in the callback.

## 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

  InstancePtr | is a pointer to the XOspiPsv instance.
  ConfigPtr | is 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.
  EffectiveAddr | is 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().

void XOspiPsv_ConfigureAutoPolling | ( | XOspiPsv * | InstancePtr,
|  | u32 | FlashMode
| ) |  |

Configures how the controller will poll the device following a write transfer in DAC mode.

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.
  Mode | is Edge mode. XOSPIPSV_EDGE_MODE_* represents valid values.

Returns
  - XST_SUCCESS
  - XST_FAILURE

Note
  None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and XOSPIPSV_POLLING_FLASH_STATUS_REG.

Referenced by FlashSetSDRDDRMode().

u32 XOspiPsv_DeviceReset | ( | u8 | Type | ) |

This function reset the OSPI flash device.

Parameters

  Type | is Reset type.

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE for invalid Reset Type.

Note
  None

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_GetOptions | ( | const XOspiPsv * | InstancePtr | ) |

This function gets the options for the OSPIPSV device.

The options control how the device behaves relative to the OSPIPSV bus.

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.

Returns

Options contains the specified options currently set. This is a bit Value where a 1 means the option is on, and a 0 means the option is off. See the bit definitions named XOSPIPSV_*_OPTIONS in file xospipsv.h.

Note
  None.

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

Referenced by 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

  InstancePtr | is 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

  InstancePtr | is a pointer to the XOspiPsv instance.
  Msg | is 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
| ) |  |

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

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.
  Msg | is 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::Addrsize, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Msg::Dummy, XOspiPsv_Msg::Flags, XOspiPsv::IsBusy, XOspiPsv::IsReady, XOspiPsv_Msg::Opcode, XOspiPsv::OpMode, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv::SendBufferPtr, XOspiPsv_Msg::TxBfrPtr, XOspiPsv::TxBytes, XOSPIPSV_CONFIG_REG, XOSPIPSV_FLASH_CMD_ADDR_REG, XOSPIPSV_FLASH_CMD_CTRL_REG, XOSPIPSV_IRQ_MASK_REG, and XOSPIPSV_OSPIDMA_DST_I_EN.

Referenced by BulkErase(), DieErase(), FlashEnterExit4BAddMode(), FlashErase(), FlashIoWrite(), FlashRead(), FlashReadID(), and FlashSetSDRDDRMode().

XOspiPsv_Config * XOspiPsv_LookupConfig | ( | u16 | DeviceId | ) |

Looks up the device configuration based on the unique device ID.

A table contains the configuration info for each device in the system.

Parameters

  DeviceId | contains the ID of the device to look up the configuration for.

Returns

A pointer to the configuration found or NULL if the specified device ID was not found. See XOspiPsv.h for the definition of XOspiPsv_Config.

Note
  None.

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

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

  InstancePtr | is a pointer to the XOspiPsv instance.
  Msg | is 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

  InstancePtr | is 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().

u32 XOspiPsv_SelectFlash | ( | XOspiPsv * | InstancePtr,
|  | u8 | chip_select
| ) |  |

This function should be used to tell the OSPIPSV driver the HW flash configuration being used.

This API should be called at least once in the application. If desired, it can be called multiple times when switching between communicating to different flash devices/using different configs.

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.
  Chip_Cs | - Flash Chip Select.

Returns
  - XST_SUCCESS if successful.
  - XST_DEVICE_IS_STARTED if the device is already started. It must be stopped to re-initialize.

Note
  If this function is not called at least once in the application, the driver assumes there is a single flash connected to the lower bus and CS line.

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_SetClkPrescaler | ( | XOspiPsv * | InstancePtr,
|  | u8 | Prescaler
| ) |  |

Configures the clock according to the prescaler passed.

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.
  Prescaler | - clock prescaler to be set.

Returns
  - XST_SUCCESS if successful.
  - XST_DEVICE_IS_STARTED if the device is already started.
  - XST_DEVICE_BUSY if the device is currently transferring data. It must be stopped to re-initialize.

Note
  None.

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

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_SetOptions | ( | XOspiPsv * | InstancePtr,
|  | u32 | Options
| ) |  |

This function sets the options for the OSPIPSV device driver.The options control how the device behaves relative to the OSPIPSV bus.

The device must be idle rather than busy transferring data before setting these device options.

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.
  Options | contains the specified options to be set. This is a bit mask where a 1 indicates the option should be turned ON and a 0 indicates no action. One or more bit Values may be contained in the mask. See the bit definitions named XOSPIPSV_*_OPTIONS in the file xospipsv.h.

Returns
  - XST_SUCCESS if options are successfully set.
  - XST_DEVICE_BUSY if the device is currently transferring data. The transfer must complete or be aborted before setting options.

Note
  This function is not thread-safe.

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

Referenced by OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_SetSdrDdrMode | ( | XOspiPsv * | InstancePtr,
|  | u32 | Mode
| ) |  |

Configures the edge mode (SDR or DDR)

Parameters

  InstancePtr | is a pointer to the XOspiPsv instance.
  Mode | is Edge mode. XOSPIPSV_EDGE_MODE_* represents valid values.

Returns
  - XST_SUCCESS
  - XST_FAILURE

Note
  None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::SdrDdrMode, XOSPIPSV_CONFIG_REG, XOSPIPSV_RD_DATA_CAPTURE_REG, and XOSPIPSV_WRITE_COMPLETION_CTRL_REG.

Referenced by FlashSetSDRDDRMode(), and 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

  InstancePtr | is a pointer to the XOspiPsv instance.
  CallBackRef | is the upper layer callback reference passed back when the callback function is invoked.
  FuncPointer | is 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().