[][src]Module xmc4_hal::delay

shameless reuse from https://github.com/stm32-rs/ API for delays with the systick timer

Please be aware of potential overflows when using delay_us. E.g. at 48MHz the maximum delay is 89 seconds.

Consider using the timers api as a more flexible interface

Example

use xmc4_hal as hal;

use crate::hal::delay::Delay;
use cortex_m::peripheral::Peripherals;

let mut cp = cortex_m::Peripherals::take().unwrap();

let mut delay = Delay::new(cp.SYST);
loop {
    delay.delay_ms(1_000_u16);
}

Structs

Delay

System timer (SysTick) as a delay provider