File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -690,6 +690,7 @@ pub mod prelude;
690690pub mod serial;
691691pub mod spi;
692692pub mod timer;
693+ pub mod watchdog;
693694
694695/// Input capture
695696///
Original file line number Diff line number Diff line change 1+ //! Traits for interactions with a processors watchdog timer.
2+
3+
4+
5+ /// Feeds an existing watchdog to ensure the processor isn't reset. Sometimes
6+ /// commonly referred to as "kicking" or "refreshing".
7+ #[ cfg( feature = "unproven" ) ]
8+ pub trait Watchdog {
9+ /// Triggers the watchdog. This must be done once the watchdog is started
10+ /// to prevent the processor being reset.
11+ fn feed ( & mut self ) ;
12+ }
13+
14+
15+ /// Enables A watchdog timer to reset the processor if software is frozen or
16+ /// stalled.
17+ #[ cfg( feature = "unproven" ) ]
18+ pub trait WatchdogEnable {
19+ /// Unit of time used by the watchdog
20+ type Time ;
21+ /// Starts the watchdog with a given period, typically once this is done
22+ /// the watchdog needs to be kicked periodically or the processor is reset.
23+ fn start < T > ( & mut self , period : T ) where T : Into < Self :: Time > ;
24+ }
25+
26+
27+ /// Disables a running watchdog timer so the processor won't be reset.
28+ #[ cfg( feature = "unproven" ) ]
29+ pub trait WatchdogDisable {
30+ /// Disables the watchdog
31+ fn disable ( & mut self ) ;
32+ }
You can’t perform that action at this time.
0 commit comments