Skip to main content

Rmt

Struct Rmt 

Source
pub struct Rmt<'rmt, Dm>
where Dm: DriverMode,
{ pub channel0: ChannelCreator<'rmt, Dm, 0>, pub channel1: ChannelCreator<'rmt, Dm, 1>, pub channel2: ChannelCreator<'rmt, Dm, 2>, pub channel3: ChannelCreator<'rmt, Dm, 3>, /* private fields */ }
Expand description

RMT Instance

Fields§

§channel0: ChannelCreator<'rmt, Dm, 0>

RMT Channel 0

§channel1: ChannelCreator<'rmt, Dm, 1>

RMT Channel 1

§channel2: ChannelCreator<'rmt, Dm, 2>

RMT Channel 2

§channel3: ChannelCreator<'rmt, Dm, 3>

RMT Channel 3

Implementations§

Source§

impl<'rmt, Dm> Rmt<'rmt, Dm>
where Dm: DriverMode,

Source

pub fn frequency(&self) -> Rate

Returns the configured RMT counter clock frequency.

This is the actual frequency after the global RMT clock divider has been configured. Pulse code lengths are expressed in cycles of this clock divided by the channel divider configured with TxChannelConfig::with_clk_divider or RxChannelConfig::with_clk_divider.

Source§

impl<'rmt> Rmt<'rmt, Blocking>

Source

pub fn into_async(self) -> Rmt<'rmt, Async>

Reconfigures the driver for asynchronous operation.

Source§

impl<'rmt> Rmt<'rmt, Blocking>

Source

pub fn new(peripheral: RMT<'rmt>, frequency: Rate) -> Result<Self, ConfigError>

Creates a new RMT instance.

The frequency parameter configures the global RMT counter clock. Use Rmt::frequency to retrieve the actual configured frequency when converting real-time pulse durations to PulseCode lengths; this is not necessarily the APB clock frequency.

§Errors

ConfigError::UnreachableTargetFrequency when the target frequency cannot be reached.

Source

pub fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Available on crate feature unstable only.

Registers an interrupt handler for the RMT peripheral.

Replaces any previously registered interrupt handlers.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Trait Implementations§

Source§

impl InterruptConfigurable for Rmt<'_, Blocking>

Available on crate feature unstable only.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

fn set_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the peripheral. Read more

Auto Trait Implementations§

§

impl<'rmt, Dm> !UnwindSafe for Rmt<'rmt, Dm>

§

impl<'rmt, Dm> Freeze for Rmt<'rmt, Dm>
where ChannelCreator<'rmt, Dm, 0>: Freeze, ChannelCreator<'rmt, Dm, 1>: Freeze, ChannelCreator<'rmt, Dm, 2>: Freeze, ChannelCreator<'rmt, Dm, 3>: Freeze, PhantomData<Dm>: Freeze,

§

impl<'rmt, Dm> RefUnwindSafe for Rmt<'rmt, Dm>

§

impl<'rmt, Dm> Send for Rmt<'rmt, Dm>
where ChannelCreator<'rmt, Dm, 0>: Send, ChannelCreator<'rmt, Dm, 1>: Send, ChannelCreator<'rmt, Dm, 2>: Send, ChannelCreator<'rmt, Dm, 3>: Send, PhantomData<Dm>: Send,

§

impl<'rmt, Dm> Sync for Rmt<'rmt, Dm>
where ChannelCreator<'rmt, Dm, 0>: Sync, ChannelCreator<'rmt, Dm, 1>: Sync, ChannelCreator<'rmt, Dm, 2>: Sync, ChannelCreator<'rmt, Dm, 3>: Sync, PhantomData<Dm>: Sync,

§

impl<'rmt, Dm> Unpin for Rmt<'rmt, Dm>
where ChannelCreator<'rmt, Dm, 0>: Unpin, ChannelCreator<'rmt, Dm, 1>: Unpin, ChannelCreator<'rmt, Dm, 2>: Unpin, ChannelCreator<'rmt, Dm, 3>: Unpin, PhantomData<Dm>: Unpin,

§

impl<'rmt, Dm> UnsafeUnpin for Rmt<'rmt, Dm>

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

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.