XilinxProcessorIPLib/drivers/ospipsv/examples/xospipsv_flash_intr_example.c
u32 GetRealAddr(XOspiPsv *OspiPsvPtr, u32 Address)
{
	u32 RealAddr = Address;
	u8 Chip_Sel = XOSPIPSV_SELECT_FLASH_CS0;

	if ((OspiPsvPtr->Config.ConnectionMode == XOSPIPSV_CONNECTION_MODE_STACKED) &&
			(Address & Flash_Config_Table[FCTIndex].FlashDeviceSize)) {
		Chip_Sel = XOSPIPSV_SELECT_FLASH_CS1;
		RealAddr = Address & (~Flash_Config_Table[FCTIndex].FlashDeviceSize);
	}

	(void)XOspiPsv_SelectFlash(OspiPsvPtr, Chip_Sel);

	return RealAddr;
}
/*****************************************************************************/
/**
 *
 * This functions translates the address based on the type of interconnection.
 * In case of stacked, this function asserts the corresponding slave select.
 *
 * @param	OspiPsvPtr is a pointer to the OSPIPSV driver component to use.
 * @param	Address which is to be accessed (for erase, write or read)
 *
 * @return	RealAddr is the translated address - for single it is unchanged;
 *			for stacked, the lower flash size is subtracted;
 *
 * @note	In addition to get the actual address to work on flash this
 *			function also selects the CS based on the configuration detected.
 *
 ******************************************************************************/
This functions translates the address based on the type of interconnection.
In case of stacked, this function asserts the corresponding slave select.

@param       OspiPsvPtr is a pointer to the OSPIPSV driver component to use.
@param       Address which is to be accessed (for erase, write or read)

@return      RealAddr is the translated address - for single it is unchanged;
for stacked, the lower flash size is subtracted.

@note        In addition to get the actual address to work on flash this
function also selects the CS based on the configuration detected.
This functions translates the address based on the type of interconnection . In case of stacked this function asserts the corresponding slave select . @param OspiPsvPtr is a pointer to the OSPIPSV driver component to use . @param Address which is to be accessed ( for erase write or read ) @return RealAddr is the translated address - for single it is unchanged ; for stacked the lower flash size is subtracted . @note In addition to get the actual address to work on flash this function also selects the CS based on the configuration detected .
u32 GetRealAddr(XOspiPsv *OspiPsvPtr, u32 Address)
{
	u32 RealAddr = Address;
	u8 Chip_Sel = XOSPIPSV_SELECT_FLASH_CS0;
	if ((OspiPsvPtr->Config.ConnectionMode == XOSPIPSV_CONNECTION_MODE_STACKED) &&
			(Address & Flash_Config_Table[FCTIndex].FlashDeviceSize)) {
		Chip_Sel = XOSPIPSV_SELECT_FLASH_CS1;
		RealAddr = Address & (~Flash_Config_Table[FCTIndex].FlashDeviceSize);
	}
	(void)XOspiPsv_SelectFlash(OspiPsvPtr, Chip_Sel);
	return RealAddr;
}
u32 GetRealAddr ( XOspiPsv * OspiPsvPtr , u32 Address ) { u32 RealAddr = Address ; u8 Chip_Sel = XOSPIPSV_SELECT_FLASH_CS0 ; if ( ( OspiPsvPtr -> Config . ConnectionMode == XOSPIPSV_CONNECTION_MODE_STACKED ) && ( Address & Flash_Config_Table [ FCTIndex ] . FlashDeviceSize ) ) { Chip_Sel = XOSPIPSV_SELECT_FLASH_CS1 ; RealAddr = Address & ( ~ Flash_Config_Table [ FCTIndex ] . FlashDeviceSize ) ; } ( void ) XOspiPsv_SelectFlash ( OspiPsvPtr , Chip_Sel ) ; return RealAddr ; }
This functions translates the address based on the type of interconnection.
This functions translates the address based on the type of interconnection .