28 USB FUNCTION CONTROLLER (USB)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
28-3
* When a register present for a specific end-point is referred to:
EP
x
{
x
=0,a,b,c,d}register name + register, EP
x
{
x
=a,b,c,d}register name + register, and so forth.
Example: “EP
x
{
x
=0,a,b,c,d}IntStat register”, “EP
x
{
x
=a,b,c,d}Control register”
USB Control
28.5.1
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-de-
fined 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 28.5.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 sta-
tus stages at the EP0 endpoint, set the data transaction direction in your firmware before executing such stages.
5.1.1 Basic Setting Items for Endpoint EP0
Table 28.
Item
Register/bit
Description
Max. packet size
EP0MaxSize
Sets the maximum packet size to 8, 16, 32 or 64 for the FS-
mode operation.
The EP0 endpoint is assigned a region of the size that is set
in the EP0MaxSize register, starting with FIFO address 0.
Table 28.5.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 num-
bers, 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.
5.1.2 Setting Items for Endpoints EPa, EPb, EPc and EPd
Table 28.
Item
Register/bit
Description
Transaction direction
EP
x
{
x
=a,b,c,d}Config.INxOUT
Sets the transfer direction for each endpoint.
Max. packet size
EP
x
{
x
=a,b,c,d}MaxSize_H,
EP
x
{
x
=a,b,c,d}MaxSize_L
Sets the maximum packet size of each endpoint to any de-
sired value between 1 and 1024 bytes.
For endpoints that perform bulk transfers, set them to 8, 16,
32 or 64 bytes in FS mode.
Endpoint number
EP
x
{
x
=a,b,c,d}Config.EndPointNumber
Sets each endpoint number to any desired value between
0x1 and 0xf.
Toggle mode
EP
x
{
x
=a,b,c,d}Config.ToggleMode
Sets a mode for a toggle sequence. Set it to 0 for an end-
point that performs bulk transfer.
0: Toggles only in successful transactions.
1: Toggles for every transaction.
Enable endpoint
EP
x
{
x
=a,b,c,d}Config.EnEndPoint
Enables each endpoint.
Set it up when the USB-defined interface that uses the rel-
evant endpoint is enabled.
FIFO region
EP
x
{
x
=a,b,c,d}StartAdrs_H,
EP
x
{
x
=a,b,c,d}StartAdrs_L
Sets a region to be assigned to each endpoint using FIFO
addresses.
For a FIFO region, assign a region equivalent to the maxi-
mum packet size set for the relevant endpoint or greater.
Note that the size of the FIFO region affects data transfer
throughput.
For details of FIFO region assignment, see the “FIFO Man-
agement” section.
Transaction
This macro hardware executes transactions while its interface provides the firmware with utilities for executing
transactions. The interface to the firmware is implemented through control and status registers as well as the
interrupt signal which is asserted depending on the status. For settings that enable asserting interruption accord-
ing to the status, see the section on register description.