pub struct IndependentWatchdog<'d, T: Instance> { /* private fields */ }Expand description
Implementations§
Source§impl<'d, T: Instance> IndependentWatchdog<'d, T>
impl<'d, T: Instance> IndependentWatchdog<'d, T>
Sourcepub fn new(inner: Peri<'d, T>, timeout_us: u32) -> Self
pub fn new(inner: Peri<'d, T>, timeout_us: u32) -> Self
Configure the watchdog for a timeout_us microsecond period.
The period is (reload + 1) * prescaler / clock; the clock is the LSI, or HSI / 1024 on
CH32X0. Both are RC oscillators with a tolerance, so leave margin and pet well before
the nominal deadline. Panics if the timeout does not fit the 12-bit
counter with the largest prescaler (32 s at 32.768 kHz, 26 s at
40 kHz).