Rev 2246 | Rev 2259 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2246 | Rev 2254 | ||
|---|---|---|---|
| Line 69... | Line 69... | ||
| 69 | # define IR_PROTOCOLS_USE_VIKING_STEAK 1 |
69 | # define IR_PROTOCOLS_USE_VIKING_STEAK 1 |
| 70 | #endif |
70 | #endif |
| 71 | #ifndef IR_PROTOCOLS_USE_RUBICSON |
71 | #ifndef IR_PROTOCOLS_USE_RUBICSON |
| 72 | # define IR_PROTOCOLS_USE_RUBICSON 1 |
72 | # define IR_PROTOCOLS_USE_RUBICSON 1 |
| 73 | #endif |
73 | #endif |
| - | 74 | #ifndef IR_PROTOCOLS_USE_OREGON |
|
| - | 75 | # define IR_PROTOCOLS_USE_OREGON 1 |
|
| 74 | 76 | #endif |
|
| 75 | 77 | ||
| 76 | 78 | ||
| 77 | /* All these functions take a buffer with pulse times and tries to parse it |
79 | /* All these functions take a buffer with pulse times and tries to parse it |
| 78 | * to a Ir_Protocol_Data_t structure. They return IR_OK on success |
80 | * to a Ir_Protocol_Data_t structure. They return IR_OK on success |
| 79 | * and IR_NOT_CORRECT_DATA if there was no match. */ |
81 | * and IR_NOT_CORRECT_DATA if there was no match. */ |
| Line 83... | Line 85... | ||
| 83 | #if (IR_PROTOCOLS_USE_RC5) |
85 | #if (IR_PROTOCOLS_USE_RC5) |
| 84 | int8_t parseRC5(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
86 | int8_t parseRC5(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 85 | #endif |
87 | #endif |
| 86 | #if (IR_PROTOCOLS_USE_SHARP) |
88 | #if (IR_PROTOCOLS_USE_SHARP) |
| 87 | int8_t parseSharp(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
89 | int8_t parseSharp(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 88 | #endif |
90 | #endif |
| 89 | #if (IR_PROTOCOLS_USE_NEC) |
91 | #if (IR_PROTOCOLS_USE_NEC) |
| 90 | int8_t parseNEC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
92 | int8_t parseNEC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 91 | #endif |
93 | #endif |
| 92 | #if (IR_PROTOCOLS_USE_SAMSUNG) |
94 | #if (IR_PROTOCOLS_USE_SAMSUNG) |
| 93 | int8_t parseSamsung(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
95 | int8_t parseSamsung(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 94 | #endif |
96 | #endif |
| 95 | #if (IR_PROTOCOLS_USE_MARANTZ) |
97 | #if (IR_PROTOCOLS_USE_MARANTZ) |
| 96 | int8_t parseMarantz(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
98 | int8_t parseMarantz(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 97 | #endif |
99 | #endif |
| 98 | #if (IR_PROTOCOLS_USE_PANASONIC) |
100 | #if (IR_PROTOCOLS_USE_PANASONIC) |
| 99 | int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
101 | int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 100 | #endif |
102 | #endif |
| 101 | #if (IR_PROTOCOLS_USE_SKY) |
103 | #if (IR_PROTOCOLS_USE_SKY) |
| 102 | int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
104 | int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 103 | #endif |
105 | #endif |
| 104 | #if (IR_PROTOCOLS_USE_IROBOT) |
106 | #if (IR_PROTOCOLS_USE_IROBOT) |
| 105 | int8_t parseiRobot(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
107 | int8_t parseiRobot(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 106 | #endif |
108 | #endif |
| 107 | 109 | ||
| 108 | 110 | ||
| 109 | /* RF protocols needs index parameter */ |
111 | /* RF protocols needs index parameter */ |
| 110 | #if (IR_PROTOCOLS_USE_NEXA2) |
112 | #if (IR_PROTOCOLS_USE_NEXA2) |
| 111 | int8_t parseNexa2(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
113 | int8_t parseNexa2(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
| 112 | #endif |
114 | #endif |
| 113 | #if (IR_PROTOCOLS_USE_NEXA1) |
115 | #if (IR_PROTOCOLS_USE_NEXA1) |
| 114 | int8_t parseNexa1(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
116 | int8_t parseNexa1(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
| 115 | #endif |
117 | #endif |
| 116 | #if (IR_PROTOCOLS_USE_VIKING) |
118 | #if (IR_PROTOCOLS_USE_VIKING) |
| 117 | int8_t parseViking(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
119 | int8_t parseViking(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
| 118 | #endif |
120 | #endif |
| 119 | #if (IR_PROTOCOLS_USE_VIKING_STEAK) |
121 | #if (IR_PROTOCOLS_USE_VIKING_STEAK) |
| 120 | int8_t parseVikingSteak(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
122 | int8_t parseVikingSteak(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
| 121 | #endif |
123 | #endif |
| 122 | #if (IR_PROTOCOLS_USE_RUBICSON) |
124 | #if (IR_PROTOCOLS_USE_RUBICSON) |
| 123 | int8_t parseRubicson(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
125 | int8_t parseRubicson(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
| 124 | #endif |
126 | #endif |
| - | 127 | #if (IR_PROTOCOLS_USE_OREGON) |
|
| - | 128 | int8_t parseOregon(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
|
| 125 | 129 | #endif |
|
| 126 | 130 | ||
| 127 | /* Try to parse all above protocols until a match is found. */ |
131 | /* Try to parse all above protocols until a match is found. */ |
| 128 | int8_t parseProtocol(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
132 | int8_t parseProtocol(const uint16_t *buf, uint8_t len, uint8_t index, Ir_Protocol_Data_t *proto); |
| 129 | /* The Hash protocol always succeeds and creates a one-way signature of the |
133 | /* The Hash protocol always succeeds and creates a one-way signature of the |
| 130 | * pulse times buffer that is supposed to be unique and constant for a specific |
134 | * pulse times buffer that is supposed to be unique and constant for a specific |
| Line 221... | Line 225... | ||
| 221 | #define IR_SIRC_HIGH_ZERO (600*CYCLES_PER_US/TIMER_PRESC) //us |
225 | #define IR_SIRC_HIGH_ZERO (600*CYCLES_PER_US/TIMER_PRESC) //us |
| 222 | #define IR_SIRC_TIMEOUT (52-IR_MAX_PULSE_WIDTH/1000) //ms (time between ir frames) |
226 | #define IR_SIRC_TIMEOUT (52-IR_MAX_PULSE_WIDTH/1000) //ms (time between ir frames) |
| 223 | #define IR_SIRC_REPS (3) // (minimum number of times to repeat code) |
227 | #define IR_SIRC_REPS (3) // (minimum number of times to repeat code) |
| 224 | #define IR_SIRC_F_MOD (40) //kHz (modulation frequency) |
228 | #define IR_SIRC_F_MOD (40) //kHz (modulation frequency) |
| 225 | #define IR_SIRC_TOL_DIV (4) |
229 | #define IR_SIRC_TOL_DIV (4) |
| 226 | 230 | ||
| 227 | /* Sharp Implementation |
231 | /* Sharp Implementation |
| 228 | * Receiver: DONE |
232 | * Receiver: DONE |
| 229 | * Transmitter: |
233 | * Transmitter: |
| 230 | */ |
234 | */ |
| 231 | #define IR_SHARP_HIGH (280*CYCLES_PER_US/TIMER_PRESC) //us |
235 | #define IR_SHARP_HIGH (280*CYCLES_PER_US/TIMER_PRESC) //us |
| Line 375... | Line 379... | ||
| 375 | #define IR_RUBICSON_LOW_START (3850*CYCLES_PER_US/TIMER_PRESC) //us |
379 | #define IR_RUBICSON_LOW_START (3850*CYCLES_PER_US/TIMER_PRESC) //us |
| 376 | #define IR_RUBICSON_TIMEOUT (200) //ms BURST! (time between ir frames) |
380 | #define IR_RUBICSON_TIMEOUT (200) //ms BURST! (time between ir frames) |
| 377 | #define IR_RUBICSON_REPS (1) // (minimum number of times to repeat code) |
381 | #define IR_RUBICSON_REPS (1) // (minimum number of times to repeat code) |
| 378 | #define IR_RUBICSON_F_MOD (38) //kHz (modulation frequency) |
382 | #define IR_RUBICSON_F_MOD (38) //kHz (modulation frequency) |
| 379 | #define IR_RUBICSON_TOL_DIV (4) |
383 | #define IR_RUBICSON_TOL_DIV (4) |
| - | 384 | ||
| - | 385 | /* Oregon weather sensor Implementation |
|
| - | 386 | * Receiver: |
|
| - | 387 | */ |
|
| - | 388 | #define IR_OREGON_SHORT_S (300*CYCLES_PER_US/TIMER_PRESC) //us |
|
| - | 389 | #define IR_OREGON_SHORT_L (650*CYCLES_PER_US/TIMER_PRESC) //us |
|
| - | 390 | #define IR_OREGON_LONG_S (850*CYCLES_PER_US/TIMER_PRESC) //us |
|
| - | 391 | #define IR_OREGON_LONG_L (1100*CYCLES_PER_US/TIMER_PRESC) //us |
|
| - | 392 | #define IR_OREGON_END (6000*CYCLES_PER_US/TIMER_PRESC) //us |
|
| - | 393 | #define IR_OREGON_DATASIZE 25 |
|
| - | 394 | #define IR_OREGON_TIMEOUT (200) //ms BURST! (time between ir frames) |
|
| - | 395 | #define IR_OREGON_REPS (1) // (minimum number of times to repeat code) |
|
| - | 396 | #define IR_OREGON_F_MOD (38) //kHz (modulation frequency) |
|
| - | 397 | #define IR_OREGON_TOL_DIV (4) |
|
| - | 398 | ||
| 380 | 399 | ||
| 381 | #define IR_PROTO_HASH 0xfe |
400 | #define IR_PROTO_HASH 0xfe |
| 382 | #define IR_PROTO_UNKNOWN 0xff // |
401 | #define IR_PROTO_UNKNOWN 0xff // |
| 383 | 402 | ||
| 384 | 403 | ||