Struct Channel

Source
#[non_exhaustive]
pub struct Channel<Dm, const CHANNEL: u8>
where Dm: DriverMode,
{ /* private fields */ }
Available on crate feature unstable only.
Expand description

RMT Channel

Trait Implementations§

Source§

impl<Dm, const CHANNEL: u8> Debug for Channel<Dm, CHANNEL>
where Dm: DriverMode + Debug,

Source§

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

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

impl RxChannel for Channel<Blocking, 2>

Source§

fn receive(self, data: &mut [u32]) -> Result<RxTransaction<'_, Self>, Error>
where Self: Sized,

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. The length of the received data cannot exceed the allocated RMT RAM.
Source§

impl RxChannel for Channel<Blocking, 3>

Source§

fn receive(self, data: &mut [u32]) -> Result<RxTransaction<'_, Self>, Error>
where Self: Sized,

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. The length of the received data cannot exceed the allocated RMT RAM.
Source§

impl RxChannelAsync for Channel<Async, 2>

Source§

async fn receive<T: From<u32> + Copy>( &mut self, data: &mut [T], ) -> Result<(), Error>
where Self: Sized,

Start receiving a pulse code sequence. The length of sequence cannot exceed the size of the allocated RMT RAM.
Source§

impl RxChannelAsync for Channel<Async, 3>

Source§

async fn receive<T: From<u32> + Copy>( &mut self, data: &mut [T], ) -> Result<(), Error>
where Self: Sized,

Start receiving a pulse code sequence. The length of sequence cannot exceed the size of the allocated RMT RAM.
Source§

impl<'d, P> RxChannelCreator<'d, Channel<Blocking, 2>, P> for ChannelCreator<Blocking, 2>
where P: PeripheralInput,

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: RxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the RX channel
Source§

impl<'d, P> RxChannelCreator<'d, Channel<Blocking, 3>, P> for ChannelCreator<Blocking, 3>
where P: PeripheralInput,

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: RxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the RX channel
Source§

impl<'d, P> RxChannelCreatorAsync<'d, Channel<Async, 2>, P> for ChannelCreator<Async, 2>
where P: PeripheralInput,

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: RxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the RX channel
Source§

impl<'d, P> RxChannelCreatorAsync<'d, Channel<Async, 3>, P> for ChannelCreator<Async, 3>
where P: PeripheralInput,

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: RxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the RX channel
Source§

impl TxChannel for Channel<Blocking, 0>

Source§

fn transmit( self, data: &[u32], ) -> Result<SingleShotTxTransaction<'_, Self>, Error>
where Self: Sized,

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§

fn transmit_continuously( self, data: &[u32], ) -> Result<ContinuousTxTransaction<Self>, Error>
where Self: Sized,

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 length of sequence cannot exceed the size of the allocated RMT RAM.
Source§

fn transmit_continuously_with_loopcount( self, loopcount: u16, data: &[u32], ) -> Result<ContinuousTxTransaction<Self>, Error>
where Self: Sized,

Like Self::transmit_continuously but also sets a loop count. ContinuousTxTransaction can be used to check if the loop count is reached.
Source§

impl TxChannel for Channel<Blocking, 1>

Source§

fn transmit( self, data: &[u32], ) -> Result<SingleShotTxTransaction<'_, Self>, Error>
where Self: Sized,

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§

fn transmit_continuously( self, data: &[u32], ) -> Result<ContinuousTxTransaction<Self>, Error>
where Self: Sized,

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 length of sequence cannot exceed the size of the allocated RMT RAM.
Source§

fn transmit_continuously_with_loopcount( self, loopcount: u16, data: &[u32], ) -> Result<ContinuousTxTransaction<Self>, Error>
where Self: Sized,

Like Self::transmit_continuously but also sets a loop count. ContinuousTxTransaction can be used to check if the loop count is reached.
Source§

impl TxChannelAsync for Channel<Async, 0>

Source§

async fn transmit(&mut self, data: &[u32]) -> Result<(), Error>
where Self: Sized,

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

impl TxChannelAsync for Channel<Async, 1>

Source§

async fn transmit(&mut self, data: &[u32]) -> Result<(), Error>
where Self: Sized,

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

impl<'d, P> TxChannelCreator<'d, Channel<Blocking, 0>, P> for ChannelCreator<Blocking, 0>

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: TxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the TX channel
Source§

impl<'d, P> TxChannelCreator<'d, Channel<Blocking, 1>, P> for ChannelCreator<Blocking, 1>

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: TxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the TX channel
Source§

impl<'d, P> TxChannelCreatorAsync<'d, Channel<Async, 0>, P> for ChannelCreator<Async, 0>

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: TxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the TX channel
Source§

impl<'d, P> TxChannelCreatorAsync<'d, Channel<Async, 1>, P> for ChannelCreator<Async, 1>

Source§

fn configure( self, pin: impl Peripheral<P = P> + 'd, config: TxChannelConfig, ) -> Result<T, Error>
where Self: Sized,

Configure the TX channel

Auto Trait Implementations§

§

impl<Dm, const CHANNEL: u8> Freeze for Channel<Dm, CHANNEL>

§

impl<Dm, const CHANNEL: u8> RefUnwindSafe for Channel<Dm, CHANNEL>
where Dm: RefUnwindSafe,

§

impl<Dm, const CHANNEL: u8> Send for Channel<Dm, CHANNEL>
where Dm: Send,

§

impl<Dm, const CHANNEL: u8> Sync for Channel<Dm, CHANNEL>
where Dm: Sync,

§

impl<Dm, const CHANNEL: u8> Unpin for Channel<Dm, CHANNEL>
where Dm: Unpin,

§

impl<Dm, const CHANNEL: u8> UnwindSafe for Channel<Dm, CHANNEL>
where Dm: UnwindSafe,

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.

§

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.