Each endpoint has an address which is a bitfield containing its USB address and flags to specify direction.
Table 4.1. Endpoint address bitfield
Bit | Definition | Value | Description |
---|---|---|---|
0-29 | USB Endpoint number | ||
30 | USB_PIPE_ADDRESS_BOTH | 0 | Bit 31 determines direction |
1 | Bidirectional | ||
31 | USB_PIPE_ADDRESS_IN | 0 | OUT endpoint |
1 | IN 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.
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