/
Registers.h
61 lines (54 loc) · 931 Bytes
/
Registers.h
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
#ifndef REGISTER_H
#define REGISTER_H
#include "HardwareSerial.h"
struct Register
{
Register(){}
Register(char a):address(a), data(0)
{
}
char address;
char data;
char getData()
{
return data;
}
};
struct ControlRegister
{
ControlRegister(char a):address(a), data(0){}
bool gated;
char address;
char data;
char getData()
{
return data | gated;
}
};
struct ResonanceFilterRegister
{
ResonanceFilterRegister(char a):address(a){}
char address;
char voiceSelects;
char resonance;
char getData()
{
return (resonance << 4) | voiceSelects;
}
};
struct ModeVolumeRegister
{
ModeVolumeRegister(char a):address(a), data(0){}
char address;
char data;
char volume;
bool lowPassEnabled;
bool hiPassEnabled;
bool bandPassEnabled;
bool threeOffEnabled;
char getData()
{
return (threeOffEnabled << 7) | (hiPassEnabled << 6) | (bandPassEnabled << 5) | (lowPassEnabled << 4) | volume;
}
};
#endif