pub unsafe fn init() {
    let rcc = peripheral::rcc_mut();
    let tim6 = peripheral::tim6_mut();

    // RCC: Enable TIM6
    rcc.apb1enr.modify(|_, w| w.tim6en(true));

    // CEN: Disable the clock
    // OPM. Enable One Pulse Mode. Stop the counter after the next update event.
    tim6.cr1.write(|w| w.cen(false).opm(true));

    // Set pre-scaler to 8_000 -> Frequency = 1 KHz
    tim6.psc.write(|w| w.psc(7_999));
}
/// Initializes the necessary stuff to be able to use delays
///
/// # Safety
///
/// - Must be called once
/// - Must be called in an interrupt-free environment
Initializes the necessary stuff to be able to use delays
Initializes the necessary stuff to be able to use delays
pub unsafe fn init() {
    let rcc = peripheral::rcc_mut();
    let tim6 = peripheral::tim6_mut();
    // RCC: Enable TIM6
    rcc.apb1enr.modify(|_, w| w.tim6en(true));
    // CEN: Disable the clock
    // OPM. Enable One Pulse Mode. Stop the counter after the next update event.
    tim6.cr1.write(|w| w.cen(false).opm(true));
    // Set pre-scaler to 8_000 -> Frequency = 1 KHz
    tim6.psc.write(|w| w.psc(7_999));
}
pub unsafe fn init ( ) { let rcc = peripheral :: rcc_mut ( ) ; let tim6 = peripheral :: tim6_mut ( ) ; // RCC: Enable TIM6 rcc . apb1enr . modify ( | _ , w | w . tim6en ( true ) ) ; // CEN: Disable the clock // OPM. Enable One Pulse Mode. Stop the counter after the next update event. tim6 . cr1 . write ( | w | w . cen ( false ) . opm ( true ) ) ; // Set pre-scaler to 8_000 -> Frequency = 1 KHz tim6 . psc . write ( | w | w . psc ( 7_999 ) ) ; }
Initializes the necessary stuff to be able to use delays
Initializes the necessary stuff to be able to use delays
safety
Must be called once
Must be called in an interrupt-free environment
Must be called once Must be called in an interrupt - free environment