EasyManuals Logo

Cypress EZ-USB FX3 User Manual

Cypress EZ-USB FX3
660 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #212 background imageLoading...
Page #212 background image
EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 212
Storage Ports
number to be passed in CyU3PSibReadWriteRequest is "1". This function internally initiates the DMA channel for transferring
the specified amount of data. It is therefore expected that the DMA channel be left in the idle state
(CY_U3P_DMA_CONFIGURED) when calling this API.
CyU3PDmaChannelSetXfer sets up a one-to-one DMA channel for data transfer. The sockets corresponding to a DMA
channel are left disabled when the channel is created, so that transfers are started only when desired by the user. This
function enables a DMA channel to transfer a specified amount of data before suspending again. An infinite transfer can be
started by specifying a transfer size of 0. This function should be called only when the channel is in the
CY_U3P_DMA_CONFIGURED state. Refer to FX3 DMA Subsystem chapter on page 58 for more details.
9.5.2.1 Sending Vendor Commands to SD/ MMC
The CyU3PSibVendorAccess function is used to send general SD/MMC commands to storage device/cards attached to the
FX3S device and receive the corresponding response. Custom commands can be implemented using this function.
Command transmission is initiated and completed in the same manner as described in 9.5.1.5 Sending SD/MMC/SDIO
Commands on page 206.
9.5.2.2 Setting the Granularity of Write Operations
CyU3PSibSetWriteCommitSize sets the sector granularity at which write operations are committed to the SD/MMC storage.
Committing write data to SD/MMC storage in small chunks can lead to poor write transfer performance. The write
performance to these devices can be improved by combining write operations with sequential addresses and performing a
single commit (STOP_TRANSMISSION) operation.
/* Commit data in 8MB chunks: 16k sectors */
CyU3PSibSetWriteCommitSize (i, 16384);
By default, this value is set to 1, meaning that a write of one sector or more is immediately committed to the storage device.
9.5.2.3 Checking Card Status
The CyU3PSibGetCardStatus function sends the CMD13 (SEND_STATUS) command to the SD/MMC device connected on
the specified storage port and provides the card status response that is received. This API can be used to check whether the
storage device is accessible and is in the TRAN state, where it can receive new commands.
9.5.2.4 Aborting Ongoing Transaction to S-Port
The SIB is reset by writing to the bit SDMMC_CS. RSTCONT and then polled for it to become 0. Software writes '1' to bring
the SIB FSMs to a known state. Hardware writes '0' when reset is complete. The values of the CFG registers are not affected
by RSTCONT. Internal queues are flushed by RSTCONT. Then the SDMMC_CS.WRDCARD and SDMMC_CS.RDDCARD
bits are selectively set, and the SIB is reset again by setting SDMMC_CS.RSTCONT.
The CyU3PSibAbortRequest API is used to abort any ongoing transactions on the specified port. Prior to calling this function,
the corresponding DMA channel should be reset.
Void CyFxMscApplnSibCB (
uint8_t portId,
CyU3PSibEventType evt,
CyU3PReturnStatus_t status)
{
if ((evt == CY_U3P_SIB_EVENT_DATA_ERROR) || (evt == CY_U3P_SIB_EVENT_ABORT))
{
/* Transfer has failed. Reset the DMA channel. */
if (glCmdDirection)
{
CyU3PDmaChannelReset ((CyU3PDmaChannel *) &glChHandleMscOut);
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cypress EZ-USB FX3 and is the answer not in the manual?

Cypress EZ-USB FX3 Specifications

General IconGeneral
BrandCypress
ModelEZ-USB FX3
CategoryController
LanguageEnglish

Related product manuals