pub struct DutyCycle { /* private fields */ }Expand description
Duty value and polarity for a single channel.
If the channel has inverted polarity, the output is set high as long as the counter is below the duty value.
Implementations§
Source§impl DutyCycle
impl DutyCycle
Sourcepub const fn normal(value: u16) -> Self
pub const fn normal(value: u16) -> Self
Make a new duty value with normal polarity.
The value is truncated to 15 bits.
The output is set high if the counter is at or above the duty value.
Sourcepub const fn inverted(value: u16) -> Self
pub const fn inverted(value: u16) -> Self
Make a new duty cycle with inverted polarity.
The value is truncated to 15 bits.
The output is set high if the counter is below the duty value.
Sourcepub const fn with_inverted(self, inverted_polarity: bool) -> Self
pub const fn with_inverted(self, inverted_polarity: bool) -> Self
Adjust the polarity of the duty cycle (returns a new object).
Sourcepub const fn is_inverted(&self) -> bool
pub const fn is_inverted(&self) -> bool
Checks if the duty period has inverted polarity.
If the channel has inverted polarity, the output is set high as long as the counter is below the duty value.
Trait Implementations§
impl Copy for DutyCycle
impl Eq for DutyCycle
impl StructuralPartialEq for DutyCycle
Auto Trait Implementations§
impl Freeze for DutyCycle
impl RefUnwindSafe for DutyCycle
impl Send for DutyCycle
impl Sync for DutyCycle
impl Unpin for DutyCycle
impl UnsafeUnpin for DutyCycle
impl UnwindSafe for DutyCycle
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