embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

max_packet_size

Function max_packet_size 

Source
pub const fn max_packet_size(
    speed: UsbDeviceSpeed,
    max_rate_hz: u32,
    sample_width: SampleWidth,
    channels: usize,
) -> usize
Expand description

The isochronous packet size a direction needs: the audio frames of one packet at the highest rate, plus one for the rate to drift, times the frame size. Size the stream buffers with it.