USB Controller
24.3.1.29 ROM_USBHostEndpointConfig
Sets the base configuration for a host endpoint.
Prototype:
void
ROM_USBHostEndpointConfig(uint32_t ui32Base,
uint32_t ui32Endpoint,
uint32_t ui32MaxPayload,
uint32_t ui32NAKPollInterval,
uint32_t ui32TargetEndpoint,
uint32_t ui32Flags)
ROM Location:
ROM_APITABLE is an array of pointers located at 0x0100.0010.
ROM_USBTABLE is an array of pointers located at ROM_APITABLE[16].
ROM_USBHostEndpointConfig is a function pointer located at ROM_USBTABLE[22].
Parameters:
ui32Base specifies the USB module base address.
ui32Endpoint is the endpoint to access.
ui32MaxPayload is the maximum payload for this endpoint.
ui32NAKPollInterval is the either the NAK timeout limit or the polling interval depending on
the type of endpoint.
ui32TargetEndpoint is the endpoint that the host endpoint is targeting.
ui32Flags are used to configure other endpoint settings.
Description:
This function will set the basic configuration for the transmit or receive portion of an endpoint
in host mode. The ui32Flags parameter determines some of the configuration while the other
parameters provide the rest. The ui32Flags parameter determines whether this is an IN end-
point (USB_EP_HOST_IN or USB_EP_DEV_IN) or an OUT endpoint (USB_EP_HOST_OUT
or USB_EP_DEV_OUT), whether this is a Full speed endpoint (USB_EP_SPEED_FULL) or a
Low speed endpoint (USB_EP_SPEED_LOW).
The USB_EP_MODE_ flags control the type of the endpoint.
USB_EP_MODE_CTRL is a control endpoint.
USB_EP_MODE_ISOC is an isochronous endpoint.
USB_EP_MODE_BULK is a bulk endpoint.
USB_EP_MODE_INT is an interrupt endpoint.
The ui32NAKPollInterval parameter has different meanings based on the USB_EP_MODE
value and whether or not this call is being made for endpoint zero or another endpoint. For
endpoint zero or any Bulk endpoints, this value always indicates the number of frames to allow
a device to NAK before considering it a timeout. If this endpoint is an isochronous or interrupt
endpoint, this value is the polling interval for this endpoint.
For interrupt endpoints the polling interval is simply the number of frames between polling
an interrupt endpoint. For isochronous endpoints this value represents a polling interval of 2
∧
(ui32NAKPollInterval - 1) frames. When used as a NAK timeout, the ui32NAKPollInterval
value specifies 2
∧
(ui32NAKPollInterval - 1) frames before issuing a time out. There are two
special time out values that can be specified when setting the ui32NAKPollInterval value. The
first is MAX_NAK_LIMIT which is the maximum value that can be passed in this variable. The
322 April 8, 2013