Struct Protocol

Source
pub struct Protocol {
    pub sync: Synchronization,
    pub word_size: WordSize,
    pub slot_size: SlotSize,
    pub num_slots: u8,
}
Expand description

Serial audio protocol.

Fields§

§sync: Synchronization

Synchronization scheme.

§word_size: WordSize

Number of bits filled with audio data.

The only values allowed are 8, 10, 16, 20, 24, and 32.

§slot_size: SlotSize

Number of bits transmitted per word.

If a master clock is generated, the slot size should be a power of two if an integer ratio between the master clock and the bit clock is required.

If the value does not equal the word size, the only other values allowed are 16 and 32. In any case, the value has to be equal or larger than the word size. If the slot size does not match the word size, the data is padded according to the synchronization scheme.

§num_slots: u8

Number of slots (i.e., audio channels) per frame.

For everything but PCM audio, the value needs to be 2 (stereo).

Trait Implementations§

Source§

impl Clone for Protocol

Source§

fn clone(&self) -> Protocol

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Protocol

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.