pub struct EndpointDescriptor {
pub endpoint_address: u8,
pub attributes: u8,
pub max_packet_size: u16,
pub interval: u8,
}Expand description
Standard USB Endpoint Descriptor.
Contains information to determine the bandwidth requirements. (USB 2.0 §9.6.6)
Fields§
§endpoint_address: u8Endpoint address.
Contains the endpoint number and direction.
attributes: u8Endpoint attribute bitmap.
max_packet_size: u16Maximum packet size (11 bits).
For high-speed isochronous and interrupt endpoints it also specifies additional transaction opportunities.
interval: u8Polling interval.
The meaning of this value depends on the transfer type and speed.
Implementations§
Source§impl EndpointDescriptor
impl EndpointDescriptor
Sourcepub fn endpoint_info(&self, speed: Speed) -> EndpointInfo
pub fn endpoint_info(&self, speed: Speed) -> EndpointInfo
The EndpointInfo of this endpoint on a device that enumerated at speed.
The descriptor’s bInterval is only meaningful together with the speed and transfer type,
so this is where it is decoded into an EndpointInterval.
Sourcepub fn ep_type(&self) -> EndpointType
pub fn ep_type(&self) -> EndpointType
Returns the endpoint transfer type.
Sourcepub fn transfer_type(&self) -> u8
pub fn transfer_type(&self) -> u8
Transfer type (0=Control, 1=Isochronous, 2=Bulk, 3=Interrupt).
Sourcepub const fn packet_size(&self) -> u16
pub const fn packet_size(&self) -> u16
Maximum packet size per transaction in bytes (bits 10..0 of wMaxPacketSize).
Sourcepub const fn additional_transactions(&self) -> u8
pub const fn additional_transactions(&self) -> u8
Additional transaction opportunities per microframe (bits 12..11 of wMaxPacketSize).
Only meaningful for high-speed isochronous and interrupt endpoints (0..=2); 0 otherwise.
Trait Implementations§
Source§impl Clone for EndpointDescriptor
impl Clone for EndpointDescriptor
impl Copy for EndpointDescriptor
Source§impl Debug for EndpointDescriptor
impl Debug for EndpointDescriptor
impl Eq for EndpointDescriptor
Source§impl ExtendableDescriptor for EndpointDescriptor
impl ExtendableDescriptor for EndpointDescriptor
Source§fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
bytes with this descriptor. Read moreSource§fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
bytes to receive descriptor data. Read more