Struct nrf9160_hal::pwm::PwmChannel
source · pub struct PwmChannel<'a, T>where
T: Instance,{ /* private fields */ }
Expand description
PWM channel
Implementations§
source§impl<'a, T> PwmChannel<'a, T>where
T: Instance,
impl<'a, T> PwmChannel<'a, T>where
T: Instance,
pub fn new(pwm: &'a Pwm<T>, channel: Channel) -> PwmChannel<'a, T>
pub fn enable(&self)
pub fn disable(&self)
pub fn max_duty(&self) -> u16
pub fn set_duty(&self, duty: u16)
pub fn set_duty_on(&self, duty: u16)
pub fn set_duty_off(&self, duty: u16)
pub fn duty_on(&self) -> u16
pub fn duty_off(&self) -> u16
Trait Implementations§
source§impl<'a, T> Debug for PwmChannel<'a, T>
impl<'a, T> Debug for PwmChannel<'a, T>
source§impl<'a, T> ErrorType for PwmChannel<'a, T>where
T: Instance,
impl<'a, T> ErrorType for PwmChannel<'a, T>where
T: Instance,
§type Error = Infallible
type Error = Infallible
Error type
source§impl<'a, T> PwmPin for PwmChannel<'a, T>where
T: Instance,
impl<'a, T> PwmPin for PwmChannel<'a, T>where
T: Instance,
source§fn get_max_duty(&self) -> <PwmChannel<'a, T> as PwmPin>::Duty
fn get_max_duty(&self) -> <PwmChannel<'a, T> as PwmPin>::Duty
Returns the maximum duty cycle value
source§impl<'a, T> SetDutyCycle for PwmChannel<'a, T>where
T: Instance,
impl<'a, T> SetDutyCycle for PwmChannel<'a, T>where
T: Instance,
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<(), <PwmChannel<'a, T> as ErrorType>::Error>
fn set_duty_cycle( &mut self, duty: u16 ) -> Result<(), <PwmChannel<'a, T> 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<'a, T> Freeze for PwmChannel<'a, T>
impl<'a, T> RefUnwindSafe for PwmChannel<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for PwmChannel<'a, T>where
T: Sync,
impl<'a, T> Sync for PwmChannel<'a, T>where
T: Sync,
impl<'a, T> Unpin for PwmChannel<'a, T>
impl<'a, T> UnwindSafe for PwmChannel<'a, T>where
T: RefUnwindSafe,
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