Channel

Struct Channel 

Source
#[non_exhaustive]
pub struct Channel<'ch, Dm, Dir>
where Dm: DriverMode, Dir: Direction,
{ /* private fields */ }
Expand description

RMT Channel

Implementations§

Source§

impl<Dm, Dir> Channel<'_, Dm, Dir>
where Dm: DriverMode, Dir: Direction,

Source

pub fn reborrow<'a>(&'a mut self) -> Channel<'a, Dm, Dir>

Reborrow this channel for a shorter lifetime 'a.

Source§

impl<'ch> Channel<'ch, Blocking, Tx>

Channel in TX mode

Source

pub fn transmit<'data, T>( self, data: &'data [T], ) -> Result<SingleShotTxTransaction<'ch, 'data, T>, Error>
where T: Into<PulseCode> + Copy,

Start transmitting the given pulse code sequence. This returns a SingleShotTxTransaction which can be used to wait for the transaction to complete and get back the channel for further use.

Source

pub fn transmit_continuously<T>( self, data: &[T], mode: LoopMode, ) -> Result<ContinuousTxTransaction<'ch>, Error>
where T: Into<PulseCode> + Copy,

Start transmitting the given pulse code continuously.

This returns a ContinuousTxTransaction which can be used to stop the ongoing transmission and get back the channel for further use.

The mode argument determines whether transmission will continue until explicitly stopped or for a fixed number of iterations; see LoopMode for more details. When using a loop mode other than LoopMode::Infinite, ContinuousTxTransaction::is_loopcount_interrupt_set can be used to check if the loop count is reached. The length of data cannot exceed the size of the allocated RMT RAM.

Source§

impl<'ch> Channel<'ch, Blocking, Rx>

Channel is RX mode

Source

pub fn receive<'data, T>( self, data: &'data mut [T], ) -> Result<RxTransaction<'ch, 'data, T>, Error>
where Self: Sized, T: From<PulseCode>,

Start receiving pulse codes into the given buffer. This returns a RxTransaction which can be used to wait for receive to complete and get back the channel for further use.

§{rx_size_limit}
Source§

impl Channel<'_, Async, Tx>

TX channel in async mode

Source

pub fn transmit<T>( &mut self, data: &[T], ) -> impl Future<Output = Result<(), Error>>
where Self: Sized, T: Into<PulseCode> + Copy,

Start transmitting the given pulse code sequence. The length of sequence cannot exceed the size of the allocated RMT RAM.

Source§

impl Channel<'_, Async, Rx>

RX channel in async mode

Source

pub fn receive<T>( &mut self, data: &mut [T], ) -> impl Future<Output = Result<usize, Error>>
where Self: Sized, T: From<PulseCode> + Unpin,

Start receiving a pulse code sequence.

§{rx_size_limit}

Trait Implementations§

Source§

impl<'ch, Dm, Dir> Debug for Channel<'ch, Dm, Dir>
where Dm: DriverMode + Debug, Dir: Direction + Debug,

Available on crate feature unstable only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Dm, Dir> Drop for Channel<'_, Dm, Dir>
where Dm: DriverMode, Dir: Direction,

Available on crate feature unstable only.
Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'ch, Dm, Dir> Freeze for Channel<'ch, Dm, Dir>

§

impl<'ch, Dm, Dir> RefUnwindSafe for Channel<'ch, Dm, Dir>
where Dir: RefUnwindSafe, Dm: RefUnwindSafe,

§

impl<'ch, Dm, Dir> Send for Channel<'ch, Dm, Dir>
where Dir: Send, Dm: Send,

§

impl<'ch, Dm, Dir> Sync for Channel<'ch, Dm, Dir>
where Dir: Sync, Dm: Sync,

§

impl<'ch, Dm, Dir> Unpin for Channel<'ch, Dm, Dir>
where Dm: Unpin,

§

impl<'ch, Dm, Dir> !UnwindSafe for Channel<'ch, Dm, Dir>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.