Nec upd985xx usb device driver, Name, Nec upd985xx usb hardware – Comtrol eCos User Manual
Page 797: Endpoint data structures

NEC uPD985xx USB Device Driver
Name
NEC uPD985xx USB Support
— Device driver for the on-chip NEC uPD985xx USB device
NEC uPD985xx USB Hardware
The NEC uPD985xx family of processors is supplied with an on-chip USB slave device, the UDC (USB Device
Controller). This supports seven endpoints. Endpoint 0 can only be used for control messages. Endpoints 1 and
2 are for isochronous transmits and receives respectively. Endpoints 3 and 4 support bulk transmits and receives.
Endpoints 5 and 6 normally support interrupt transmits and receives, but endpoint 5 can also be configured to
support bulk transmits. At this time only the control endpoint 0, the bulk endpoints 3 and 4, and the interrupt
endpoint 5 are supported.
Endpoint Data Structures
The uPD985xx USB device driver can provide up to four data structures corresponding to the four
supported endpoints: a usbs_control_endpoint structure
usbs_upd985xx_ep0
; usbs_tx_endpoint structures
usbs_upd985xx_ep3
and
usbs_upd985xx_ep5
; and a usbs_rx_endpoint
usbs_upd985xx_ep4
. The header file
cyg/io/usb/usbs_nec_upd985xx.h
provides declarations for these.
Not all applications will require support for all the endpoints. For example, if the intended use of the UDC only
involves peripheral to host transfers then
usbs_upd985xx_ep4
is redundant. The device driver provides configu-
ration options to control the presence of each endpoint:
1. Endpoint
0
is
controlled
by
CYGFUN_DEVS_USB_UPD985XX_EP0
.
This
defaults
to
enabled
if
there are any higher-level packages that require USB hardware or if the global preference
CYGGLO_IO_USB_SLAVE_APPLICATION
is enabled, otherwise it is disabled. Usually this has the desired
effect. It may be necessary to override this in special circumstances, for example if the target board uses an
external USB chip in preference to the UDC and it is that external chip’s device driver that should be used
rather than the on-chip UDC. It is not possible to disable endpoint 0 and at the same time enable one or both
of the other endpoints, since a USB device is only usable if it can process the standard control messages.
2. Endpoint 3 is controlled by
CYGPKG_DEVS_USB_UPD985XX_EP3
. By default this endpoint is disabled: accord-
ing to NEC erratum U3 there may be problems when attempting bulk transfers of 192 bytes or greater. As an
alternative the device driver provides support for endpoint 5, configured to allow bulk transfers. Endpoint 3
can be enabled if the application only requires bulk transfers of less than 192 bytes, or if this erratum is not
applicable to the system being developed for other reasons.
3. Endpoint 4 is controlled by
CYGPKG_DEVS_USB_UPD985XX_EP4
. This is enabled by default whenever endpoint
0 is enabled, but it can be disabled manually.
4. Endpoint
5
is
controlled
by
CYGPKG_DEVS_USB_UPD985XX_EP5
.
This
is
enabled
by
default
whenever endpoint 0 is enabled, but it can be disabled manually. There is also a configuration option
CYGIMP_DEVS_USB_UPD985XX_EP5_BULK
, enabled by default. This option allows the endpoint to be used
for bulk transfers rather than interrupt transfers.
693