Struct rp2040_hal::watchdog::Watchdog
source · pub struct Watchdog { /* private fields */ }
Expand description
Watchdog peripheral
Implementations§
source§impl Watchdog
impl Watchdog
sourcepub fn enable_tick_generation(&mut self, cycles: u8)
pub fn enable_tick_generation(&mut self, cycles: u8)
Starts tick generation on clk_tick which is driven from clk_ref.
§Arguments
cycles
- Total number of tick cycles before the next tick is generated. It is expected to be the frequency in MHz of clk_ref.
sourcepub fn pause_on_debug(&mut self, pause: bool)
pub fn pause_on_debug(&mut self, pause: bool)
Defines whether or not the watchdog timer should be paused when processor(s) are in debug mode or when JTAG is accessing bus fabric
§Arguments
pause
- If true, watchdog timer will be paused
sourcepub fn read_scratch(&self, reg: ScratchRegister) -> u32
pub fn read_scratch(&self, reg: ScratchRegister) -> u32
Read a scratch register
sourcepub fn write_scratch(&mut self, reg: ScratchRegister, value: u32)
pub fn write_scratch(&mut self, reg: ScratchRegister, value: u32)
Write a scratch register
sourcepub fn feed(&self)
pub fn feed(&self)
Set the watchdog counter back to its load value, making sure that the watchdog reboot will not be triggered for the configured period.
sourcepub fn start<T: Into<MicrosDurationU32>>(&mut self, period: T)
pub fn start<T: Into<MicrosDurationU32>>(&mut self, period: T)
Start the watchdog. This enables a timer which will reboot the
rp2040 if Watchdog::feed()
does not get called for the configured period.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Watchdog
impl RefUnwindSafe for Watchdog
impl Send for Watchdog
impl !Sync for Watchdog
impl Unpin for Watchdog
impl UnwindSafe for Watchdog
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more