
iXPeRiPheRaLMoDuLes7(usB):usBFunCtionContRoLLeR(usB)
iX-1-8
ePson
s1C33L17teChniCaLManuaL
iX.1.4.1usBControl
endpoints
This macro has an endpoint (EP0) for control transfer and four general purpose-endpoints (EPa, EPb, EPc,
EPd). Endpoints, EPa, EPb, EPc and EPd can be used as endpoints for bulk- or interrupt- or isochronous-type
transfer, respectively. There is no difference between bulk and interrupt transfers in terns of hardware.
The macro hardware provides endpoints and manages transactions. However, it does not provide a management
function in the interface defined for the USB (hereinafter referred to as USB-defined interface). The USB-
defined interface should be implemented in your firmware. According to the device-specific descriptor
definition, set endpoints as required and configure the USB-defined interface using an appropriate endpoint
combination.
Besides variable control items and statuses that are controlled for each transfer operation, each endpoint has
fixed basic setting items determined by the USB-defined interface. The basic setting items should be set up
when initializing the chip or when the USB-defined interface is switched in response to a SetInterface() request.
Table IX.1.4.1.1 lists the basic setting items for the EP0 endpoint (default control pipe).
The EP0 endpoint shares the register set and FIFO region between the In and OUT directions. For data and
status stages at the EP0 endpoint, set the data transaction direction in your firmware before executing such
stages.
TableIX.1.4.1.1BasicSettingItemsforEndpointEP0
Register/bit
EP0MaxSize
Description
Setsthemaximumpacketsizeto8,16,32or64for
theFS-modeoperation.
TheEP0endpointisassignedaregionofthesizethat
issetintheEP0MaxSizeregister,startingwithFIFO
address0.
item
Max.packetsize
Table IX.1.4.1.2 lists the basic setting items for the general-purpose endpoints (EPa, EPb, EPc, and EPd).
The EPa, EPb, EPc, and EPd endpoints allow optional settings for the transaction directions and the endpoint
numbers, which allows up to four discrete endpoints to be used. Set up and/or enable these endpoints as
appropriate according to the definitions for the USB-defined interface.
TableIX.1.4.1.2SettingItemsforEndpointsEPa,EPb,EPcandEPd
Register/bit
EPx{x=a,b,c,d}Config.INxOUT
EPx{x=a,b,c,d}MaxSize_H,
EPx{x=a,b,c,d}MaxSize_L
EPx{x=a,b,c,d}Config.EndPointNumber
EPx{x=a,b,c,d}Config.ToggleMode
EPx{x=a,b,c,d}Config.EnEndPoint
EPx{x=a,b,c,d}StartAdrs_H,
EPx{x=a,b,c,d}StartAdrs_L
Description
Setsthetransferdirectionforeachendpoint.
Setsthemaximumpacketsizeofeachendpointtoany
desiredvaluebetween1and1024bytes.
Forendpointsthatperformbulktransfers,setthemto
8,16,32or64bytesinFSmode.
Setseachendpointnumbertoanydesiredvalue
between0x1and0xF.
Setsamodeforatogglesequence.Setitto0foran
endpointthatperformsbulktransfer.
0:Togglesonlyinsuccessfultransactions.
1:Togglesforeverytransaction.
Enableseachendpoint.
SetitupwhentheUSB-definedinterfacethatusesthe
relevantendpointisenabled.
Setsaregiontobeassignedtoeachendpointusing
FIFOaddresses.
ForaFIFOregion,assignaregionequivalenttothe
maximumpacketsizesetfortherelevantendpointor
greater.NotethatthesizeoftheFIFOregionaffects
datatransferthroughput.
FordetailsofFIFOregionassignment,seethe"FIFO
Management"section.
item
Transactiondirection
Max.packetsize
Endpointnumber
Togglemode
Enableendpoint
FIFOregion