Atmel SAM4L Xplained Pro Starter Kit Atmel ATSAM4L-XSTK ATSAM4L-XSTK Data Sheet

Product codes
ATSAM4L-XSTK
Page of 1204
365
42023E–SAM–07/2013
ATSAM4L8/L4/L2
– DTGLER: Is set if a Data toggle error occurs during a USB transaction.
17.6.3.9
Multi packet mode and single packet mode.
See 
 and just consider that an OUT
pipe corresponds to an IN endpoint, and an IN pipe corresponds to an OUT endpoint.
17.6.3.10
Management of control pipes
A control transaction is composed of three stages:
• SETUP
• Data (IN or OUT)
• Status (OUT or IN)
The user has to change the pipe token according to each stage.
For control pipes only, the token is assigned a specific initial data toggle sequence:
• SETUP: Data0
• IN: Data1
• OUT: Data1
17.6.3.11
Management of IN pipes
• Overview
IN packets are sent by the USB device controller upon IN requests from the host. All the data
can be read, acknowledging whether or not the bank is empty.
• Detailed description
The pipe and its descriptor in RAM must be pre configured.
The host can request data from the device in two modes, selected by writing to the IN Request
Mode bit in the Pipe n IN Request register (UPINRQn.INMODE):
• When INMODE is written to zero, the USBC will perform INRQ IN requests before freezing 
the pipe.
• When INMODE is written to one, the USBC will perform IN requests as long as the pipe is not 
frozen by the user.
The generation of IN requests starts when the pipe is unfrozen (UPCONn.PFREEZE is zero).
When the current bank is full, the RXINI and FIFO Control (UPSTAn.FIFOCON) bits will be set
simultaneously. This triggers a PnINT interrupt if the Received IN Data Interrupt Enable bit
(UPCONn.RXINE) is one.
RXINI shall be cleared by software to acknowledge the interrupt. This is done by writing a one to
t h e   R e c e i v e d   I N   D a t a   I n t e r r u p t   C l e a r   b i t   i n   t h e   P i p e   n   C o n t r o l   C l e a r   r e g i s t e r
(UPCONnCLR.RXINIC), which does not affect the pipe FIFO.
T h e   u s e r   r e a d s   t h e   b y t e   c o u n t   o f   t h e   c u r r e n t   b a n k   f r o m   t h e   d e s c r i p t o r   i n   R A M
(Pn_PCKSIZE_BK0/1.BYTE_COUNT) to know how many bytes should be read.
The user reads the IN data from the RAM and clears the FIFOCON bit to free the bank. This will
also cause a switch to the next bank if the IN endpoint is composed of multiple banks. The RXINI
and FIFOCON bits will be updated accordingly.