-
Notifications
You must be signed in to change notification settings - Fork 15
/
psc05.h
executable file
·62 lines (55 loc) · 1.42 KB
/
psc05.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
62
/*
2017-APR-17 Richard Hughes Version 0.5
- Added timing definitions for 50Hz mains frequency.
*/
#ifndef LPCS05
#define LPCS05
// Defines and constants for PSC05 receiving
#define OFFSET_DELAY 500 // uS from zero cross to center of bit (sugg 500-700 us)
#define HALF_CYCLE_DELAY 8334 // Calculated 8334 uS between bit repeats in a half-cycle
// Timings for 50Hz mains frequency
#define OFFSET_DELAY_50 800 // Microseconds from zero cross to center of bit
#define HALF_CYCLE_DELAY_50 10000 // Microseconds between bit repeats in a half-cycle
#ifndef ON // use same defines from x10constants.h for rcvd cmnds
#define ON B00101 // these are examples
#endif
#ifndef OFF
#define OFF B00111
#endif
byte House[16] = { // Lookup table for House Code
B0110, // A
B1110, // B
B0010, // C
B1010, // D
B0001, // E
B1001, // F
B0101, // G
B1101, // H
B0111, // I
B1111, // J
B0011, // K
B1011, // L
B0000, // M
B1000, // N
B0100, // O
B1100, // P
};
byte Unit[16] = { // Lookup table for Unit Code
B01100, // 1
B11100, // 2
B00100, // 3
B10100, // 4
B00010, // 5
B10010, // 6
B01010, // 7
B11010, // 8
B01110, // 9
B11110, // 10
B00110, // 11
B10110, // 12
B00000, // 13
B10000, // 14
B01000, // 15
B11000, // 16
};
#endif