Skip to content

Commit 331b8d7

Browse files
committed
Update WDT.cpp
1 parent 66b6e6e commit 331b8d7

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

libraries/WDT/src/WDT.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,44 @@
44

55
#include "WDT.h"
66

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+
}

0 commit comments

Comments
 (0)