©
2005 Microchip Technology Inc.
DS01003A-page 17
AN1003
FIGURE 11:
MSDDataIn()
(BULK-IN TRANSPORT) FLOWCHART
dCSWDataResidue-
=
MSD_IN_EP_SIZE
dCBWDataTransferLength-
=
MSD_IN_EP_SIZE
MSDDataIn()
Is
dCSWStatus
= 0x00
MSD_IN_EP_SIZE?
MSD_IN_EP_SIZE
Bytes of Data Written
Is
dCSWStatus!
= 0x0?
Zero Padded Data
Output
dataLen
=
min(bCBWDataTransferLength
,
MSD_IN_EP_SIZE)
Bytes of Data Written to Transmit Register and Sent
dCSWDataResidue-
=
dataLen
dCBWDataTransferLength-
=
dataLen
Remaining Data
(dCSWDataResidue)
Written to Transmit
dCSWDataResidue
=
dCBWDataTransferLength
=
0
Return
Yes
No
Yes
No
Register and Sent
(
sendData()
)
to Transmit Register
|dCBWDataTransferLength
–
dCSWDataResidue|
and remaining transmit data
length is larger than
深圳市英锐恩科技有限公司
www.enroo-tech.com