Datasheet

1079
SAM3X / SAM3A [DATASHEET]
Atmel-11057C-ATARM-SAM3X-SAM3A-Datasheet_23-Mar-15
39.5.3.5 Pipe Reset
A pipe can be reset at any time by writing a one to the Pipe x Reset (UOTGHS_HSTPIP.PRSTx) bit. This is
recommended before using a pipe upon hardware reset or when a USB bus reset has been sent. This resets:
the internal state machine of this pipe,
the receive and transmit bank FIFO counters,
all the registers of this pipe (UOTGHS_HSTPIPCFGx, UOTGHS_HSTPIPISRx, UOTGHS_HSTPIPIMRx),
except its configuration (UOTGHS_HSTPIPCFGx.ALLOC, UOTGHS_HSTPIPCFGx.PBK,
UOTGHS_HSTPIPCFGx.PSIZE, UOTGHS_HSTPIPCFGx.PTOKEN, UOTGHS_HSTPIPCFGx.PTYPE,
UOTGHS_HSTPIPCFGx.PEPNUM, UOTGHS_HSTPIPCFGx.INTFRQ) and its Data Toggle Sequence field
(UOTGHS_HSTPIPISRx.DTSEQ).
The pipe configuration remains active and the pipe is still enabled.
The pipe reset may be associated with a clear of the data toggle sequence. This can be achieved by setting the
Reset Data Toggle bit in the Pipe x Control register (UOTGHS_HSTPIPIMRx.RSTDT) (by writing a one to the
Reset Data Toggle Set bit in the Pipe x Control Set register (UOTGHS_HSTPIPIERx.RSTDTS)).
In the end, the user has to write a zero to the UOTGHS_HSTPIP.PRSTx bit to complete the reset operation and to
start using the FIFO.
39.5.3.6 Pipe Activation
The pipe is maintained inactive and reset (see Section 39.5.3.5 for more details) as long as it is disabled
(UOTGHS_HSTPIP.PENx is zero). The Data Toggle Sequence field (UOTGHS_HSTPIPISRx.DTSEQ) is also
reset.
The algorithm represented on Figure 39-23 on page 1079 must be followed in order to activate a pipe.
Figure 39-23. Pipe Activation Algorithm
As long as the pipe is not correctly configured (UOTGHS_HSTPIPISRx.CFGOK is zero), the controller cannot
send packets to the device through this pipe.
The UOTGHS_HSTPIPISRx.CFGOK bit is only set if the configured size and number of banks are correct as
compared to their maximal allowed values for the pipe (see Table 39-1 on page 1053) and to the maximal FIFO
size (i.e. the DPRAM size).
Pipe
Activation
UOTGHS_HSTPIPISRx.CFGOK == 1?
ERROR
Ye s
Pipe Activated
Enable the pipe.
UOTGHS_HSTPIP.PENx = 1
Test if the pipe configuration is
correct.
UOTGHS_HSTPIPPCFGx
.INTFRQ
.PEPNUM
.PTYPE
.PTOKEN
.PSIZE
.PBK
.ALLOC
Configure the pipe:
- interrupt request frequency
-
endpoint number
-
type
-
size
-
number of banks
Allocate the configured DPRAM banks
No