pub struct EndpointInterval { /* private fields */ }Expand description
Polling interval of an endpoint.
This is the period the endpoint is serviced with, independent of the bus speed, so it means
the same thing wherever it is stored: in an EndpointConfig, an
EndpointInfo, or a host-side pipe. It is kept as a whole number of
microframes (125 µs, the high-speed bus interval), and one frame (1 ms) is 8 microframes, so
equal periods are always equal values: from_ms(1) == from_microframes(8).
The bInterval byte of an endpoint descriptor is a speed- and transfer-type-specific encoding
of this period, which b_interval and
from_b_interval convert to and from.
Bulk and control endpoints have no polling period, they use EndpointInterval::NONE.
Implementations§
Source§impl EndpointInterval
impl EndpointInterval
Sourcepub const NONE: Self
pub const NONE: Self
No polling period, for bulk and control endpoints.
For a periodic (interrupt or isochronous) endpoint this is the shortest period, every frame or microframe.
Sourcepub const fn from_microframes(microframes: u32) -> Self
pub const fn from_microframes(microframes: u32) -> Self
A period of microframes microframes (125 µs units).
Sourcepub const fn microframes(self) -> u32
pub const fn microframes(self) -> u32
The period in microframes (125 µs units).
Sourcepub const fn full_speed_b_interval(self, ep_type: EndpointType) -> u8
pub const fn full_speed_b_interval(self, ep_type: EndpointType) -> u8
The bInterval of a full-speed (or low-speed) endpoint descriptor for this period.
Interrupt endpoints use a linear period of 1..=255 frames, isochronous endpoints
the exponential period 2^(bInterval-1) frames, rounded up to a power of two. Bulk and control
endpoints use 0.
Sourcepub const fn high_speed_b_interval(self, ep_type: EndpointType) -> u8
pub const fn high_speed_b_interval(self, ep_type: EndpointType) -> u8
The bInterval of a high-speed (or SuperSpeed) endpoint descriptor for this period.
Interrupt and isochronous endpoints use the exponential period 2^(bInterval-1)
microframes, rounded up to a power of two. Bulk and control endpoints use 0.
Sourcepub const fn b_interval(self, speed: Speed, ep_type: EndpointType) -> u8
pub const fn b_interval(self, speed: Speed, ep_type: EndpointType) -> u8
The bInterval of an endpoint descriptor at speed for this period.
Sourcepub const fn from_b_interval(
speed: Speed,
ep_type: EndpointType,
b_interval: u8,
) -> Self
pub const fn from_b_interval( speed: Speed, ep_type: EndpointType, b_interval: u8, ) -> Self
The period of an endpoint with the descriptor bInterval at speed.
The inverse of b_interval for the values it produces.
Bulk and control endpoints have no period, which gives EndpointInterval::NONE.