pub struct InterfaceAltBuilder<'a, 'd, D: Driver<'d>> { /* private fields */ }
Expand description
Interface alternate setting builder.
Implementations§
Source§impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D>
impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D>
Sourcepub const fn interface_number(&self) -> InterfaceNumber
pub const fn interface_number(&self) -> InterfaceNumber
Get the interface number.
Sourcepub const fn alt_setting_number(&self) -> u8
pub const fn alt_setting_number(&self) -> u8
Get the alternate setting number.
Sourcepub fn descriptor(&mut self, descriptor_type: u8, descriptor: &[u8])
pub fn descriptor(&mut self, descriptor_type: u8, descriptor: &[u8])
Add a custom descriptor to this alternate setting.
Descriptors are written in the order builder functions are called. Note that some classes care about the order.
Sourcepub fn bos_capability(&mut self, capability_type: u8, capability: &[u8])
pub fn bos_capability(&mut self, capability_type: u8, capability: &[u8])
Add a custom Binary Object Store (BOS) descriptor to this alternate setting.
Sourcepub fn endpoint_descriptor(
&mut self,
endpoint: &EndpointInfo,
synchronization_type: SynchronizationType,
usage_type: UsageType,
extra_fields: &[u8],
)
pub fn endpoint_descriptor( &mut self, endpoint: &EndpointInfo, synchronization_type: SynchronizationType, usage_type: UsageType, extra_fields: &[u8], )
Write a custom endpoint descriptor for a certain endpoint.
This can be necessary, if the endpoint descriptors can only be written after the endpoint was created. As an example, an endpoint descriptor may contain the address of an endpoint that was allocated earlier.
Sourcepub fn alloc_endpoint_in(
&mut self,
ep_type: EndpointType,
max_packet_size: u16,
interval_ms: u8,
) -> D::EndpointIn
pub fn alloc_endpoint_in( &mut self, ep_type: EndpointType, max_packet_size: u16, interval_ms: u8, ) -> D::EndpointIn
Allocate an IN endpoint, without writing its descriptor.
Used for granular control over the order of endpoint and descriptor creation.
Sourcepub fn alloc_endpoint_out(
&mut self,
ep_type: EndpointType,
max_packet_size: u16,
interval_ms: u8,
) -> D::EndpointOut
pub fn alloc_endpoint_out( &mut self, ep_type: EndpointType, max_packet_size: u16, interval_ms: u8, ) -> D::EndpointOut
Allocate an OUT endpoint, without writing its descriptor.
Use for granular control over the order of endpoint and descriptor creation.
Sourcepub fn endpoint_bulk_in(&mut self, max_packet_size: u16) -> D::EndpointIn
pub fn endpoint_bulk_in(&mut self, max_packet_size: u16) -> D::EndpointIn
Allocate a BULK IN endpoint and write its descriptor.
Descriptors are written in the order builder functions are called. Note that some classes care about the order.
Sourcepub fn endpoint_bulk_out(&mut self, max_packet_size: u16) -> D::EndpointOut
pub fn endpoint_bulk_out(&mut self, max_packet_size: u16) -> D::EndpointOut
Allocate a BULK OUT endpoint and write its descriptor.
Descriptors are written in the order builder functions are called. Note that some classes care about the order.
Sourcepub fn endpoint_interrupt_in(
&mut self,
max_packet_size: u16,
interval_ms: u8,
) -> D::EndpointIn
pub fn endpoint_interrupt_in( &mut self, max_packet_size: u16, interval_ms: u8, ) -> D::EndpointIn
Allocate a INTERRUPT IN endpoint and write its descriptor.
Descriptors are written in the order builder functions are called. Note that some classes care about the order.
Sourcepub fn endpoint_interrupt_out(
&mut self,
max_packet_size: u16,
interval_ms: u8,
) -> D::EndpointOut
pub fn endpoint_interrupt_out( &mut self, max_packet_size: u16, interval_ms: u8, ) -> D::EndpointOut
Allocate a INTERRUPT OUT endpoint and write its descriptor.
Sourcepub fn endpoint_isochronous_in(
&mut self,
max_packet_size: u16,
interval_ms: u8,
synchronization_type: SynchronizationType,
usage_type: UsageType,
extra_fields: &[u8],
) -> D::EndpointIn
pub fn endpoint_isochronous_in( &mut self, max_packet_size: u16, interval_ms: u8, synchronization_type: SynchronizationType, usage_type: UsageType, extra_fields: &[u8], ) -> D::EndpointIn
Allocate a ISOCHRONOUS IN endpoint and write its descriptor.
Descriptors are written in the order builder functions are called. Note that some classes care about the order.
Sourcepub fn endpoint_isochronous_out(
&mut self,
max_packet_size: u16,
interval_ms: u8,
synchronization_type: SynchronizationType,
usage_type: UsageType,
extra_fields: &[u8],
) -> D::EndpointOut
pub fn endpoint_isochronous_out( &mut self, max_packet_size: u16, interval_ms: u8, synchronization_type: SynchronizationType, usage_type: UsageType, extra_fields: &[u8], ) -> D::EndpointOut
Allocate a ISOCHRONOUS OUT endpoint and write its descriptor.