Subversion Repositories HomeAutomation

Rev

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

Rev 732 Rev 920
Line -... Line 1...
-
 
1
/**
-
 
2
 * @defgroup infrared IR Protocols Driver Library
-
 
3
 * @code #include <drivers/ir/protocols.h> @endcode
-
 
4
 *
-
 
5
 * @brief  
-
 
6
 *
-
 
7
 *
-
 
8
 * @author  Andreas Fritiofson, Anders Runeson
-
 
9
 * @date    2007
-
 
10
 */
-
 
11
 
-
 
12
/**@{*/
-
 
13
 
-
 
14
 
1
#ifndef IR_PROTOCOLS_H_
15
#ifndef IR_PROTOCOLS_H_
2
#define IR_PROTOCOLS_H_
16
#define IR_PROTOCOLS_H_
3
#include <stdio.h>
17
#include <stdio.h>
4
#include <config.h>
18
#include <config.h>
5
 
19
 
Line 19... Line 33...
19
#define IR_PROTOCOLS_USE_RC5        1
33
#define IR_PROTOCOLS_USE_RC5        1
20
#define IR_PROTOCOLS_USE_SHARP      1
34
#define IR_PROTOCOLS_USE_SHARP      1
21
#define IR_PROTOCOLS_USE_NEC        1
35
#define IR_PROTOCOLS_USE_NEC        1
22
#define IR_PROTOCOLS_USE_SAMSUNG    1
36
#define IR_PROTOCOLS_USE_SAMSUNG    1
23
#define IR_PROTOCOLS_USE_MARANTZ    1
37
#define IR_PROTOCOLS_USE_MARANTZ    1
24
 
38
 
25
/* All these functions take a buffer with pulse times and tries to parse it
39
/* All these functions take a buffer with pulse times and tries to parse it
26
 * to a Ir_Protocol_Data_t structure. They return IR_OK on success
40
 * to a Ir_Protocol_Data_t structure. They return IR_OK on success
27
 * and IR_NOT_CORRECT_DATA if there was no match. */
41
 * and IR_NOT_CORRECT_DATA if there was no match. */
28
#if (IR_PROTOCOLS_USE_SIRC)
42
#if (IR_PROTOCOLS_USE_SIRC)
29
int8_t parseSIRC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
43
int8_t parseSIRC(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto);
Line 82... Line 96...
82
#define IR_MIN_PULSE_WIDTH  5                                   //us
96
#define IR_MIN_PULSE_WIDTH  5                                   //us
83
#define IR_MAX_PULSE_WIDTH  12000                               //us
97
#define IR_MAX_PULSE_WIDTH  12000                               //us
84
 
98
 
85
/* RC5 Implementation
99
/* RC5 Implementation
86
 * Receiver: DONE
100
 * Receiver: DONE
87
 * Transmitter:
101
 * Transmitter: DONE (noddan implentation, not fully working)
88
 */
102
 */
89
#define IR_PROTO_RC5        0
103
#define IR_PROTO_RC5        0
90
#define IR_RC5_HALF_BIT     889*CYCLES_PER_US/TIMER_PRESC       //us
104
#define IR_RC5_HALF_BIT     889*CYCLES_PER_US/TIMER_PRESC       //us
91
#define IR_RC5_BIT          889*2*CYCLES_PER_US/TIMER_PRESC     //us
105
#define IR_RC5_BIT          889*2*CYCLES_PER_US/TIMER_PRESC     //us
92
#define IR_RC5_TIMEOUT      105                                 //ms    (time between ir frames)
106
#define IR_RC5_TIMEOUT      105                                 //ms    (time between ir frames)
93
#define IR_RC5_REPS         1                                   //      (minimum number of times to repeat code)
107
#define IR_RC5_REPS         1                                   //      (minimum number of times to repeat code)
94
#define IR_RC5_F_MOD        36                                  //kHz   (modulation frequency)
108
#define IR_RC5_F_MOD        36                                  //kHz   (modulation frequency)
95
#define IR_RC5_TOL_DIV      4
109
#define IR_RC5_TOL_DIV      4
96
 
110
 
97
/* RC6 Implementation
111
/* RC6 Implementation
98
 * Receiver:
112
 * Receiver:
99
 * Transmitter:
113
 * Transmitter:
100
 */
114
 */
