EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 208
Storage Ports
{
status = CyU3PSibQueryUnit (i, j, &unitInfo);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "Error: Failed to query partition %d on port
%d\r\n", j, i);
break;
}
CyU3PDebugPrint (6, "Dev %d, Unit %d: location=%d numBlocks=%d\r\n",
i, j, unitInfo.location, unitInfo.numBlocks);
if (unitInfo.location == CY_U3P_SIB_LOCATION_USER)
{
CyU3PDebugPrint (4, "Dev %d: Found user partition\r\n", i);
unitsFound++;
}
}
}
If an existing partition needs to be removed for the specified storage port, this can be done using the API
CyU3PSibRemovePartitions. This reunifies the complete storage available on a device as a single data partition (volume).
CyU3PSibPartitionStorage can be used to partition the storage device into multiple logical units that can be separately
accessed.
if ((unitsFound < CY_FX_SIB_PARTITIONS) && (glDevInfo[i].writeable))
{
/* Make sure any existing partitioning is removed. */
CyU3PSibRemovePartitions (i);
/* Makes sure that each storage device is partitioned into the
required number of units. */
for (j = 0; j < CY_FX_SIB_PARTITIONS; j++)
{
partsize[j] = (glDevInfo[i].numBlks / CY_FX_SIB_PARTITIONS);
parttype[j] = CY_U3P_SIB_LUN_DATA;
}
CyU3PDebugPrint (4, "Port %d: Creating partitions as required\r\n",i);
status = CyU3PSibPartitionStorage (i, CY_FX_SIB_PARTITIONS, partsize,
parttype);
if (status != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (2, "Error: Failed to partition storage device %d,
status=%d\r\n", i, status);
continue;
}
}
Note: APIs CyU3PSibPartitionStorage and CyU3PSibRemovePartitions are used to manage virtual partitions created by the
firmware.
9.5.1.6 Handling SIB Events
The SIB events are based on the bits of the SD/MMC/SDIO interrupt request register (SDMMC_INTR). These bits are set to 1
whenever a bit in SDMMC_STATUS changes from 0 to 1.