Texas Instruments TMS320DM357 Switch User Manual


 
TX mode
Write
MaxP bytes
to FIFO
Last
packet
?
No
Yes
Set TxPktRdy
and set DataEnd
state −> IDLE
Return
TxPktRdy
Set
USBControllerHostandPeripheralModesOperation
www.ti.com
3.1.1.5.2TXMode
WhentheendpointisinTXstateallarrivingINtokensneedtobetreatedaspartofadataphaseuntilthe
requiredamountofdatahasbeensenttothehost.IfeitheraSETUPoranOUTtokenisreceivedwhile
theendpointisintheTXstate,thiswillcauseaSetupEndconditiontooccurasthecoreexpectsonlyIN
tokens.SeeFigure7.
ThreeeventscancauseTXmodetobeterminatedbeforetheexpectedamountofdatahasbeensent:
1.ThehostsendsaninvalidtokencausingaSETUPENDcondition(bit4ofPERI_CSR0set).
2.Thesoftwaresendsapacketcontaininglessthanthemaximumpacketsizeforendpoint0.
3.Thesoftwaresendsanemptydatapacket.
Untilthetransactionisterminated,thesoftwaresimplyneedstoloadtheFIFOwhenitreceivesan
interruptthatindicatesapackethasbeensentfromtheFIFO.(Aninterruptisgeneratedwhen
TXPKTRDYiscleared.)
Whenthesoftwareforcestheterminationofatransfer(bysendingashortoremptydatapacket),itshould
settheDATAENDbitofPERI_CSR0(bit3)toindicatetothecorethatthedataphaseiscompleteand
thatthecoreshouldnextreceiveanacknowledgepacket.
Figure7.TXModeFlowChart
34UniversalSerialBus(USB)ControllerSPRUGH3November2008
SubmitDocumentationFeedback