AT32F425
Series Reference Manual
2022.03.30
Page 357
Ver 2.01
Unmask CHHLTD
Disable Channel
if (XactErr)
{
Increment Error Count
Unmask ACK
}
else
{
Reset Error Count
}
}
else if (CHHLTD)
{
Mask CHHLTD
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else
{
Re-initialize Channel (Do ping protocol for HS)
}
}
else if (ACK)
{
Reset Error Count
Mask ACK
}
Notes:
The application can only write the transmit FIFO when the transmit FIFO and request queue has
free spaces. The application must check whether there is a free space in the transmit FIFO through
the NPTXFEMP bit in the OTGFS_GINTSTS register
The application can only write a request when the request queue has fress spaces and wait until
an XFERC interrupt is received
20.5.3.9 Initialize interrupt IN transfers
Figure 20-8 shows the operation process of a typical interrupt IN transfer. Refer to channel 2 (ch_2). The
assumptions are as follows:
The application is attempting to receive one largest-packet-size packet (transfer size is 64 bytes)
from an odd frame
The receive FIFO can store at least one largest-packet-size packet and two status DWORDs per
packet (1031 bytes for full-speed transfer)
The periodic request queue depth is 4
(
1
)
Common interrupt IN operation process
The sequence of operations shown in Figure 21-8 (channel 2) is as follows:
1.
Initialize channel 2 (according to OTGFS channel initialization requirements). The application must
set the ODDFRM bit in the OTGFS_HCCHAR2 register
2.
Set the CHENA bit in the OTGFS_HCCHAR2 register to write an IN request to the periodic request
queue
3.
The OTGFS host writes an IN request to the periodic request queue each time the CHENA is set in
the OTGFS_HCCHAR2 register