Rainbow Electronics AT91CAP9S250A User Manual

Page 858

Advertising
background image

858

6264A–CAP–21-May-07

AT91CAP9S500A/AT91CAP9S250A

– Size of buffer to send: size of the buffer to be sent to the host.

– END_B_EN: The endpoint can validate the packet (according to the values

programmed in the AUTO_VALID and SHRT_PCKT fields of UDPHS_EPTCTLx.)
(See

“UDPHS Endpoint Control Register” on page 893

and

Figure 44-11. Autovalid

with DMA

)

– END_BUFFIT: generate an interrupt when the BUFF_COUNT in

UDPHS_DMASTATUSx reaches 0.

– CHANN_ENB: Run and stop at end of buffer

The auto-valid-bank mechanism allows the transfer of data (IN & OUT) without the intervention
of the CPU. This means that bank validation (set TX_PK_RDY or clear the RX_BK_RDY bit) is
done by hardware.

A transfer descriptor can be used. Instead of programming the register directly, a descriptor
s h o u l d b e p r o g r a m m e d a n d t h e a d d r e s s o f t h i s d e s c r i p t o r i s t h e n g i v e n t o
UDPHS_DMANXTDSC to be processed after setting the LDNXT_DSC field (Load Next Descrip-
tor Now) in UDPHS_DMACONTROLx register.

The structure that defines this transfer descriptor must be aligned.

Each buffer to be transferred must be described by a DMA Transfer descriptor (see

“UDPHS

DMA Channel Transfer Descriptor” on page 904

). Transfer descriptors are chained. Before exe-

cuting transfer of the buffer, the UDPHS may fetch a new transfer descriptor from the memory
address pointed by the UDPHS_DMANXTDSCx register. Once the transfer is complete, the
transfer status is updated in the UDPHS_DMASTATUSx register.

To chain a new transfer descriptor with the current DMA transfer, the DMA channel must be
stopped.

To do so, INTDIS_DMA and TX_BK_RDY may be set in the UDPHS_EPTCTLENBx

register.

It is also possible for the application to wait for the completion of all transfers. In this

case the LDNXT_DSC field in the last transfer descriptor UDPHS_DMACONTROLx register
must be set to 0 and CHANN_ENB set to 1.

Then the application can chain a new transfer descriptor.

The INTDIS_DMA can be used to stop the current DMA transfer if an enabled interrupt is trig-
gered. This can be used to stop DMA transfers in case of errors.

The application can be notified at the end of any buffer transfer (ENB_BUFFIT bit in the
UDPHS_DMACONTROLx register).

Advertising