protocol.h 882 Bytes
Newer Older
Max Becker's avatar
Max Becker committed
1

2
3
#ifndef IR_PROTOCOL_H
#define IR_PROTOCOL_H
Max Becker's avatar
Max Becker committed
4
5
6
7
8
9
10

#define START_MARK 8000UL
#define START_SPACE 4000UL
#define ONE_SPACE 1600UL
#define ZERO_SPACE 550UL
#define BIT_MARK 600UL

11
12
13
14
//The following values are used for detection. They are similar to the values above but divided by 50 (USECSPERTICK) and a tolerance (3/4; 5/4) is included. They might have been adjusted based on testing.
//Precalculating these reduces run time (but might increase program size slightly.
//In addition the precalculation done by the compiler produces some strange results. Or maybe I am just too stupid
#define START_MARK_LOW_T 90
Max Becker's avatar
Max Becker committed
15
#define START_MARK_HIGH_T 220
16
#define START_SPACE_LOW_T 50
Max Becker's avatar
Max Becker committed
17
#define START_SPACE_HIGH_T 120
18
#define ONE_SPACE_LOW_T 20
Max Becker's avatar
Max Becker committed
19
#define ONE_SPACE_HIGH_T 40
20
#define ZERO_SPACE_LOW_T 7
Max Becker's avatar
Max Becker committed
21
#define ZERO_SPACE_HIGH_T 19
22
#define BIT_MARK_LOW_T 7
Max Becker's avatar
Max Becker committed
23
#define BIT_MARK_HIGH_T 20
Max Becker's avatar
Max Becker committed
24

25
26

#endif //IR_PROTOCOL_H