-
Notifications
You must be signed in to change notification settings - Fork 1
/
Pmd.cpp
33 lines (29 loc) · 832 Bytes
/
Pmd.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
32
33
#include "Pmd.hpp"
#include "Sys.hpp"
enum {
PMDCON = 0xBF8035B0,
PMDLOCK = 11,
PMD1 = 0xBF8035C0
};
//-----------------------------------------------------------------private-----
static auto
unlock () -> void
{
Sys::unlock();
Reg::clrbit(PMDCON, 1<<PMDLOCK);
}
//-----------------------------------------------------------------private-----
static auto
lock () -> void
{
Reg::setbit(PMDCON, 1<<PMDLOCK);
Sys::lock();
}
//=============================================================================
auto Pmd::
disable (PMD e, bool tf) -> void
{
unlock();
setbit(PMD1 + 16 * (e / 32), (1<<(e % 32)), tf);
lock();
}