Subversion Repositories HomeAutomation

Rev

Rev 1564 | Rev 1715 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1564 Rev 1588
Line 35... Line 35...
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
#define IR_PROTOCOLS_USE_SKY        1
-
 
40
#define IR_PROTOCOLS_USE_NEXA2      1
40
 
41
 
41
/* All these functions take a buffer with pulse times and tries to parse it
42
/* All these functions take a buffer with pulse times and tries to parse it
42
 * to a Ir_Protocol_Data_t structure. They return IR_OK on success
43
 * to a Ir_Protocol_Data_t structure. They return IR_OK on success
43
 * and IR_NOT_CORRECT_DATA if there was no match. */
44
 * and IR_NOT_CORRECT_DATA if there was no match. */
44
#if (IR_PROTOCOLS_USE_SIRC)
45
#if (IR_PROTOCOLS_USE_SIRC)
Line 63... Line 64...
63
int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
64
int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
64
#endif
65
#endif
65
#if (IR_PROTOCOLS_USE_SKY)
66
#if (IR_PROTOCOLS_USE_SKY)
66
int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
67
int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
67
#endif
68
#endif
-
 
69
 
-
 
70
#if (IR_PROTOCOLS_USE_NEXA2)
-
 
71
int8_t parseNexa2(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
-
 
72
#endif
-
 
73
 
68
/* Try to parse all above protocols until a match is found. */
74
/* Try to parse all above protocols until a match is found. */
69
int8_t parseProtocol(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
75
int8_t parseProtocol(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
70
/* The Hash protocol always succeeds and creates a one-way signature of the
76
/* The Hash protocol always succeeds and creates a one-way signature of the
71
 * pulse times buffer that is supposed to be unique and constant for a specific
77
 * pulse times buffer that is supposed to be unique and constant for a specific
72
 * IR event. It may be used to send a valid event even if the protocol hasn't
78
 * IR event. It may be used to send a valid event even if the protocol hasn't
Line 86... Line 92...
86
int8_t expandPanasonic(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
92
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);
93
int8_t expandSky(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
88
/* Pass the Ir_Protocol_Data_t automatically to the correct function. */
94
/* Pass the Ir_Protocol_Data_t automatically to the correct function. */
89
int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
95
int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto);
90
 
96
 
91
 
97
 
92
#define IR_OK               1
98
#define IR_OK               1
93
#define IR_NO_PROTOCOL      2
99
#define IR_NO_PROTOCOL      2
94
#define IR_TIME_OVFL        3
100
#define IR_TIME_OVFL        3
95
#define IR_NO_DATA          4
101
#define IR_NO_DATA          4
96
#define IR_NOT_CORRECT_DATA 5
102
#define IR_NOT_CORRECT_DATA 5
Line 241... Line 247...
241
#define IR_SKY_TIMEOUT      150                                 //ms    (time between ir frames)
247
#define IR_SKY_TIMEOUT      150                                 //ms    (time between ir frames)
242
#define IR_SKY_REPS         1                                   //      (minimum number of times to repeat code)
248
#define IR_SKY_REPS         1                                   //      (minimum number of times to repeat code)
243
#define IR_SKY_F_MOD        38                                  //kHz   (modulation frequency)
249
#define IR_SKY_F_MOD        38                                  //kHz   (modulation frequency)
244
#define IR_SKY_TOL_DIV      4
250
#define IR_SKY_TOL_DIV      4
245
 
251
 
-
 
252
 
-
 
253
/* Nexa2 Implementation
-
 
254
 * Receiver:
-
 
255
 * Transmitter:
-
 
256
 */
-
 
257
#define IR_PROTO_NEXA2      10
-
 
258
#define IR_NEXA2_START      2500*CYCLES_PER_US/TIMER_PRESC      //us
-
 
259
#define IR_NEXA2_HIGH       320*CYCLES_PER_US/TIMER_PRESC       //us
-
 
260
#define IR_NEXA2_LOW_ONE    210*CYCLES_PER_US/TIMER_PRESC       //us
-
 
261
#define IR_NEXA2_LOW_ZERO   1200*CYCLES_PER_US/TIMER_PRESC      //us
-
 
262
#define IR_NEXA2_TIMEOUT    10                                  //ms    (time between ir frames)
-
 
263
#define IR_NEXA2_REPS       4                                   //      (minimum number of times to repeat code)
-
 
264
#define IR_NEXA2_TOL_DIV    4
246
 
265
 
247
 
266
 
248
#define IR_PROTO_HASH       0xfe
267
#define IR_PROTO_HASH       0xfe
249
#define IR_PROTO_UNKNOWN    0xff                                //
268
#define IR_PROTO_UNKNOWN    0xff                                //
250
 
269