Rev 1329 | Rev 1564 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1329 | Rev 1562 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | #define IR_PROTOCOLS_USE_SHARP 1 |
34 | #define IR_PROTOCOLS_USE_SHARP 1 |
| 35 | #define IR_PROTOCOLS_USE_NEC 1 |
35 | #define IR_PROTOCOLS_USE_NEC 1 |
| 36 | #define IR_PROTOCOLS_USE_SAMSUNG 1 |
36 | #define IR_PROTOCOLS_USE_SAMSUNG 1 |
| 37 | #define IR_PROTOCOLS_USE_MARANTZ 1 |
37 | #define IR_PROTOCOLS_USE_MARANTZ 1 |
| 38 | #define IR_PROTOCOLS_USE_PANASONIC 1 |
38 | #define IR_PROTOCOLS_USE_PANASONIC 1 |
| - | 39 | #define IR_PROTOCOLS_USE_SKY 1 |
|
| 39 | 40 | ||
| 40 | /* All these functions take a buffer with pulse times and tries to parse it |
41 | /* All these functions take a buffer with pulse times and tries to parse it |
| 41 | * to a Ir_Protocol_Data_t structure. They return IR_OK on success |
42 | * to a Ir_Protocol_Data_t structure. They return IR_OK on success |
| 42 | * and IR_NOT_CORRECT_DATA if there was no match. */ |
43 | * and IR_NOT_CORRECT_DATA if there was no match. */ |
| 43 | #if (IR_PROTOCOLS_USE_SIRC) |
44 | #if (IR_PROTOCOLS_USE_SIRC) |
| Line 58... | Line 59... | ||
| 58 | #if (IR_PROTOCOLS_USE_MARANTZ) |
59 | #if (IR_PROTOCOLS_USE_MARANTZ) |
| 59 | int8_t parseMarantz(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
60 | int8_t parseMarantz(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 60 | #endif |
61 | #endif |
| 61 | #if (IR_PROTOCOLS_USE_PANASONIC) |
62 | #if (IR_PROTOCOLS_USE_PANASONIC) |
| 62 | int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
63 | int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| - | 64 | #endif |
|
| - | 65 | #if (IR_PROTOCOLS_USE_SKY) |
|
| - | 66 | int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
|
| 63 | #endif |
67 | #endif |
| 64 | /* Try to parse all above protocols until a match is found. */ |
68 | /* Try to parse all above protocols until a match is found. */ |
| 65 | int8_t parseProtocol(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
69 | int8_t parseProtocol(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 66 | /* The Hash protocol always succeeds and creates a one-way signature of the |
70 | /* The Hash protocol always succeeds and creates a one-way signature of the |
| 67 | * pulse times buffer that is supposed to be unique and constant for a specific |
71 | * pulse times buffer that is supposed to be unique and constant for a specific |
| Line 78... | Line 82... | ||
| 78 | int8_t expandSharp(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
82 | int8_t expandSharp(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 79 | int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
83 | int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 80 | int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
84 | int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 81 | int8_t expandMarantz(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
85 | int8_t expandMarantz(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 82 | int8_t expandPanasonic(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
86 | int8_t expandPanasonic(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| - | 87 | int8_t expandSky(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
|
| 83 | /* Pass the Ir_Protocol_Data_t automatically to the correct function. */ |
88 | /* Pass the Ir_Protocol_Data_t automatically to the correct function. */ |
| 84 | int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
89 | int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 85 | 90 | ||
| 86 | 91 | ||
| 87 | #define IR_OK 1 |
92 | #define IR_OK 1 |
| Line 139... | Line 144... | ||
| 139 | #define IR_RCMM_REPS 1 // (minimum number of times to repeat code) |
144 | #define IR_RCMM_REPS 1 // (minimum number of times to repeat code) |
| 140 | #define IR_RCMM_F_MOD 36 //kHz (modulation frequency) |
145 | #define IR_RCMM_F_MOD 36 //kHz (modulation frequency) |
| 141 | #define IR_RCMM_TOL_DIV 4 |
146 | #define IR_RCMM_TOL_DIV 4 |
| 142 | 147 | ||
| 143 | /* SIRC Implementation |
148 | /* SIRC Implementation |
| 144 | * Receiver: DONE |
149 | * Receiver: DONE |
| 145 | * Transmitter: |
150 | * Transmitter: |
| 146 | */ |
151 | */ |
| 147 | #define IR_PROTO_SIRC 3 |
152 | #define IR_PROTO_SIRC 3 |
| 148 | #define IR_SIRC_ST_BIT 2400*CYCLES_PER_US/TIMER_PRESC //us |
153 | #define IR_SIRC_ST_BIT 2400*CYCLES_PER_US/TIMER_PRESC //us |
| 149 | #define IR_SIRC_LOW 600*CYCLES_PER_US/TIMER_PRESC //us |
154 | #define IR_SIRC_LOW 600*CYCLES_PER_US/TIMER_PRESC //us |
| 150 | #define IR_SIRC_HIGH_ONE 1200*CYCLES_PER_US/TIMER_PRESC //us |
155 | #define IR_SIRC_HIGH_ONE 1200*CYCLES_PER_US/TIMER_PRESC //us |
| Line 222... | Line 227... | ||
| 222 | #define IR_PANA_HIGH 495*CYCLES_PER_US/TIMER_PRESC //us |
227 | #define IR_PANA_HIGH 495*CYCLES_PER_US/TIMER_PRESC //us |
| 223 | #define IR_PANA_TIMEOUT 80 //ms (time between ir frames) |
228 | #define IR_PANA_TIMEOUT 80 //ms (time between ir frames) |
| 224 | #define IR_PANA_REPS 1 // (minimum number of times to repeat code) |
229 | #define IR_PANA_REPS 1 // (minimum number of times to repeat code) |
| 225 | #define IR_PANA_F_MOD 38 //kHz (modulation frequency) |
230 | #define IR_PANA_F_MOD 38 //kHz (modulation frequency) |
| 226 | #define IR_PANA_TOL_DIV 4 |
231 | #define IR_PANA_TOL_DIV 4 |
| - | 232 | ||
| - | 233 | /* Sky Implementation |
|
| - | 234 | * Receiver: DONE |
|
| - | 235 | * Transmitter: |
|
| - | 236 | */ |
|
| - | 237 | #define IR_PROTO_SKY 9 |
|
| - | 238 | #define IR_SKY_ST_BIT 2800*CYCLES_PER_US/TIMER_PRESC //us |
|
| - | 239 | #define IR_SKY_SHORT 460*CYCLES_PER_US/TIMER_PRESC //us |
|
| - | 240 | #define IR_SKY_LONG 920*CYCLES_PER_US/TIMER_PRESC //us |
|
| - | 241 | #define IR_SKY_TIMEOUT 100 //ms (time between ir frames) |
|
| - | 242 | #define IR_SKY_REPS 1 // (minimum number of times to repeat code) |
|
| - | 243 | #define IR_SKY_F_MOD 38 //kHz (modulation frequency) |
|
| - | 244 | #define IR_SKY_TOL_DIV 4 |
|
| - | 245 | ||
| 227 | 246 | ||
| 228 | 247 | ||
| 229 | #define IR_PROTO_HASH 0xfe |
248 | #define IR_PROTO_HASH 0xfe |
| 230 | #define IR_PROTO_UNKNOWN 0xff // |
249 | #define IR_PROTO_UNKNOWN 0xff // |
| 231 | 250 | ||