-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirremote.h
59 lines (48 loc) · 1.61 KB
/
irremote.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
/*
* IRremote
* Version 0.11 August, 2009
* Copyright 2009 Ken Shirriff
* For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
*
* Modified by Tim Dorssers
*
* Interrupt code based on NECIRrcv by Joe Knapp
* http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556
* Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/
*/
#ifndef IRRECV_H
#define IRRECV_H
// The following are compile-time library options.
// If you change them, recompile the library.
#define COMPILE_DECODE_NEC
//#define COMPILE_DECODE_SONY
//#define COMPILE_DECODE_RC5
//#define COMPILE_DECODE_RC6
//#define COMPILE_DECODE_JVC
// Results returned from the decoder
typedef struct {
int decode_type; // NEC, SONY, RC5, UNKNOWN
unsigned long value; // Decoded value
int bits; // Number of bits in decoded value
volatile unsigned int *rawbuf; // Raw intervals in .5 us ticks
int rawlen; // Number of records in rawbuf.
} decode_results;
// Values for decode_type
#define NEC 1
#define SONY 2
#define RC5 3
#define RC6 4
#define JVC 5
#define UNKNOWN -1
// Decoded value for NEC when a repeat code is received
#define REPEAT 0xffffffff
void setup_irrecv(void);
int irrecv_decode(decode_results *results);
void irrecv_resume(void);
// Some useful constants
#define USECPERTICK 50 // microseconds per clock interrupt tick
#define RAWBUF 100 // Length of raw duration buffer
// Marks tend to be 100us too long, and spaces 100us too short
// when received due to sensor lag.
#define MARK_EXCESS 100
#endif /* IRRECV_H */