-
Notifications
You must be signed in to change notification settings - Fork 1
/
Comp.hpp
61 lines (39 loc) · 973 Bytes
/
Comp.hpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include <cstdint>
#include "Reg.hpp"
//Compare 1/2/3
struct Comp : private Reg {
enum
CMX { CMP1, CMP2, CMP3 };
//instantiate Comp with comparator number
Comp (CMX);
auto
on (bool) -> void;
auto
out (bool) -> void;
auto
out_inv (bool) -> void;
auto
evt_bit () -> bool;
auto
out_bit (void) -> bool;
enum
EVPOL { OFF, LH, HL, ANY };
auto
evt_sel (EVPOL) -> void;
auto
cref_cxina (bool) -> void;
enum
CCH { CXINB, CXINC, CXIND, BGAP };
auto
ch_sel (CCH) -> void;
//common for all instances
static auto
stop_idle (bool) -> void;
enum
CVREF { INT_BGAP, EXT_CVREF };
static auto
cref_sel (CVREF) -> void;
private:
volatile uint32_t* m_cmpx_con;
};