4.2. Endpoints

4.2.1. Control Endpoint

Each endpoint has an address which is a bitfield containing its USB address and flags to specify direction.

Table 4.1. Endpoint address bitfield

BitDefinitionValueDescription
0-29  USB Endpoint number
30USB_PIPE_ADDRESS_BOTH0Bit 31 determines direction
1Bidirectional
31USB_PIPE_ADDRESS_IN0OUT endpoint
1IN endpoint

If bit 30 (USB_PIPE_ADDRESS_BOTH) is set then the endpoint is bi-directional and bit 31 (USB_PIPE_ADDRESS_IN) should not be examined.

4.2.1. Control Endpoint

Endpoint address 0 represents the special control endpoint. The control endpoint is unique in being bi-directional i.e. pipes attached to this endpoint can be read and written to. This requires some special consideration when performing transactions (see Chapter 7, Transactions). The USB specification defines a standard set of transactions that may be performed on this endpoint to obtain device information and change the devices configuration. Every device has a control endpoint and must support the minimum set of device descriptors (see section 9.3 (page 183) in the USB Specification version 1.1