101
#define IR_PROTO_RC6        1
115
#define IR_PROTO_RC6        1
102
#define IR_RC6_ST_BIT       1*CYCLES_PER_US/TIMER_PRESC         //us
116
#define IR_RC6_ST_BIT       1*CYCLES_PER_US/TIMER_PRESC         //us
103
#define IR_RC6_TIMEOUT      1                                   //ms    (time between ir frames)
117
#define IR_RC6_TIMEOUT      1                                   //ms    (time between ir frames)
104
#define IR_RC6_REPS         1                                   //      (minimum number of times to repeat code)
118
#define IR_RC6_REPS         1                                   //      (minimum number of times to repeat code)
Line 115... Line 129...
115
#define IR_RCMM_REPS        1                                   //      (minimum number of times to repeat code)
129
#define IR_RCMM_REPS        1                                   //      (minimum number of times to repeat code)
116
#define IR_RCMM_F_MOD       36                                  //kHz   (modulation frequency)
130
#define IR_RCMM_F_MOD       36                                  //kHz   (modulation frequency)
117
#define IR_RCMM_TOL_DIV     4
131
#define IR_RCMM_TOL_DIV     4
118
 
132
 
119
/* SIRC Implementation
133
/* SIRC Implementation
120
 * Receiver: DONE
134
 * Receiver: DONE
121
 * Transmitter:
135
 * Transmitter:
122
 */
136
 */
123
#define IR_PROTO_SIRC       3
137
#define IR_PROTO_SIRC       3
124
#define IR_SIRC_ST_BIT      2400*CYCLES_PER_US/TIMER_PRESC      //us
138
#define IR_SIRC_ST_BIT      2400*CYCLES_PER_US/TIMER_PRESC      //us
125
#define IR_SIRC_LOW         600*CYCLES_PER_US/TIMER_PRESC       //us
139
#define IR_SIRC_LOW         600*CYCLES_PER_US/TIMER_PRESC       //us
Line 171... Line 185...
171
#define IR_SAMS_HIGH        500*CYCLES_PER_US/TIMER_PRESC       //us
185
#define IR_SAMS_HIGH        500*CYCLES_PER_US/TIMER_PRESC       //us
172
#define IR_SAMS_TIMEOUT     50                                  //ms    (time between ir frames)
186
#define IR_SAMS_TIMEOUT     50                                  //ms    (time between ir frames)
173
#define IR_SAMS_REPS        1                                   //      (minimum number of times to repeat code)
187
#define IR_SAMS_REPS        1                                   //      (minimum number of times to repeat code)
174
#define IR_SAMS_F_MOD       38                                  //kHz   (modulation frequency)
188
#define IR_SAMS_F_MOD       38                                  //kHz   (modulation frequency)
175
#define IR_SAMS_TOL_DIV     4
189
#define IR_SAMS_TOL_DIV     4
176
 
-
 
177
 
-
 
178
#define IR_PROTO_HASH       0xfe
-
 
179
#define IR_PROTO_UNKNOWN    0xff                                //
-
 
180
 
-
 
181
 
190
 
182
/* Marantz Implementation
191
/* Marantz Implementation
183
 * Receiver: Working (has not been tested with odd adressbits)
192
 * Receiver: DONE (has not been tested with odd adressbits)
184
 * Transmitter:
193
 * Transmitter:
185
 */
194
 */
186
#define IR_PROTO_MARANTZ        7
195
#define IR_PROTO_MARANTZ        7
187
#define IR_MARANTZ_HALF_BIT     889*CYCLES_PER_US/TIMER_PRESC       //us
196
#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
197
#define IR_MARANTZ_BIT          889*2*CYCLES_PER_US/TIMER_PRESC     //us
189
#define IR_MARANTZ_TIMEOUT      105                                 //ms    (time between ir frames)
198
#define IR_MARANTZ_TIMEOUT      105                                 //ms    (time between ir frames)
190
#define IR_MARANTZ_REPS         1                                   //      (minimum number of times to repeat code)
199
#define IR_MARANTZ_REPS         1                                   //      (minimum number of times to repeat code)
191
#define IR_MARANTZ_F_MOD        36                                  //kHz   (modulation frequency)
200
#define IR_MARANTZ_F_MOD        36                                  //kHz   (modulation frequency)
192
#define IR_MARANTZ_TOL_DIV      4
201
#define IR_MARANTZ_TOL_DIV      4
-
 
202
 
-
 
203
#define IR_PROTO_HASH       0xfe
-
 
204
#define IR_PROTO_UNKNOWN    0xff                                //
-
 
205
 
193
 
206
 
194
 
207
 
-
 
208
/**@}*/
195
#endif /*IR_PROTOCOLS_H_*/
209
#endif /*IR_PROTOCOLS_H_*/