-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWdt.cpp
31 lines (27 loc) · 792 Bytes
/
Wdt.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "Wdt.hpp"
enum {
WDTCON = 0xBF800000,
ON = 15,
WINEN = 1,
CLR = 0
//WDTPS is read-only and set in config bits
//if need to read them, can make your own read function(s)
};
//=============================================================================
auto Wdt::
reset () -> void
{
setbit(WDTCON, 1 << CLR);
}
//=============================================================================
auto Wdt::
on (bool tf) -> void
{
setbit(WDTCON, 1<<ON, tf);
}
//=============================================================================
auto Wdt::
window_on (bool tf) -> void
{
setbit(WDTCON, 1<<WINEN, tf);
}