atsamd_hal::pwm

Struct Pwm0

Source
pub struct Pwm0 { /* private fields */ }

Implementations§

Source§

impl Pwm0

Source

pub fn new<F: Into<Hertz>>( clock: &Tcc0Tcc1Clock, freq: F, tcc: Tcc0, pm: &mut Pm, ) -> Self

Trait Implementations§

Source§

impl Pwm for Pwm0

Source§

type Channel = Channel

Enumeration of channels that can be used with this Pwm interface Read more
Source§

type Time = Rate<u32, 1, 1>

A time unit that can be converted into a human time unit (e.g. seconds)
Source§

type Duty = u32

Type for the duty methods Read more
Source§

fn disable(&mut self, _channel: Self::Channel)

Disables a PWM channel
Source§

fn enable(&mut self, _channel: Self::Channel)

Enables a PWM channel
Source§

fn get_period(&self) -> Self::Time

Returns the current PWM period
Source§

fn get_duty(&self, channel: Self::Channel) -> Self::Duty

Returns the current duty cycle
Source§

fn get_max_duty(&self) -> Self::Duty

Returns the maximum duty cycle value
Source§

fn set_duty(&mut self, channel: Self::Channel, duty: Self::Duty)

Sets a new duty cycle
Source§

fn set_period<P>(&mut self, period: P)
where P: Into<Self::Time>,

Sets a new PWM period

Auto Trait Implementations§

§

impl Freeze for Pwm0

§

impl RefUnwindSafe for Pwm0

§

impl Send for Pwm0

§

impl !Sync for Pwm0

§

impl Unpin for Pwm0

§

impl UnwindSafe for Pwm0

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 = 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>,

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.