Struct imxrt_hal::flexpwm::Pwm

source ·
pub struct Pwm<const N: u8> { /* private fields */ }
Expand description

A PWM peripheral.

The PWM peripheral provides access to peripheral-wide registers, or registers that cannot be owned by any one Submodule. Use a Pwm to synchronously control submodules and pin outputs.

For a simpler interface, prefer Submodule and / or Output.

Implementations§

source§

impl<const N: u8> Pwm<N>

source

pub const N: u8 = N

The peripheral instance.

source

pub fn load_ok(&self) -> Mask

Read the LDOK bits.

Note that the hardware will deassert LDOK after the values are loaded.

source

pub fn set_load_ok(&mut self, mask: Mask)

Set LDOK for zero or more submodules.

A high bit indicates which LDOK bit(s) will be set.

source

pub fn clear_load_ok(&mut self, mask: Mask)

Clear LDOK for zero or more submodules.

A high bit indicates which LDOK bit(s) will be cleared.

source

pub fn run(&self) -> Mask

Read the RUN bit(s).

source

pub fn set_run(&mut self, mask: Mask)

Set or clear the RUN bit(s) for one or more submodules.

This bitmask is written directly to the hardware. To perform a read-modify-write operation on these bits, make sure to read the initial values with Pwm::run.

source

pub fn output_enable(&self, channel: Channel) -> Mask

Read a PWM channel’s output enable bits.

source

pub fn set_output_enable(&mut self, channel: Channel, mask: Mask)

Set a PWM channel’s output enable.

A high bit indicates the channel is enabled. A low bit disables the channel.

Auto Trait Implementations§

§

impl<const N: u8> !RefUnwindSafe for Pwm<N>

§

impl<const N: u8> Send for Pwm<N>

§

impl<const N: u8> !Sync for Pwm<N>

§

impl<const N: u8> Unpin for Pwm<N>

§

impl<const N: u8> !UnwindSafe for Pwm<N>

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

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

Performs the conversion.