File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#include " WDT.h"
6
6
7
+ // Constructor
8
+ APM3_WDT::APM3_WDT ()
9
+ {
10
+ // The watchdog only runs off of the LFRC
11
+ am_hal_clkgen_control (AM_HAL_CLKGEN_CONTROL_LFRC_START, 0 );
12
+ }
13
+
14
+
15
+ // Configure the watchdog
16
+ void APM3_WDT::configure (clock, interrupt, reset)
17
+ {
18
+
19
+ }
20
+
21
+ // Enable the watchdog
22
+ void APM3_WDT::enable ()
23
+ {
24
+ // Enable the interrupt for the watchdog in the NVIC
25
+ NVIC_EnableIRQ (WDT_IRQn);
26
+ am_hal_wdt_start ();
27
+ }
28
+
29
+ // Disable the watchdog
30
+ void APM3_WDT::disable ()
31
+ {
32
+ // Enable the interrupt for the watchdog in the NVIC
33
+ NVIC_DisableIRQ (WDT_IRQn);
34
+ am_hal_wdt_int_disable ();
35
+ }
36
+
37
+ // Restart the watchdog
38
+ void APM3_WDT::restart ()
39
+ {
40
+ am_hal_wdt_restart ();
41
+ }
42
+
43
+ // Clear the watchdog interrupt
44
+ void APM3_WDT::clear ()
45
+ {
46
+ am_hal_wdt_int_clear ();
47
+ }
You can’t perform that action at this time.
0 commit comments