Enum atmega_hal::simple_pwm::Prescaler
source · [−]pub enum Prescaler {
Direct,
Prescale8,
Prescale64,
Prescale256,
Prescale1024,
}
Expand description
Clock prescaler for PWM
The prescaler dictates the PWM frequency, together with the IO clock. The formula is as follows:
F_pwm = CLK_io / (Prescaler * 256);
Prescaler | 16 MHz Clock | 8 MHz Clock |
---|---|---|
Direct | 62.5 kHz | 31.3 kHz |
Prescale8 | 7.81 kHz | 3.91 kHz |
Prescale64 | 977 Hz | 488 Hz |
Prescale256 | 244 Hz | 122 Hz |
Prescale1024 | 61.0 Hz | 30.5 Hz |
Variants
Direct
No prescaling, the IO clock drives the timer directly.
Prescale8
Divide the IO clock by 8.
Prescale64
Divide the IO clock by 64.
Prescale256
Divide the IO clock by 256.
Prescale1024
Divide the IO clock by 1024.
Trait Implementations
sourceimpl Ord for Prescaler
impl Ord for Prescaler
sourceimpl PartialOrd<Prescaler> for Prescaler
impl PartialOrd<Prescaler> for Prescaler
sourcefn partial_cmp(&self, other: &Prescaler) -> Option<Ordering>
fn partial_cmp(&self, other: &Prescaler) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Prescaler
impl Eq for Prescaler
impl StructuralEq for Prescaler
impl StructuralPartialEq for Prescaler
Auto Trait Implementations
impl RefUnwindSafe for Prescaler
impl Send for Prescaler
impl Sync for Prescaler
impl Unpin for Prescaler
impl UnwindSafe for Prescaler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more