Dma Mode 1: In Endpoints - Sharp LH79524 User Manual

Table of Contents

Advertisement

LH79524/LH79525 User's Guide

17.1.5.4 DMA Mode 1: IN Endpoints

For operation in DMA Mode 1, these steps describe programming an IN endpoint:
1.
Program the proper interrupt enable bit in the IN Interrupt Enable (IIE) register to 1 to
enable that interrupt.
2.
Program the INDEX register to the EP number.
3.
Then program the INCSR2:AUTO_SET and INCSR2:USB_DMA_EN bit to 1. This
enables DMA bulk transfers for Mode 1 operation and the automatic IN_PKT_RDY
clearing function.
4.
Program the DMA registers with:
– ADDRx: Memory address of block to send
– COUNTx: Size of data block to be sent
– CNTLx: Program the DMAEN, DMA_MODE, INTEN, and DIRECTION bits to 1.
When the FIFO becomes available in the USB Device, the DMA controller requests bus
mastership and transfers a packet to the FIFO. The USB Device automatically sets the
IN_PKT_RDY bit to 1 in the appropriate INCSR1 register. This process continues until the
entire data block has been transferred to the USB Device. The DMA controller then asserts
an interrupt to the VIC. If the last packet to be loaded was less than the maximum packet
size for the endpoint, the IN_PKT_RDY bit will not have be set. Software must set the
IN_PKT_RDY bit to allow the last 'short packet' to be sent. If the last packet to be loaded
was of the maximum packet size, software should still set the IN_PKT_RDY bit to send a
null packet signifying the end of the transfer.
17.1.6 Remote Wakeup
The USB Device is capable of being remotely awakened by software following an internal
or external stimulus. To enable this capability, the PMR:ENABLE_SUSPEND bit must be
programmed to 1. When the USB Device enters Suspend, it programs the
PMR:SUSPEND_MODE to 1, which signals software of that fact.
Once in the Suspend mode, software must program the PMR:UC_RESUME bit to 1 to exit.
(If the clock to the USB Device has been stopped, it will need to be restarted before this
write can occur.)
The software should leave this bit set for approximately 10 ms (minimum of 2 ms, a max-
imum of 15 ms) then reset it to 0. By this time the hub should have taken over driving
Resume signaling on the USB. Note that no Resume Interrupt will be generated when soft-
ware initiates a remote wakeup.
Program the packet size corresponding to INMAXP into bits [14:8].
Version 1.0
Universal Serial Bus Device
17-7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lh79525

Table of Contents