pub struct Config<'d> {
pub sample_rates_hz: &'d [u32],
pub sample_width: SampleWidth,
pub channels: &'d [Channel],
pub feature_unit: Vec<FeatureUnitControls, MAX_AUDIO_CHANNEL_COUNT, u8>,
pub max_packet_size: u16,
pub feedback_refresh_period: FeedbackRefresh,
}Expand description
Speaker stream settings and optional host controls.
Fields§
§sample_rates_hz: &'d [u32]Supported sample rates in Hz: one to ten discrete values. The first is reported before the host selects a rate.
sample_width: SampleWidthThe audio sample resolution.
channels: &'d [Channel]Audio channels in stream order (one to twelve). Entries must be unique
and follow wChannelConfig bit order, as listed in Channel.
feature_unit: Vec<FeatureUnitControls, MAX_AUDIO_CHANNEL_COUNT, u8>Controls the USB host can change on each channel.
Use heapless::Vec::new() to omit the Feature Unit. Otherwise, provide
channels.len() + 1 entries: the master first, then each audio channel in
Self::channels order. Use FeatureUnitControls::empty for no controls
on a channel.
max_packet_size: u16Maximum bytes per USB packet. Allow room for sample rate variation, for example twice the bytes played per (micro)frame.
feedback_refresh_period: FeedbackRefreshHow often the device sends sample rate feedback to the host.
Implementations§
Source§impl<'d> Config<'d>
impl<'d> Config<'d>
Sourcepub const fn new(
sample_rates_hz: &'d [u32],
sample_width: SampleWidth,
channels: &'d [Channel],
max_packet_size: u16,
feedback_refresh_period: FeedbackRefresh,
) -> Self
pub const fn new( sample_rates_hz: &'d [u32], sample_width: SampleWidth, channels: &'d [Channel], max_packet_size: u16, feedback_refresh_period: FeedbackRefresh, ) -> Self
Creates a speaker configuration without a Feature Unit.