Trait Listen

Source
pub trait Listen {
    type Event: BitFlag;

    // Required methods
    fn listen(&mut self, event: impl Into<BitFlags<Self::Event>>);
    fn listen_only(&mut self, event: impl Into<BitFlags<Self::Event>>);
    fn unlisten(&mut self, event: impl Into<BitFlags<Self::Event>>);

    // Provided methods
    fn listen_all(&mut self) { ... }
    fn unlisten_all(&mut self) { ... }
}

Required Associated Types§

Source

type Event: BitFlag

Enum of bit flags associated with events

Required Methods§

Source

fn listen(&mut self, event: impl Into<BitFlags<Self::Event>>)

Start listening for Events

Note, you will also have to enable the appropriate interrupt in the NVIC to start receiving events.

Source

fn listen_only(&mut self, event: impl Into<BitFlags<Self::Event>>)

Start listening for Events, stop all other

Note, you will also have to enable the appropriate interrupt in the NVIC to start receiving events.

Source

fn unlisten(&mut self, event: impl Into<BitFlags<Self::Event>>)

Stop listening for Events

Provided Methods§

Source

fn listen_all(&mut self)

Start listening all Events

Source

fn unlisten_all(&mut self)

Stop listening all Events

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I: Instance, const S: u8> Listen for StreamX<I, S>
where Self: Sealed + StreamISR,

Source§

impl<SPI: Instance> Listen for Inner<SPI>

Source§

impl<TIM: Instance> Listen for Timer<TIM>

Source§

impl<TIM: Instance, const FREQ: u32> Listen for FTimer<TIM, FREQ>

Source§

impl<UART: Instance, WORD> Listen for Serial<UART, WORD>