pub struct Channel<S, C>{ /* private fields */ }Expand description
A Channel from the Pwm subsystem.
Its attached to one of the eight slices and can be an A or B side channel
Implementations§
Source§impl<S> Channel<S, A>where
S: AnySlice,
impl<S> Channel<S, A>where
S: AnySlice,
Sourcepub fn set_enabled(&mut self, enable: bool)
pub fn set_enabled(&mut self, enable: bool)
Enable or disable the PWM channel
Sourcepub fn output_to<P>(
&mut self,
pin: P,
) -> Pin<<P as AnyPin>::Id, FunctionPwm, <P as AnyPin>::Pull>
pub fn output_to<P>( &mut self, pin: P, ) -> Pin<<P as AnyPin>::Id, FunctionPwm, <P as AnyPin>::Pull>
Capture a gpio pin and use it as pwm output for channel A
Sourcepub fn set_inverted(&mut self)
pub fn set_inverted(&mut self)
Invert channel output
Sourcepub fn clr_inverted(&mut self)
pub fn clr_inverted(&mut self)
Stop inverting channel output
Source§impl<S> Channel<S, B>where
S: AnySlice,
impl<S> Channel<S, B>where
S: AnySlice,
Sourcepub fn set_enabled(&mut self, enable: bool)
pub fn set_enabled(&mut self, enable: bool)
Enable or disable the PWM channel
Sourcepub fn output_to<P>(
&mut self,
pin: P,
) -> Pin<<P as AnyPin>::Id, FunctionPwm, <P as AnyPin>::Pull>
pub fn output_to<P>( &mut self, pin: P, ) -> Pin<<P as AnyPin>::Id, FunctionPwm, <P as AnyPin>::Pull>
Capture a gpio pin and use it as pwm output for channel B
Sourcepub fn set_inverted(&mut self)
pub fn set_inverted(&mut self)
Invert channel output
Sourcepub fn clr_inverted(&mut self)
pub fn clr_inverted(&mut self)
Stop inverting channel output
Trait Implementations§
Source§impl<S> ErrorType for Channel<S, A>where
S: AnySlice,
impl<S> ErrorType for Channel<S, A>where
S: AnySlice,
Source§type Error = Infallible
type Error = Infallible
Error type
Source§impl<S> ErrorType for Channel<S, B>where
S: AnySlice,
impl<S> ErrorType for Channel<S, B>where
S: AnySlice,
Source§type Error = Infallible
type Error = Infallible
Error type
Source§impl<S> PwmPin for Channel<S, A>where
S: AnySlice,
impl<S> PwmPin for Channel<S, A>where
S: AnySlice,
Source§impl<S> PwmPin for Channel<S, B>where
S: AnySlice,
impl<S> PwmPin for Channel<S, B>where
S: AnySlice,
Source§impl<S> SetDutyCycle for Channel<S, A>where
S: AnySlice,
impl<S> SetDutyCycle for Channel<S, A>where
S: AnySlice,
Source§fn max_duty_cycle(&self) -> u16
fn max_duty_cycle(&self) -> u16
Get the maximum duty cycle value. Read more
Source§fn set_duty_cycle(
&mut self,
duty: u16,
) -> Result<(), <Channel<S, A> as ErrorType>::Error>
fn set_duty_cycle( &mut self, duty: u16, ) -> Result<(), <Channel<S, A> as ErrorType>::Error>
Set the duty cycle to
duty / max_duty. Read moreSource§fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 0%, or always inactive.
Source§fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 100%, or always active.
Source§impl<S> SetDutyCycle for Channel<S, B>where
S: AnySlice,
impl<S> SetDutyCycle for Channel<S, B>where
S: AnySlice,
Source§fn max_duty_cycle(&self) -> u16
fn max_duty_cycle(&self) -> u16
Get the maximum duty cycle value. Read more
Source§fn set_duty_cycle(
&mut self,
duty: u16,
) -> Result<(), <Channel<S, B> as ErrorType>::Error>
fn set_duty_cycle( &mut self, duty: u16, ) -> Result<(), <Channel<S, B> as ErrorType>::Error>
Set the duty cycle to
duty / max_duty. Read moreSource§fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_off(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 0%, or always inactive.
Source§fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
fn set_duty_cycle_fully_on(&mut self) -> Result<(), Self::Error>
Set the duty cycle to 100%, or always active.
Auto Trait Implementations§
impl<S, C> Freeze for Channel<S, C>
impl<S, C> RefUnwindSafe for Channel<S, C>
impl<S, C> Send for Channel<S, C>
impl<S, C> Sync for Channel<S, C>
impl<S, C> Unpin for Channel<S, C>
impl<S, C> UnwindSafe for Channel<S, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more