Rev 617 | Rev 920 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 617 | Rev 732 | ||
|---|---|---|---|
| Line 18... | Line 18... | ||
| 18 | #define IR_PROTOCOLS_USE_SIRC 1 |
18 | #define IR_PROTOCOLS_USE_SIRC 1 |
| 19 | #define IR_PROTOCOLS_USE_RC5 1 |
19 | #define IR_PROTOCOLS_USE_RC5 1 |
| 20 | #define IR_PROTOCOLS_USE_SHARP 1 |
20 | #define IR_PROTOCOLS_USE_SHARP 1 |
| 21 | #define IR_PROTOCOLS_USE_NEC 1 |
21 | #define IR_PROTOCOLS_USE_NEC 1 |
| 22 | #define IR_PROTOCOLS_USE_SAMSUNG 1 |
22 | #define IR_PROTOCOLS_USE_SAMSUNG 1 |
| - | 23 | #define IR_PROTOCOLS_USE_MARANTZ 1 |
|
| 23 | 24 | ||
| 24 | /* All these functions take a buffer with pulse times and tries to parse it |
25 | /* All these functions take a buffer with pulse times and tries to parse it |
| 25 | * to a Ir_Protocol_Data_t structure. They return IR_OK on success |
26 | * to a Ir_Protocol_Data_t structure. They return IR_OK on success |
| 26 | * and IR_NOT_CORRECT_DATA if there was no match. */ |
27 | * and IR_NOT_CORRECT_DATA if there was no match. */ |
| 27 | #if (IR_PROTOCOLS_USE_SIRC) |
28 | #if (IR_PROTOCOLS_USE_SIRC) |
| Line 36... | Line 37... | ||
| 36 | #if (IR_PROTOCOLS_USE_NEC) |
37 | #if (IR_PROTOCOLS_USE_NEC) |
| 37 | int8_t parseNEC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
38 | int8_t parseNEC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 38 | #endif |
39 | #endif |
| 39 | #if (IR_PROTOCOLS_USE_SAMSUNG) |
40 | #if (IR_PROTOCOLS_USE_SAMSUNG) |
| 40 | int8_t parseSamsung(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
41 | int8_t parseSamsung(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| - | 42 | #endif |
|
| - | 43 | #if (IR_PROTOCOLS_USE_MARANTZ) |
|
| - | 44 | int8_t parseMarantz(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
|
| 41 | #endif |
45 | #endif |
| 42 | /* Try to parse all above protocols until a match is found. */ |
46 | /* Try to parse all above protocols until a match is found. */ |
| 43 | int8_t parseProtocol(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
47 | int8_t parseProtocol(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 44 | /* The Hash protocol always succeeds and creates a one-way signature of the |
48 | /* The Hash protocol always succeeds and creates a one-way signature of the |
| 45 | * pulse times buffer that is supposed to be unique and constant for a specific |
49 | * pulse times buffer that is supposed to be unique and constant for a specific |
| Line 54... | Line 58... | ||
| 54 | int8_t expandSIRC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
58 | int8_t expandSIRC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 55 | int8_t expandRC5(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
59 | int8_t expandRC5(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 56 | int8_t expandSharp(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
60 | int8_t expandSharp(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 57 | int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
61 | int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 58 | int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
62 | int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| - | 63 | int8_t expandMarantz(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
|
| 59 | /* Pass the Ir_Protocol_Data_t automatically to the correct function. */ |
64 | /* Pass the Ir_Protocol_Data_t automatically to the correct function. */ |
| 60 | int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
65 | int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 61 | 66 | ||
| 62 | 67 | ||
| 63 | #define IR_OK 1 |
68 | #define IR_OK 1 |
| Line 86... | Line 91... | ||
| 86 | #define IR_RC5_BIT 889*2*CYCLES_PER_US/TIMER_PRESC //us |
91 | #define IR_RC5_BIT 889*2*CYCLES_PER_US/TIMER_PRESC //us |
| 87 | #define IR_RC5_TIMEOUT 105 //ms (time between ir frames) |
92 | #define IR_RC5_TIMEOUT 105 //ms (time between ir frames) |
| 88 | #define IR_RC5_REPS 1 // (minimum number of times to repeat code) |
93 | #define IR_RC5_REPS 1 // (minimum number of times to repeat code) |
| 89 | #define IR_RC5_F_MOD 36 //kHz (modulation frequency) |
94 | #define IR_RC5_F_MOD 36 //kHz (modulation frequency) |
| 90 | #define IR_RC5_TOL_DIV 4 |
95 | #define IR_RC5_TOL_DIV 4 |
| 91 | 96 | ||
| 92 | /* RC6 Implementation |
97 | /* RC6 Implementation |
| 93 | * Receiver: |
98 | * Receiver: |
| 94 | * Transmitter: |
99 | * Transmitter: |
| 95 | */ |
100 | */ |
| 96 | #define IR_PROTO_RC6 1 |
101 | #define IR_PROTO_RC6 1 |
| Line 170... | Line 175... | ||
| 170 | #define IR_SAMS_TOL_DIV 4 |
175 | #define IR_SAMS_TOL_DIV 4 |
| 171 | 176 | ||
| 172 | 177 | ||
| 173 | #define IR_PROTO_HASH 0xfe |
178 | #define IR_PROTO_HASH 0xfe |
| 174 | #define IR_PROTO_UNKNOWN 0xff // |
179 | #define IR_PROTO_UNKNOWN 0xff // |
| - | 180 | ||
| - | 181 | ||
| - | 182 | /* Marantz Implementation |
|
| - | 183 | * Receiver: Working (has not been tested with odd adressbits) |
|
| - | 184 | * Transmitter: |
|
| - | 185 | */ |
|
| - | 186 | #define IR_PROTO_MARANTZ 7 |
|
| - | 187 | #define IR_MARANTZ_HALF_BIT 889*CYCLES_PER_US/TIMER_PRESC //us |
|
| - | 188 | #define IR_MARANTZ_BIT 889*2*CYCLES_PER_US/TIMER_PRESC //us |
|
| - | 189 | #define IR_MARANTZ_TIMEOUT 105 //ms (time between ir frames) |
|
| - | 190 | #define IR_MARANTZ_REPS 1 // (minimum number of times to repeat code) |
|
| - | 191 | #define IR_MARANTZ_F_MOD 36 //kHz (modulation frequency) |
|
| - | 192 | #define IR_MARANTZ_TOL_DIV 4 |
|
| 175 | 193 | ||
| 176 | 194 | ||
| 177 | #endif /*IR_PROTOCOLS_H_*/ |
195 | #endif /*IR_PROTOCOLS_H_*/ |