Package ch.ntb.usb
Class Usb_Endpoint_Descriptor
java.lang.Object
ch.ntb.usb.Usb_Descriptor
ch.ntb.usb.Usb_Endpoint_Descriptor
Represents the descriptor of an USB endpoint.
Endpoint descriptors are used to describe endpoints other than endpoint zero. Endpoint zero is always assumed to be a control endpoint and is configured before any descriptors are even requested. The host will use the information returned from these descriptors to determine the bandwidth requirements of the bus.
The length of the configuration descriptor is
Endpoint descriptors are used to describe endpoints other than endpoint zero. Endpoint zero is always assumed to be a control endpoint and is configured before any descriptors are even requested. The host will use the information returned from these descriptors to determine the bandwidth requirements of the bus.
The length of the configuration descriptor is
Usb_Descriptor.USB_DT_ENDPOINT_SIZE
and the type is
Usb_Descriptor.USB_DT_ENDPOINT
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Endpoint address mask (in bEndpointAddress).static final int
Endpoint address mask (in bEndpointAddress).static final int
Possible endpoint types (in bmAttributes).static final int
Possible endpoint types (in bmAttributes).static final int
Possible endpoint types (in bmAttributes).static final int
Possible endpoint types (in bmAttributes).static final int
Endpoint type mask (in bmAttributes).static final int
Maximum number of endpointsFields inherited from class ch.ntb.usb.Usb_Descriptor
USB_DT_CONFIG, USB_DT_CONFIG_SIZE, USB_DT_DEVICE, USB_DT_DEVICE_SIZE, USB_DT_ENDPOINT, USB_DT_ENDPOINT_AUDIO_SIZE, USB_DT_ENDPOINT_SIZE, USB_DT_HID, USB_DT_HUB, USB_DT_HUB_NONVAR_SIZE, USB_DT_INTERFACE, USB_DT_INTERFACE_SIZE, USB_DT_PHYSICAL, USB_DT_REPORT, USB_DT_STRING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte
Returns the endpoint address.
Bits 3..0: Endpoint number
Bits 6..4: Reserved.byte
Returns the intervall for polling endpoint data transfers.
Value in frame counts.byte
Returns the attributes of this endpoint.
Bits 1..0: Transfer Type (see USB_ENDPOINT_TYPE_XXX).
Bits 7..2: Reserved.byte
byte
byte[]
getExtra()
Returns the data of extra descriptor(s) if available.int
Returns the number of bytes of the extra descriptor.short
Returns the maximum packet size of this endpoint is capable of sending or receiving.toString()
Methods inherited from class ch.ntb.usb.Usb_Descriptor
getBDescriptorType, getBLength
-
Field Details
-
USB_MAXENDPOINTS
public static final int USB_MAXENDPOINTSMaximum number of endpoints- See Also:
-
USB_ENDPOINT_ADDRESS_MASK
public static final int USB_ENDPOINT_ADDRESS_MASKEndpoint address mask (in bEndpointAddress).- See Also:
-
USB_ENDPOINT_DIR_MASK
public static final int USB_ENDPOINT_DIR_MASKEndpoint address mask (in bEndpointAddress).- See Also:
-
USB_ENDPOINT_TYPE_MASK
public static final int USB_ENDPOINT_TYPE_MASKEndpoint type mask (in bmAttributes).- See Also:
-
USB_ENDPOINT_TYPE_CONTROL
public static final int USB_ENDPOINT_TYPE_CONTROLPossible endpoint types (in bmAttributes).- See Also:
-
USB_ENDPOINT_TYPE_ISOCHRONOUS
public static final int USB_ENDPOINT_TYPE_ISOCHRONOUSPossible endpoint types (in bmAttributes).- See Also:
-
USB_ENDPOINT_TYPE_BULK
public static final int USB_ENDPOINT_TYPE_BULKPossible endpoint types (in bmAttributes).- See Also:
-
USB_ENDPOINT_TYPE_INTERRUPT
public static final int USB_ENDPOINT_TYPE_INTERRUPTPossible endpoint types (in bmAttributes).- See Also:
-
-
Constructor Details
-
Usb_Endpoint_Descriptor
public Usb_Endpoint_Descriptor()
-
-
Method Details
-
getBEndpointAddress
public byte getBEndpointAddress()Returns the endpoint address.
Bits 3..0: Endpoint number
Bits 6..4: Reserved. Set to zero
Bit 7: Direction. 0 = Out, 1 = In (ignored for control endpoints)- Returns:
- the endpoint address
-
getBInterval
public byte getBInterval()Returns the intervall for polling endpoint data transfers.
Value in frame counts. Ignored for Bulk & Control eEndpoints. Isochronous endpoints must equal 1 and field may range from 1 to 255 for interrupt endpoints.- Returns:
- the intervall for polling endpoint data transfers
-
getBmAttributes
public byte getBmAttributes()Returns the attributes of this endpoint.
Bits 1..0: Transfer Type (see USB_ENDPOINT_TYPE_XXX).
Bits 7..2: Reserved.
If isochronous endpoint: Bits 3..2: Synchronisation type 00 = No synchronisation 01 = Asynchronous 10 = Adaptive 11 = Synchronous Bits 5..4: Usage Type 00 = Data endpoint 01 = Feedback endpoint 10 = Explicit feedback data endpoint 11 = Reserved
- Returns:
- the attributes of this endpoint
-
getBRefresh
public byte getBRefresh() -
getBSynchAddress
public byte getBSynchAddress() -
getExtra
public byte[] getExtra()Returns the data of extra descriptor(s) if available.- Returns:
- null or a byte array with the extra descriptor data
-
getExtralen
public int getExtralen()Returns the number of bytes of the extra descriptor.- Returns:
- the number of bytes of the extra descriptor
-
getWMaxPacketSize
public short getWMaxPacketSize()Returns the maximum packet size of this endpoint is capable of sending or receiving.- Returns:
- the maximum packet size
-
toString
-