fn calculate_frequency_32bit(
    base_freq: Hertz,
    freq: Hertz,
    alignment: Alignment,
) -> (u32, u16) {
    let divisor = if let Alignment::Center = alignment {
        freq.0 * 2
    } else {
        freq.0
    };

    // Round to the nearest period
    let arr = (base_freq.0 + (divisor >> 1)) / divisor - 1;

    (arr, 0)
}
// Period and prescaler calculator for 32-bit timers
// Returns (arr, psc)
Period and prescaler calculator for 32-bit timers
Returns (arr, psc)
Period and prescaler calculator for 32 - bit timers Returns ( arr psc )
fn calculate_frequency_32bit(
    base_freq: Hertz,
    freq: Hertz,
    alignment: Alignment,
) -> (u32, u16) {
    let divisor = if let Alignment::Center = alignment {
        freq.0 * 2
    } else {
        freq.0
    };
    // Round to the nearest period
    let arr = (base_freq.0 + (divisor >> 1)) / divisor - 1;
    (arr, 0)
}
fn calculate_frequency_32bit ( base_freq : Hertz , freq : Hertz , alignment : Alignment , ) -> ( u32 , u16 ) { let divisor = if let Alignment :: Center = alignment { freq . 0 * 2 } else { freq . 0 } ; // Round to the nearest period let arr = ( base_freq . 0 + ( divisor >> 1 ) ) / divisor - 1 ; ( arr , 0 ) }
Period and prescaler calculator for 32-bit timers
Returns (arr, psc)
Period and prescaler calculator for 32 - bit timers Returns ( arr psc )
base_freq
Hertz
freq
Hertz
alignment
Alignment
base_freq
Hertz
freq
Hertz
alignment
Alignment