File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -695,6 +695,7 @@ pub mod prelude;
695
695
pub mod serial;
696
696
pub mod spi;
697
697
pub mod timer;
698
+ pub mod watchdog;
698
699
699
700
/// Input capture
700
701
///
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