Struct Channel

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

RMT Channel

Implementations§

Source§

impl<Dm, Dir, Raw> Channel<Dm, Raw>
where Dm: DriverMode, Dir: Direction, Raw: RawChannelAccess<Dir = Dir>,

Source

pub fn degrade(self) -> Channel<Dm, DynChannelAccess<Dir>>

Consume the channel and return a type-erased version

Trait Implementations§

Source§

impl<Dm, Raw> Debug for Channel<Dm, Raw>
where Dm: DriverMode + Debug, Raw: ChannelInternal + Debug,

Source§

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

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

impl<Dm, Raw> Drop for Channel<Dm, Raw>
where Dm: DriverMode, Raw: ChannelInternal,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<Raw> RxChannel for Channel<Blocking, Raw>
where Raw: RxChannelInternal,

Source§

type Raw = Raw

Channel identifier of the implementing channel.
Source§

fn receive( self, data: &mut [u32], ) -> Result<RxTransaction<'_, Self::Raw>, 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<Raw> RxChannelAsync for Channel<Async, Raw>
where Raw: RxChannelInternal,

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<Raw> TxChannel for Channel<Blocking, Raw>
where Raw: TxChannelInternal,

Source§

type Raw = Raw

Channel identifier of the implementing channel.
Source§

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

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

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

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

impl<Raw> TxChannelAsync for Channel<Async, Raw>
where Raw: TxChannelInternal,

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.

Auto Trait Implementations§

§

impl<Dm, Raw> Freeze for Channel<Dm, Raw>
where Raw: Freeze,

§

impl<Dm, Raw> RefUnwindSafe for Channel<Dm, Raw>
where Raw: RefUnwindSafe, Dm: RefUnwindSafe,

§

impl<Dm, Raw> Send for Channel<Dm, Raw>
where Raw: Send, Dm: Send,

§

impl<Dm, Raw> Sync for Channel<Dm, Raw>
where Raw: Sync, Dm: Sync,

§

impl<Dm, Raw> Unpin for Channel<Dm, Raw>
where Raw: Unpin, Dm: Unpin,

§

impl<Dm, Raw> UnwindSafe for Channel<Dm, Raw>
where Raw: UnwindSafe, 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.

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.