Atmel Evaluation Kit AT91SAM9X35-EK AT91SAM9X35-EK Data Sheet

Product codes
AT91SAM9X35-EK
Page of 1301
509
SAM9X35 [DATASHEET]
11055E–ATARM–10-Mar-2014
Configuration examples of Bulk OUT endpoint type follow below.
With DMA
AUTO_VALID: Automatically validate the packet and switch to the next bank.
EPT_ENABL: Enable endpoint.
Without DMA
RXRDY_TXKL: An interrupt is sent after a new packet has been stored in the endpoint FIFO.
EPT_ENABL: Enable endpoint. 
32.6.7 DPRAM Management
Endpoints can only be allocated in ascending order, from the endpoint 0 to the last endpoint to be allocated. The user
shall therefore configure them in the same order.
The allocation of an endpoint x starts when the Number of Banks field in the UDPHS Endpoint Configuration Register
(UDPHS_EPTCFGx.BK_NUMBER) is different from zero. Then, the hardware allocates a memory area in the DPRAM
and inserts it between the x-1 and x+1 endpoints. The x+1 endpoint memory window slides up and its data is lost. Note
that the following endpoint memory windows (from x+2) do not slide.
Disabling an endpoint, by writing a one to the Endpoint Disable bit in the UDPHS Endpoint Control Disable Register
(UDPHS_EPTCTLDISx.EPT_DISABL), does not reset its configuration:
The Endpoint Banks (UDPHS_EPTCFGx.BK_NUMBER), 
The Endpoint Size (UDPHS_EPTCFGx.EPT_SIZE),
The Endpoint Direction (UDPHS_EPTCFGx.EPT_DIR), and
The Endpoint Type (UDPHS_EPTCFGx.EPT_TYPE).
To free its memory, the user shall write a zero to the UDPHS_EPTCFGx.BK_NUMBER field. The x+1 endpoint memory
window then slides down and its data is lost. Note that the following endpoint memory windows (from x+2) do not slide.
 illustrates the allocation and reorganization of the DPRAM in a typical example.
Figure 32-6. Allocation and Reorganization of the DPRAM
1.
The endpoints 0 to 5 are enabled, configured and allocated in ascending order. 
Each endpoint then owns a memory area in the DPRAM.
2.
The endpoint 3 is disabled, but its memory is kept allocated by the controller.
3.
In order to free its memory, its UDPHS_EPTCFGx.BK_NUMBER field is written to zero. The endpoint 4 memory 
window slides down, but the endpoint 5 does not move.
Free Memory
EPT0
EPT1
EPT2
EPT3
EPT4
EPT5
Free Memory
EPT0
EPT1
EPT2
EPT4
EPT5
Free Memory
EPT0
EPT1
EPT2
EPT4
EPT5
   Endpoint 3
Disabled
   Endpoint 3
Memory Freed
Free Memory
EPT0
EPT1
EPT2
EPT3 (larger size)
EPT5
   Endpoint 3
Activated
EPT4 Lost Memory
EPT4
Conflict
EPT3
(always allocated)
    Endpoints 0..5
Activated
Device:
UDPHS_EPTCTLENBx.EPT_ENABL = 1
Device:
Device:
Device:
UDPHS_EPTCTLDIS3.EPT_DISABL = 1 UDPHS_EPTCFG3.BK_NUMBER 
= 0
UDPHS_EPTCTLENB3.EPT_ENABL = 1
UDPHS_EPTCFGx.BK_NUMBER 
<> 0
UDPHS_EPTCFG3.BK_NUMBER 
<> 0