pub struct Status<MS, DIR, STD> { /* private fields */ }
Expand description

Content of the status register.

  • MS: Master or Slave
  • DIR: communication direction, Transmit or Receive
  • STD: I2S standard, eg Philips

Implementations§

source§

impl<MS, DIR, STD> Status<MS, DIR, STD>

source

pub fn bsy(&self) -> bool

Get the BSY flag. If true the I2s device is busy communicating.

source§

impl<MS, DIR, STD> Status<MS, DIR, STD>
where STD: ChannelFlag,

source

pub fn chside(&self) -> Channel

Get the CHSIDE flag. It indicate the channel that has been received or will be transmitted.

This flag is updated when TXE or RXNE flags are set. This flag is meaningless and therefore not reliable in case of an error. This flag is not meaningful when using the PCM standard.

source§

impl<DIR, STD> Status<Slave, DIR, STD>

source

pub fn fre(&self) -> bool

Get the FRE flag. If true, a frame error occurred.

This flag is set by hardware when the WS line changes at an unexpected moment. Usually, this indicates a synchronisation issue. This flag can only be set in Slave mode and therefore can only be read in this mode.

This flag is cleared when reading the status register.

source§

impl<MS, STD> Status<MS, Receive, STD>

source

pub fn ovr(&self) -> bool

Get the OVR flag. If true an overrun error occurred.

This flag is set when data are received and the previous data have not yet been read. As a result, the incoming data are lost. Since this flag can happen only in Receive mode, it can only be read in this mode.

This flag is cleared by a read operation on the data register followed by a read to the status register.

source

pub fn rxne(&self) -> bool

Get the RXNE flag. If true a valid received data is present in the Rx buffer.

This flag can only happen in reception mode and therefore can only be read in this mode.

This flag is cleared when the data register is read.

source§

impl<MS, STD> Status<MS, Transmit, STD>

source

pub fn txe(&self) -> bool

Get the TXE flag. If true the Tx buffer is empty and the next sample can be loaded into it.

This flag can only happen in transmission mode and therefore can only be read in this mode.

This flag is cleared by writing into the data register or by disabling the I2s peripheral.

source§

impl<STD> Status<Slave, Transmit, STD>

source

pub fn udr(&self) -> bool

Get the UDR flag. If true an underrun error occurred.

This flag is set when the first clock for data transmission appears while the software has not yet loaded any value into the data register. This flag can only be set in Slave Transmit mode and therefore can only be read in this mode.

This flag is cleared by reading the status register.

Auto Trait Implementations§

§

impl<MS, DIR, STD> Freeze for Status<MS, DIR, STD>

§

impl<MS, DIR, STD> !RefUnwindSafe for Status<MS, DIR, STD>

§

impl<MS, DIR, STD> Send for Status<MS, DIR, STD>
where DIR: Send, MS: Send, STD: Send,

§

impl<MS, DIR, STD> !Sync for Status<MS, DIR, STD>

§

impl<MS, DIR, STD> Unpin for Status<MS, DIR, STD>
where DIR: Unpin, MS: Unpin, STD: Unpin,

§

impl<MS, DIR, STD> UnwindSafe for Status<MS, DIR, STD>
where DIR: UnwindSafe, MS: UnwindSafe, STD: UnwindSafe,

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> 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>,

§

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>,

§

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.