1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.162 2014/09/15 10:27:37 fm Exp $
8 * Supported AVR mikrocontrollers:
13 * ATmega8, ATmega16, ATmega32
15 * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
16 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *---------------------------------------------------------------------------------------------------------------------------------------------------
27 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
28 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
30 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
33 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
34 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
36 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
39 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
40 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
41 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
42 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
43 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
44 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
45 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
46 # define IRMP_SUPPORT_MANCHESTER 1
48 # define IRMP_SUPPORT_MANCHESTER 0
51 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
52 # define IRMP_SUPPORT_SERIAL 1
54 # define IRMP_SUPPORT_SERIAL 0
57 #define IRMP_KEY_REPETITION_LEN (uint16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
59 #define MIN_TOLERANCE_00 1.0 // -0%
60 #define MAX_TOLERANCE_00 1.0 // +0%
62 #define MIN_TOLERANCE_05 0.95 // -5%
63 #define MAX_TOLERANCE_05 1.05 // +5%
65 #define MIN_TOLERANCE_10 0.9 // -10%
66 #define MAX_TOLERANCE_10 1.1 // +10%
68 #define MIN_TOLERANCE_15 0.85 // -15%
69 #define MAX_TOLERANCE_15 1.15 // +15%
71 #define MIN_TOLERANCE_20 0.8 // -20%
72 #define MAX_TOLERANCE_20 1.2 // +20%
74 #define MIN_TOLERANCE_30 0.7 // -30%
75 #define MAX_TOLERANCE_30 1.3 // +30%
77 #define MIN_TOLERANCE_40 0.6 // -40%
78 #define MAX_TOLERANCE_40 1.4 // +40%
80 #define MIN_TOLERANCE_50 0.5 // -50%
81 #define MAX_TOLERANCE_50 1.5 // +50%
83 #define MIN_TOLERANCE_60 0.4 // -60%
84 #define MAX_TOLERANCE_60 1.6 // +60%
86 #define MIN_TOLERANCE_70 0.3 // -70%
87 #define MAX_TOLERANCE_70 1.7 // +70%
89 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
90 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
91 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
92 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
93 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
94 #else // only 5% + 1 to avoid conflict with RC6:
95 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
97 #define SIRCS_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
98 #define SIRCS_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
99 #define SIRCS_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
100 #define SIRCS_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
101 #define SIRCS_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
102 #define SIRCS_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
104 #define NEC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
105 #define NEC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
106 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
107 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
108 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
109 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
110 #define NEC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
111 #define NEC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
112 #define NEC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 // autodetect nec repetition frame within 50 msec:
117 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
119 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
121 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
124 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
125 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
126 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
127 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
128 #define SAMSUNG_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
129 #define SAMSUNG_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
130 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
131 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
132 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
133 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
135 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
136 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
137 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
138 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
139 #define MATSUSHITA_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
140 #define MATSUSHITA_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
141 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
142 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
143 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
144 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
146 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
147 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
148 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
149 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
150 #define KASEIKYO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
151 #define KASEIKYO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
152 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
153 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
154 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
155 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
157 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
158 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
159 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
160 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
161 #define RECS80_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
162 #define RECS80_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
163 #define RECS80_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
164 #define RECS80_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
165 #define RECS80_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define RECS80_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
169 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
170 #define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
171 #define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
173 #define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
174 #define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
177 #define RC5_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
178 #define RC5_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
180 #define DENON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
181 #define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
182 #define DENON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
183 #define DENON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
184 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
185 #define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
186 #define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
187 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
189 #define THOMSON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
190 #define THOMSON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define THOMSON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
192 #define THOMSON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
193 #define THOMSON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define THOMSON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
196 #define RC6_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
197 #define RC6_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
198 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define RC6_TOGGLE_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
201 #define RC6_TOGGLE_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define RC6_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
203 #define RC6_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
204 #define RC6_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
205 #define RC6_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
207 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
208 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
209 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
210 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
211 #define RECS80EXT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
212 #define RECS80EXT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
213 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
214 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
215 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
218 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
219 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
220 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
221 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
222 #define NUBERT_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
223 #define NUBERT_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
224 #define NUBERT_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
225 #define NUBERT_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
226 #define NUBERT_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
227 #define NUBERT_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
228 #define NUBERT_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
229 #define NUBERT_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
231 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
232 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
233 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
234 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
235 #define SPEAKER_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
236 #define SPEAKER_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
237 #define SPEAKER_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
238 #define SPEAKER_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
239 #define SPEAKER_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
240 #define SPEAKER_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
241 #define SPEAKER_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
242 #define SPEAKER_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
244 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
245 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
246 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
247 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
248 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
249 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
250 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
251 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
252 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
253 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
254 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
255 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX ((PAUSE_LEN)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) // value must be below IRMP_TIMEOUT
256 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
257 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
258 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
259 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
260 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
261 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
262 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
263 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
264 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
265 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
266 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
267 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
268 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
269 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
271 #define IR60_TIMEOUT_LEN ((uint8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
272 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
275 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
276 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
277 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
279 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
280 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
281 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
282 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
283 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
284 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
285 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
286 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
288 #define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
289 #define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
290 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
291 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
292 #define FDC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
293 #define FDC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
294 #define FDC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
295 #define FDC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
297 #define FDC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255
299 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
301 #define FDC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
303 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
304 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
305 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
306 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
307 #define RCCAR_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
308 #define RCCAR_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
309 #define RCCAR_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
310 #define RCCAR_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
311 #define RCCAR_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
312 #define RCCAR_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
314 #define JVC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
315 #define JVC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
316 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!
317 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!
318 #define JVC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
319 #define JVC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
320 #define JVC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
321 #define JVC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
322 #define JVC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
323 #define JVC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
324 // autodetect JVC repetition frame within 50 msec:
325 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
327 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
328 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
329 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
330 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
331 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
332 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
333 #define NIKON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
334 #define NIKON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
335 #define NIKON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
336 #define NIKON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
337 #define NIKON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
338 #define NIKON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
339 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
341 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
342 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
343 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
344 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
345 #define KATHREIN_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
346 #define KATHREIN_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
347 #define KATHREIN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
348 #define KATHREIN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
349 #define KATHREIN_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
350 #define KATHREIN_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
351 #define KATHREIN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
352 #define KATHREIN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
353 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
354 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
356 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
357 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
358 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
359 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
360 #define NETBOX_PULSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
361 #define NETBOX_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
362 #define NETBOX_PULSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
363 #define NETBOX_PAUSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
365 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
366 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
367 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
368 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
369 #define LEGO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
370 #define LEGO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
371 #define LEGO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
372 #define LEGO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
373 #define LEGO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
374 #define LEGO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
376 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
377 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
378 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
379 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
380 #define BOSE_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
381 #define BOSE_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
382 #define BOSE_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
383 #define BOSE_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
384 #define BOSE_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
385 #define BOSE_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
386 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
388 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
389 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
390 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
391 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
392 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
393 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
394 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
395 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
397 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
398 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
399 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
400 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
401 #define ORTEK_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
402 #define ORTEK_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
403 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
404 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
406 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
407 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
408 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
409 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
410 #define TELEFUNKEN_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
411 #define TELEFUNKEN_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
412 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
413 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
414 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
415 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
416 // autodetect TELEFUNKEN repetition frame within 50 msec:
417 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
419 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
420 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
421 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
422 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
423 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
424 #define ROOMBA_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
425 #define ROOMBA_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
426 #define ROOMBA_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
427 #define ROOMBA_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
428 #define ROOMBA_0_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
429 #define ROOMBA_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
430 #define ROOMBA_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
431 #define ROOMBA_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
432 #define ROOMBA_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
434 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
435 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
436 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
437 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
438 #define RCMM32_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
439 #define RCMM32_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
440 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
441 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
442 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
443 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
444 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
445 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
446 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
447 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
449 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
450 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
451 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
452 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
453 #define RADIO1_1_PAUSE_LEN_EXACT ((uint8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
454 #define RADIO1_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
455 #define RADIO1_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
456 #define RADIO1_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
457 #define RADIO1_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
458 #define RADIO1_0_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
459 #define RADIO1_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
460 #define RADIO1_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
461 #define RADIO1_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
462 #define RADIO1_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
464 #define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t!
467 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
468 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
469 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
470 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
471 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
473 static int time_counter
;
476 /******************************* not every PIC compiler knows variadic macros :-(
478 # define ANALYZE_PUTCHAR(a)
479 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
480 # define ANALYZE_PRINTF(...)
481 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
483 # define ANALYZE_NEWLINE()
484 *********************************/
487 #if IRMP_USE_CALLBACK == 1
488 static void (*irmp_callback_ptr
) (uint8_t);
489 #endif // IRMP_USE_CALLBACK == 1
491 #define PARITY_CHECK_OK 1
492 #define PARITY_CHECK_FAILED 0
494 /*---------------------------------------------------------------------------------------------------------------------------------------------------
496 *---------------------------------------------------------------------------------------------------------------------------------------------------
498 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
499 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
500 static const char proto_sircs
[] PROGMEM
= "SIRCS";
501 static const char proto_nec
[] PROGMEM
= "NEC";
502 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
503 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
504 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
505 static const char proto_recs80
[] PROGMEM
= "RECS80";
506 static const char proto_rc5
[] PROGMEM
= "RC5";
507 static const char proto_denon
[] PROGMEM
= "DENON";
508 static const char proto_rc6
[] PROGMEM
= "RC6";
509 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
510 static const char proto_apple
[] PROGMEM
= "APPLE";
511 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
512 static const char proto_nubert
[] PROGMEM
= "NUBERT";
513 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
514 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
515 static const char proto_nokia
[] PROGMEM
= "NOKIA";
516 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
517 static const char proto_fdc
[] PROGMEM
= "FDC";
518 static const char proto_rccar
[] PROGMEM
= "RCCAR";
519 static const char proto_jvc
[] PROGMEM
= "JVC";
520 static const char proto_rc6a
[] PROGMEM
= "RC6A";
521 static const char proto_nikon
[] PROGMEM
= "NIKON";
522 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
523 static const char proto_ir60
[] PROGMEM
= "IR60";
524 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
525 static const char proto_netbox
[] PROGMEM
= "NETBOX";
526 static const char proto_nec16
[] PROGMEM
= "NEC16";
527 static const char proto_nec42
[] PROGMEM
= "NEC42";
528 static const char proto_lego
[] PROGMEM
= "LEGO";
529 static const char proto_thomson
[] PROGMEM
= "THOMSON";
530 static const char proto_bose
[] PROGMEM
= "BOSE";
531 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
532 static const char proto_ortek
[] PROGMEM
= "ORTEK";
533 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
534 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
535 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
536 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
537 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
538 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
539 static const char proto_lgair
[] PROGMEM
= "LGAIR";
540 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
541 static const char proto_radio1
[] PROGMEM
= "RADIO1";
544 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
593 /*---------------------------------------------------------------------------------------------------------------------------------------------------
595 *---------------------------------------------------------------------------------------------------------------------------------------------------
597 #if IRMP_LOGGING == 1 // logging via UART
599 #if defined(ARM_STM32F4XX)
600 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // per UART2 an PA2
601 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
602 # define STM32_GPIO_PORT GPIOA
603 # define STM32_GPIO_PIN GPIO_Pin_2
604 # define STM32_GPIO_SOURCE GPIO_PinSource2
605 # define STM32_UART_AF GPIO_AF_USART2
606 # define STM32_UART_COM USART2
607 # define STM32_UART_BAUD 115200 // mit 115200 Baud
608 # include "stm32f4xx_usart.h"
610 # if IRMP_EXT_LOGGING == 1 // use external logging
611 # include "irmpextlog.h"
612 # else // normal UART log (IRMP_EXT_LOGGING == 0)
614 # ifndef UNIX_OR_WINDOWS
615 # include <util/setbaud.h>
620 #define UART0_UBRRH UBRR0H
621 #define UART0_UBRRL UBRR0L
622 #define UART0_UCSRA UCSR0A
623 #define UART0_UCSRB UCSR0B
624 #define UART0_UCSRC UCSR0C
625 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
626 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
627 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
629 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
631 #define UART0_URSEL_BIT_VALUE (0)
633 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
634 #define UART0_UDR UDR0
635 #define UART0_U2X U2X0
639 #define UART0_UBRRH UBRRH
640 #define UART0_UBRRL UBRRL
641 #define UART0_UCSRA UCSRA
642 #define UART0_UCSRB UCSRB
643 #define UART0_UCSRC UCSRC
644 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
645 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
646 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
648 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
650 #define UART0_URSEL_BIT_VALUE (0)
652 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
653 #define UART0_UDR UDR
654 #define UART0_U2X U2X
657 #endif //IRMP_EXT_LOGGING
658 #endif //ARM_STM32F4XX
660 /*---------------------------------------------------------------------------------------------------------------------------------------------------
662 * @details Initializes UART
663 *---------------------------------------------------------------------------------------------------------------------------------------------------
666 irmp_uart_init (void)
668 #ifndef UNIX_OR_WINDOWS
669 #if defined(ARM_STM32F4XX)
670 GPIO_InitTypeDef GPIO_InitStructure
;
671 USART_InitTypeDef USART_InitStructure
;
673 // Clock enable vom TX Pin
674 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
676 // Clock enable der UART
677 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
679 // UART Alternative-Funktion mit dem IO-Pin verbinden
680 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
682 // UART als Alternative-Funktion mit PushPull
683 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
684 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
685 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
686 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
689 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
690 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
693 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
695 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
696 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
697 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
698 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
699 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
700 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
701 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
702 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
705 USART_Cmd(STM32_UART_COM
, ENABLE
);
708 #if (IRMP_EXT_LOGGING == 0) // use UART
709 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
710 UART0_UBRRL
= UBRRL_VALUE
;
713 UART0_UCSRA
|= (1<<UART0_U2X
);
715 UART0_UCSRA
&= ~(1<<UART0_U2X
);
718 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
719 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
720 #else // other log method
722 #endif //IRMP_EXT_LOGGING
723 #endif //ARM_STM32F4XX
724 #endif // UNIX_OR_WINDOWS
727 /*---------------------------------------------------------------------------------------------------------------------------------------------------
729 * @details Sends character
730 * @param ch character to be transmitted
731 *---------------------------------------------------------------------------------------------------------------------------------------------------
734 irmp_uart_putc (unsigned char ch
)
736 #ifndef UNIX_OR_WINDOWS
737 #if defined(ARM_STM32F4XX)
738 // warten bis altes Byte gesendet wurde
739 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
744 USART_SendData(STM32_UART_COM
, ch
);
748 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
749 USART_SendData(STM32_UART_COM
, '\r');
753 #if (IRMP_EXT_LOGGING == 0)
755 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
764 sendextlog(ch
); // use external log
766 #endif //IRMP_EXT_LOGGING
767 #endif //ARM_STM32F4XX
770 #endif // UNIX_OR_WINDOWS
773 /*---------------------------------------------------------------------------------------------------------------------------------------------------
775 *---------------------------------------------------------------------------------------------------------------------------------------------------
778 #define STARTCYCLES 2 // min count of zeros before start of logging
779 #define ENDBITS 1000 // number of sequenced highbits to detect end
780 #define DATALEN 700 // log buffer size
783 irmp_log (uint8_t val
)
785 static uint8_t buf
[DATALEN
]; // logging buffer
786 static uint16_t buf_idx
; // index
787 static uint8_t startcycles
; // current number of start-zeros
788 static uint16_t cnt
; // counts sequenced highbits - to detect end
789 static uint8_t last_val
= 1;
791 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
799 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
805 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
806 { // if stop condition is true, output on uart
813 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
815 irmp_uart_putc ('0'); // the ignored starting zeros
818 for (i
= 0; i
< buf_idx
; i
++)
827 d
|= ((uint16_t) buf
[i
] << 8);
830 for (j
= 0; j
< d
; j
++)
835 v
= (v
== '1') ? '0' : '1';
838 for (i8
= 0; i8
< 20; i8
++)
840 irmp_uart_putc ('1');
843 irmp_uart_putc ('\n');
849 else if (buf_idx
< DATALEN
- 3)
853 buf
[buf_idx
++] = 0xff;
854 buf
[buf_idx
++] = (cnt
& 0xff);
855 buf
[buf_idx
] = (cnt
>> 8);
871 #define irmp_log(val)
872 #endif //IRMP_LOGGING
876 uint8_t protocol
; // ir protocol
877 uint8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
878 uint8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
879 uint8_t pause_1_len_min
; // minimum length of pause with bit value 1
880 uint8_t pause_1_len_max
; // maximum length of pause with bit value 1
881 uint8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
882 uint8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
883 uint8_t pause_0_len_min
; // minimum length of pause with bit value 0
884 uint8_t pause_0_len_max
; // maximum length of pause with bit value 0
885 uint8_t address_offset
; // address offset
886 uint8_t address_end
; // end of address
887 uint8_t command_offset
; // command offset
888 uint8_t command_end
; // end of command
889 uint8_t complete_len
; // complete length of frame
890 uint8_t stop_bit
; // flag: frame has stop bit
891 uint8_t lsb_first
; // flag: LSB first
892 uint8_t flags
; // some flags
895 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
897 static const PROGMEM IRMP_PARAMETER sircs_param
=
899 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
900 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
901 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
902 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
903 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
904 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
905 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
906 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
907 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
908 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
909 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
910 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
911 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
912 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
913 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
914 SIRCS_LSB
, // lsb_first: flag: LSB first
915 SIRCS_FLAGS
// flags: some flags
920 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
922 static const PROGMEM IRMP_PARAMETER nec_param
=
924 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
925 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
926 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
927 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
928 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
929 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
930 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
931 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
932 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
933 NEC_ADDRESS_OFFSET
, // address_offset: address offset
934 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
935 NEC_COMMAND_OFFSET
, // command_offset: command offset
936 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
937 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
938 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
939 NEC_LSB
, // lsb_first: flag: LSB first
940 NEC_FLAGS
// flags: some flags
943 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
945 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
946 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
947 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
948 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
949 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
950 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
951 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
952 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
953 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
954 0, // address_offset: address offset
955 0, // address_end: end of address
956 0, // command_offset: command offset
957 0, // command_end: end of command
958 0, // complete_len: complete length of frame
959 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
960 NEC_LSB
, // lsb_first: flag: LSB first
961 NEC_FLAGS
// flags: some flags
966 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
968 static const PROGMEM IRMP_PARAMETER nec42_param
=
970 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
971 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
972 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
973 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
974 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
975 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
976 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
977 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
978 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
979 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
980 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
981 NEC42_COMMAND_OFFSET
, // command_offset: command offset
982 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
983 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
984 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
985 NEC_LSB
, // lsb_first: flag: LSB first
986 NEC_FLAGS
// flags: some flags
991 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
993 static const PROGMEM IRMP_PARAMETER lgair_param
=
995 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
996 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
997 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
998 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
999 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1000 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1001 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1002 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1003 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1004 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1005 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1006 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1007 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1008 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1009 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1010 NEC_LSB
, // lsb_first: flag: LSB first
1011 NEC_FLAGS
// flags: some flags
1016 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1018 static const PROGMEM IRMP_PARAMETER samsung_param
=
1020 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1021 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1022 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1023 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1024 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1025 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1026 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1027 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1028 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1029 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1030 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1031 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1032 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1033 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1034 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1035 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1036 SAMSUNG_FLAGS
// flags: some flags
1041 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1043 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1045 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1046 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1047 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1048 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1049 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1050 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1051 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1052 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1053 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1054 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1055 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1056 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1057 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1058 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1059 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1060 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1061 TELEFUNKEN_FLAGS
// flags: some flags
1066 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1068 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1070 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1071 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1072 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1073 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1074 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1075 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1076 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1077 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1078 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1079 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1080 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1081 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1082 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1083 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1084 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1085 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1086 MATSUSHITA_FLAGS
// flags: some flags
1091 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1093 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1095 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1096 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1097 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1098 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1099 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1100 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1101 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1102 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1103 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1104 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1105 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1106 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1107 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1108 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1109 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1110 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1111 KASEIKYO_FLAGS
// flags: some flags
1116 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1118 static const PROGMEM IRMP_PARAMETER recs80_param
=
1120 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1121 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1122 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1123 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1124 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1125 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1126 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1127 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1128 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1129 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1130 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1131 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1132 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1133 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1134 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1135 RECS80_LSB
, // lsb_first: flag: LSB first
1136 RECS80_FLAGS
// flags: some flags
1141 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1143 static const PROGMEM IRMP_PARAMETER rc5_param
=
1145 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1146 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1147 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1148 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1149 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1150 0, // pulse_0_len_min: here: not used
1151 0, // pulse_0_len_max: here: not used
1152 0, // pause_0_len_min: here: not used
1153 0, // pause_0_len_max: here: not used
1154 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1155 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1156 RC5_COMMAND_OFFSET
, // command_offset: command offset
1157 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1158 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1159 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1160 RC5_LSB
, // lsb_first: flag: LSB first
1161 RC5_FLAGS
// flags: some flags
1166 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1168 static const PROGMEM IRMP_PARAMETER denon_param
=
1170 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1171 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1172 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1173 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1174 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1175 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1176 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1177 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1178 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1179 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1180 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1181 DENON_COMMAND_OFFSET
, // command_offset: command offset
1182 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1183 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1184 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1185 DENON_LSB
, // lsb_first: flag: LSB first
1186 DENON_FLAGS
// flags: some flags
1191 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1193 static const PROGMEM IRMP_PARAMETER rc6_param
=
1195 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1197 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1198 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1199 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1200 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1201 0, // pulse_0_len_min: here: not used
1202 0, // pulse_0_len_max: here: not used
1203 0, // pause_0_len_min: here: not used
1204 0, // pause_0_len_max: here: not used
1205 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1206 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1207 RC6_COMMAND_OFFSET
, // command_offset: command offset
1208 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1209 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1210 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1211 RC6_LSB
, // lsb_first: flag: LSB first
1212 RC6_FLAGS
// flags: some flags
1217 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1219 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1221 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1222 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1223 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1224 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1225 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1226 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1227 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1228 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1229 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1230 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1231 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1232 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1233 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1234 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1235 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1236 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1237 RECS80EXT_FLAGS
// flags: some flags
1242 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1244 static const PROGMEM IRMP_PARAMETER nubert_param
=
1246 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1247 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1248 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1249 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1250 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1251 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1252 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1253 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1254 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1255 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1256 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1257 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1258 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1259 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1260 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1261 NUBERT_LSB
, // lsb_first: flag: LSB first
1262 NUBERT_FLAGS
// flags: some flags
1267 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1269 static const PROGMEM IRMP_PARAMETER speaker_param
=
1271 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1272 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1273 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1274 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1275 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1276 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1277 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1278 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1279 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1280 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1281 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1282 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1283 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1284 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1285 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1286 SPEAKER_LSB
, // lsb_first: flag: LSB first
1287 SPEAKER_FLAGS
// flags: some flags
1292 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1294 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1296 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1297 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1298 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1299 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1300 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1301 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1302 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1303 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1304 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1305 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1306 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1307 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1308 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1309 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1310 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1311 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1312 BANG_OLUFSEN_FLAGS
// flags: some flags
1317 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1319 static uint8_t first_bit
;
1321 static const PROGMEM IRMP_PARAMETER grundig_param
=
1323 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1325 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1326 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1327 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1328 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1329 0, // pulse_0_len_min: here: not used
1330 0, // pulse_0_len_max: here: not used
1331 0, // pause_0_len_min: here: not used
1332 0, // pause_0_len_max: here: not used
1333 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1334 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1335 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1336 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1337 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1338 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1339 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1340 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1345 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1347 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1349 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1350 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1351 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1352 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1353 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1354 0, // pulse_0_len_min: here: not used
1355 0, // pulse_0_len_max: here: not used
1356 0, // pause_0_len_min: here: not used
1357 0, // pause_0_len_max: here: not used
1358 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1359 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1360 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1361 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1362 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1363 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1364 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1365 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1370 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1372 static const PROGMEM IRMP_PARAMETER fdc_param
=
1374 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1375 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1376 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1377 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1378 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1379 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1380 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1381 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1382 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1383 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1384 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1385 FDC_COMMAND_OFFSET
, // command_offset: command offset
1386 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1387 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1388 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1389 FDC_LSB
, // lsb_first: flag: LSB first
1390 FDC_FLAGS
// flags: some flags
1395 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1397 static const PROGMEM IRMP_PARAMETER rccar_param
=
1399 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1400 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1401 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1402 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1403 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1404 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1405 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1406 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1407 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1408 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1409 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1410 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1411 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1412 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1413 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1414 RCCAR_LSB
, // lsb_first: flag: LSB first
1415 RCCAR_FLAGS
// flags: some flags
1420 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1422 static const PROGMEM IRMP_PARAMETER nikon_param
=
1424 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1425 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1426 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1427 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1428 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1429 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1430 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1431 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1432 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1433 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1434 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1435 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1436 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1437 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1438 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1439 NIKON_LSB
, // lsb_first: flag: LSB first
1440 NIKON_FLAGS
// flags: some flags
1445 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1447 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1449 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1450 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1451 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1452 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1453 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1454 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1455 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1456 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1457 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1458 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1459 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1460 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1461 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1462 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1463 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1464 KATHREIN_LSB
, // lsb_first: flag: LSB first
1465 KATHREIN_FLAGS
// flags: some flags
1470 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1472 static const PROGMEM IRMP_PARAMETER netbox_param
=
1474 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1475 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1476 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1477 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1478 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1479 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1480 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1481 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1482 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1483 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1484 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1485 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1486 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1487 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1488 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1489 NETBOX_LSB
, // lsb_first: flag: LSB first
1490 NETBOX_FLAGS
// flags: some flags
1495 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1497 static const PROGMEM IRMP_PARAMETER lego_param
=
1499 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1500 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1501 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1502 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1503 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1504 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1505 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1506 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1507 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1508 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1509 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1510 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1511 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1512 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1513 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1514 LEGO_LSB
, // lsb_first: flag: LSB first
1515 LEGO_FLAGS
// flags: some flags
1520 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1522 static const PROGMEM IRMP_PARAMETER thomson_param
=
1524 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1525 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1526 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1527 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1528 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1529 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1530 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1531 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1532 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1533 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1534 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1535 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1536 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1537 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1538 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1539 THOMSON_LSB
, // lsb_first: flag: LSB first
1540 THOMSON_FLAGS
// flags: some flags
1545 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1547 static const PROGMEM IRMP_PARAMETER bose_param
=
1549 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1550 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1551 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1552 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1553 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1554 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1555 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1556 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1557 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1558 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1559 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1560 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1561 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1562 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1563 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1564 BOSE_LSB
, // lsb_first: flag: LSB first
1565 BOSE_FLAGS
// flags: some flags
1570 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1572 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1574 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1576 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1577 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1578 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1579 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1580 0, // pulse_0_len_min: here: not used
1581 0, // pulse_0_len_max: here: not used
1582 0, // pause_0_len_min: here: not used
1583 0, // pause_0_len_max: here: not used
1584 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1585 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1586 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1587 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1588 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1589 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1590 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1591 A1TVBOX_FLAGS
// flags: some flags
1596 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1598 static const PROGMEM IRMP_PARAMETER ortek_param
=
1600 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1602 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1603 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1604 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1605 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1606 0, // pulse_0_len_min: here: not used
1607 0, // pulse_0_len_max: here: not used
1608 0, // pause_0_len_min: here: not used
1609 0, // pause_0_len_max: here: not used
1610 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1611 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1612 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1613 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1614 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1615 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1616 ORTEK_LSB
, // lsb_first: flag: LSB first
1617 ORTEK_FLAGS
// flags: some flags
1622 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1624 static const PROGMEM IRMP_PARAMETER roomba_param
=
1626 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1627 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1628 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1629 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1630 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1631 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1632 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1633 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1634 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1635 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1636 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1637 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1638 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1639 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1640 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1641 ROOMBA_LSB
, // lsb_first: flag: LSB first
1642 ROOMBA_FLAGS
// flags: some flags
1647 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1649 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1651 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1653 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1654 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1655 0, // pause_1_len_min: here: minimum length of short pause
1656 0, // pause_1_len_max: here: maximum length of short pause
1657 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1658 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1659 0, // pause_0_len_min: here: not used
1660 0, // pause_0_len_max: here: not used
1661 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1662 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1663 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1664 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1665 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1666 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1667 RCMM32_LSB
, // lsb_first: flag: LSB first
1668 RCMM32_FLAGS
// flags: some flags
1673 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
1675 static const PROGMEM IRMP_PARAMETER radio1_param
=
1677 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
1679 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1680 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1681 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1682 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1683 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1684 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1685 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1686 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1687 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
1688 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
1689 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
1690 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
1691 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1692 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
1693 RADIO1_LSB
, // lsb_first: flag: LSB first
1694 RADIO1_FLAGS
// flags: some flags
1699 static uint8_t irmp_bit
; // current bit position
1700 static IRMP_PARAMETER irmp_param
;
1702 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1703 static IRMP_PARAMETER irmp_param2
;
1706 static volatile uint8_t irmp_ir_detected
;
1707 static volatile uint8_t irmp_protocol
;
1708 static volatile uint16_t irmp_address
;
1709 static volatile uint16_t irmp_command
;
1710 static volatile uint16_t irmp_id
; // only used for SAMSUNG protocol
1711 static volatile uint8_t irmp_flags
;
1712 // static volatile uint8_t irmp_busy_flag;
1715 #define input(x) (x)
1716 static uint8_t IRMP_PIN
;
1717 static uint8_t radio
;
1720 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1721 * Initialize IRMP decoder
1722 * @details Configures IRMP input pin
1723 *---------------------------------------------------------------------------------------------------------------------------------------------------
1729 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
1730 #elif defined (ARM_STM32) // STM32
1731 GPIO_InitTypeDef GPIO_InitStructure
;
1733 /* GPIOx clock enable */
1734 #if defined (ARM_STM32L1XX)
1735 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1736 #elif defined (ARM_STM32F10X)
1737 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1738 #elif defined (ARM_STM32F4XX)
1739 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1742 /* GPIO Configuration */
1743 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
1744 #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
1745 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
1746 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1747 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
1748 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
1749 #elif defined (ARM_STM32F10X)
1750 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1751 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
1753 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
1754 #elif defined(STELLARIS_ARM_CORTEX_M4)
1755 // Enable the GPIO port
1756 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
1759 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
1760 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
,
1762 GPIO_PIN_TYPE_STD_WPU
);
1764 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
1765 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
1768 #if IRMP_LOGGING == 1
1773 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1775 * @details gets decoded IRMP data
1776 * @param pointer in order to store IRMP data
1777 * @return TRUE: successful, FALSE: failed
1778 *---------------------------------------------------------------------------------------------------------------------------------------------------
1781 irmp_get_data (IRMP_DATA
* irmp_data_p
)
1783 uint8_t rtc
= FALSE
;
1785 if (irmp_ir_detected
)
1787 switch (irmp_protocol
)
1789 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1790 case IRMP_SAMSUNG_PROTOCOL
:
1791 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1793 irmp_command
&= 0xff;
1794 irmp_command
|= irmp_id
<< 8;
1799 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
1800 case IRMP_SAMSUNG48_PROTOCOL
:
1801 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
1807 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1808 case IRMP_NEC_PROTOCOL
:
1809 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1811 irmp_command
&= 0xff;
1814 else if (irmp_address
== 0x87EE)
1817 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
1819 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
1820 irmp_address
= (irmp_command
& 0xFF00) >> 8;
1821 irmp_command
&= 0x00FF;
1826 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1827 case IRMP_BOSE_PROTOCOL
:
1828 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1830 irmp_command
&= 0xff;
1835 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1836 case IRMP_SIEMENS_PROTOCOL
:
1837 case IRMP_RUWIDO_PROTOCOL
:
1838 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
1845 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1846 case IRMP_KATHREIN_PROTOCOL
:
1847 if (irmp_command
!= 0x0000)
1853 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1854 case IRMP_RC5_PROTOCOL
:
1855 irmp_address
&= ~0x20; // clear toggle bit
1859 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
1860 case IRMP_IR60_PROTOCOL
:
1861 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
1868 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
1873 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1874 case IRMP_RCCAR_PROTOCOL
:
1875 // frame in irmp_data:
1876 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
1877 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
1878 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
1879 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
1880 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
1881 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
1882 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
1886 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
1887 case IRMP_NETBOX_PROTOCOL
:
1888 if (irmp_command
& 0x1000) // last bit set?
1890 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
1893 irmp_command
&= 0x7F;
1896 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
1899 irmp_command
|= 0x80;
1905 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
1912 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
1917 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1918 case IRMP_LEGO_PROTOCOL
:
1920 uint8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
1922 if ((irmp_command
& 0x000F) == crc
)
1930 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
1932 // rtc = TRUE; // don't accept codes with CRC errors
1947 irmp_data_p
->protocol
= irmp_protocol
;
1948 irmp_data_p
->address
= irmp_address
;
1949 irmp_data_p
->command
= irmp_command
;
1950 irmp_data_p
->flags
= irmp_flags
;
1956 irmp_ir_detected
= FALSE
;
1963 // irmp_is_busy (void)
1965 // return irmp_busy_flag;
1968 #if IRMP_USE_CALLBACK == 1
1970 irmp_set_callback_ptr (void (*cb
)(uint8_t))
1972 irmp_callback_ptr
= cb
;
1974 #endif // IRMP_USE_CALLBACK == 1
1976 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
1977 static uint16_t irmp_tmp_address
; // ir address
1978 static uint16_t irmp_tmp_command
; // ir command
1980 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
1981 static uint16_t irmp_tmp_address2
; // ir address
1982 static uint16_t irmp_tmp_command2
; // ir command
1985 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1986 static uint16_t irmp_lgair_address
; // ir address
1987 static uint16_t irmp_lgair_command
; // ir command
1990 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1991 static uint16_t irmp_tmp_id
; // ir id (only SAMSUNG)
1993 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1994 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
1995 static uint8_t genre2
; // save genre2 bits here, later copied to MSB in flags
1998 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1999 static uint8_t parity
; // number of '1' of the first 14 bits, check if even.
2002 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2004 * @details store bit in temp address or temp command
2005 * @param value to store: 0 or 1
2006 *---------------------------------------------------------------------------------------------------------------------------------------------------
2008 // verhindert, dass irmp_store_bit() inline compiliert wird:
2009 // static void irmp_store_bit (uint8_t) __attribute__ ((noinline));
2012 irmp_store_bit (uint8_t value
)
2014 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2015 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2024 else if (irmp_bit
== 14)
2026 if (value
) // value == 1: even parity
2030 parity
= PARITY_CHECK_FAILED
;
2034 parity
= PARITY_CHECK_OK
;
2039 if (parity
& 0x01) // value == 0: odd parity
2041 parity
= PARITY_CHECK_OK
;
2045 parity
= PARITY_CHECK_FAILED
;
2052 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2053 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2060 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2062 if (irmp_param
.lsb_first
)
2064 irmp_tmp_address
|= (((uint16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2068 irmp_tmp_address
<<= 1;
2069 irmp_tmp_address
|= value
;
2072 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2074 if (irmp_param
.lsb_first
)
2076 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2077 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2079 irmp_tmp_id
|= (((uint16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2084 irmp_tmp_command
|= (((uint16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2089 irmp_tmp_command
<<= 1;
2090 irmp_tmp_command
|= value
;
2094 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2095 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2099 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2100 irmp_lgair_address
|= value
;
2102 else if (irmp_bit
< 24)
2104 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2105 irmp_lgair_command
|= value
;
2111 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2112 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2114 irmp_tmp_address2
|= (((uint16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2119 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2120 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2122 irmp_tmp_id
|= (((uint16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2127 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2128 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2130 if (irmp_bit
>= 20 && irmp_bit
< 24)
2132 irmp_tmp_command
|= (((uint16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2134 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2136 genre2
|= (((uint8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2139 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2143 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2147 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2160 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2162 * @details store bit in temp address or temp command
2163 * @param value to store: 0 or 1
2164 *---------------------------------------------------------------------------------------------------------------------------------------------------
2166 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2168 irmp_store_bit2 (uint8_t value
)
2172 if (irmp_param
.protocol
)
2174 irmp_bit2
= irmp_bit
- 2;
2178 irmp_bit2
= irmp_bit
- 1;
2181 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2183 irmp_tmp_address2
|= (((uint16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2185 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2187 irmp_tmp_command2
|= (((uint16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2190 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2192 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2194 * @details ISR routine, called 10000 times per second
2195 *---------------------------------------------------------------------------------------------------------------------------------------------------
2200 static uint8_t irmp_start_bit_detected
; // flag: start bit detected
2201 static uint8_t wait_for_space
; // flag: wait for data bit space
2202 static uint8_t wait_for_start_space
; // flag: wait for start bit space
2203 static uint8_t irmp_pulse_time
; // count bit time for pulse
2204 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2205 static uint16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2206 static uint16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2207 static uint16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2208 static uint8_t repetition_frame_number
;
2209 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2210 static uint16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2211 static uint16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2213 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2214 static uint8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2216 #if IRMP_SUPPORT_MANCHESTER == 1
2217 static PAUSE_LEN last_pause
; // last pause value
2219 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2220 static uint8_t last_value
; // last bit value
2222 uint8_t irmp_input
; // input value
2228 irmp_input
= input(IRMP_PIN
);
2230 #if IRMP_USE_CALLBACK == 1
2231 if (irmp_callback_ptr
)
2233 static uint8_t last_inverted_input
;
2235 if (last_inverted_input
!= !irmp_input
)
2237 (*irmp_callback_ptr
) (! irmp_input
);
2238 last_inverted_input
= !irmp_input
;
2241 #endif // IRMP_USE_CALLBACK == 1
2243 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2245 if (! irmp_ir_detected
) // ir code already detected?
2247 if (! irmp_start_bit_detected
) // start bit detected?
2249 if (! irmp_input
) // receiving burst?
2251 // irmp_busy_flag = TRUE;
2253 if (! irmp_pulse_time
)
2255 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2258 irmp_pulse_time
++; // increment counter
2262 if (irmp_pulse_time
) // it's dark....
2263 { // set flags for counting the time of darkness...
2264 irmp_start_bit_detected
= 1;
2265 wait_for_start_space
= 1;
2267 irmp_tmp_command
= 0;
2268 irmp_tmp_address
= 0;
2269 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2272 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2276 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2277 irmp_tmp_command2
= 0;
2278 irmp_tmp_address2
= 0;
2280 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2281 irmp_lgair_command
= 0;
2282 irmp_lgair_address
= 0;
2285 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2286 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2287 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2292 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2294 key_repetition_len
++;
2296 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2297 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2299 denon_repetition_len
++;
2301 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2304 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2305 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2307 last_irmp_denon_command
= 0;
2308 denon_repetition_len
= 0xFFFF;
2311 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2318 if (wait_for_start_space
) // we have received start bit...
2319 { // ...and are counting the time of darkness
2320 if (irmp_input
) // still dark?
2322 irmp_pause_time
++; // increment counter
2324 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2325 if (((irmp_pulse_time
< NIKON_START_BIT_PULSE_LEN_MIN
|| irmp_pulse_time
> NIKON_START_BIT_PULSE_LEN_MAX
) && irmp_pause_time
> IRMP_TIMEOUT_LEN
) ||
2326 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2328 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2331 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2332 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2337 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2340 ANALYZE_PRINTF ("%8.3fms error 1: pause after start bit pulse %d too long: %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2341 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2345 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2346 irmp_pulse_time
= 0;
2347 irmp_pause_time
= 0;
2351 { // receiving first data pulse!
2352 IRMP_PARAMETER
* irmp_param_p
= (IRMP_PARAMETER
*) 0;
2354 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2355 irmp_param2
.protocol
= 0;
2359 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2362 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2363 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2364 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2367 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2368 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2369 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2371 irmp_param_p
= (IRMP_PARAMETER
*) (IRMP_PARAMETER
*) &sircs_param
;
2374 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2376 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2377 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2378 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2379 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2382 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2383 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2384 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2386 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2389 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2391 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2392 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2393 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2395 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2397 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2398 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2399 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2401 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2404 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2405 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2406 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2408 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2411 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2412 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2414 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2415 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2416 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2418 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2419 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2420 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2422 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2425 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2428 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2429 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2430 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2433 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2438 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2439 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2440 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2441 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2442 { // it's JVC repetition type 3
2444 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2445 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2446 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2448 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2451 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2453 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2455 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2456 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2457 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2460 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2461 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2462 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2464 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2467 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2469 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2470 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2471 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2474 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2475 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2476 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2478 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2481 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2483 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2484 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2485 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2488 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2489 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2490 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2492 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2495 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2497 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2498 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2499 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2502 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2503 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2504 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2506 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2509 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2511 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2512 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2513 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2514 { // it's MATSUSHITA
2516 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2517 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2518 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2520 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2523 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2525 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2526 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2527 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2530 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2531 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2532 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2534 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2537 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2539 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2540 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2541 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2544 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2545 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2546 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2548 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2551 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2553 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2554 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2555 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2558 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2559 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2560 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2562 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2565 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2567 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2568 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
2569 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
2570 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
2571 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
2573 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2574 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2575 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2578 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
2579 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2580 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2581 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2582 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2583 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2584 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2586 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
2589 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2591 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2592 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2593 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2596 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
2597 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2598 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2599 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2600 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2601 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2602 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2604 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
2607 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2610 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2611 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2612 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
2613 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2614 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
2618 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
2619 last_pause
= irmp_pause_time
;
2621 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
2622 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
2625 rc5_cmd_bit6
= 1<<6;
2633 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
2635 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2636 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
2637 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
2638 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
2641 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2642 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
2643 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
2644 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
2646 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
2649 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2651 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2652 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
2653 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
2654 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
2657 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2658 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
2659 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
2660 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
2662 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
2665 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2667 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2668 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
2669 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
2672 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2673 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
2674 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
2676 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
2679 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
2681 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2682 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
2683 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
2686 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2687 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
2688 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
2690 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
2695 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2697 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2698 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
2699 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
2702 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2703 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
2704 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
2706 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
2709 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2711 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2712 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
2713 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
2716 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2717 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
2718 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
2720 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
2723 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2725 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2726 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
2727 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
2730 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2731 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
2732 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
2734 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
2737 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2739 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2740 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
2741 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
2742 { // it's BANG_OLUFSEN
2744 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
2745 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2746 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
2747 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
2748 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2749 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
2750 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
2751 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2752 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
2753 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
2754 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2755 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
2756 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
2758 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
2762 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2764 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2765 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
2766 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
2769 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2770 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
2771 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
2773 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
2774 last_pause
= irmp_pause_time
;
2778 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2780 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2781 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
2782 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
2783 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
2784 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
2785 { // it's RUWIDO or SIEMENS
2787 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2788 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2789 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2790 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
2791 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
2793 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
2794 last_pause
= irmp_pause_time
;
2798 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2800 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2801 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2802 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2805 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2806 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2807 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2809 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
2812 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2814 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2815 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2816 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2819 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2820 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2821 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2823 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
2826 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2828 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2829 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
2830 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
2833 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2834 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
2835 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
2837 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
2840 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2842 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2843 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
2844 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
2847 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2848 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
2849 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
2851 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
2854 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2856 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2857 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
2858 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
2861 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2862 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
2863 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
2865 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
2868 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
2870 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2871 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
2872 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
2875 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2876 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
2877 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
2879 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
2884 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2886 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2887 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
2888 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
2889 { // it's ORTEK (Hama)
2891 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2892 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
2893 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
2895 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
2901 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2903 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
2904 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
2905 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
2908 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2909 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
2910 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
2912 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
2915 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
2918 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
2920 irmp_start_bit_detected
= 0; // wait for another start bit...
2923 if (irmp_start_bit_detected
)
2925 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
2927 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
2930 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
2931 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
2937 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
2938 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
2939 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
2940 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
2944 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2945 if (irmp_param2
.protocol
)
2948 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
2949 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
2950 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
2951 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
2957 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2958 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
2961 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
2966 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
2969 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
2970 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
2976 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
2977 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
2978 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
2979 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
2984 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2985 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
2987 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
2988 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
2992 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
2993 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
2994 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
2995 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3001 #if IRMP_SUPPORT_MANCHESTER == 1
3002 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3003 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3004 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3006 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3009 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3010 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3013 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3015 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3018 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3019 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3022 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3026 #endif // IRMP_SUPPORT_MANCHESTER == 1
3028 #if IRMP_SUPPORT_SERIAL == 1
3029 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3034 #endif // IRMP_SUPPORT_SERIAL == 1
3037 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3038 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3041 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3044 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3045 { // pause timings correct for "1"?
3047 ANALYZE_PUTCHAR ('1'); // yes, store 1
3052 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3053 { // pause timings correct for "0"?
3055 ANALYZE_PUTCHAR ('0'); // yes, store 0
3062 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3063 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3064 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3067 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3070 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3071 { // pause timings correct for "1"?
3073 ANALYZE_PUTCHAR ('1'); // yes, store 1
3078 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3079 { // pause timings correct for "0"?
3081 ANALYZE_PUTCHAR ('0'); // yes, store 0
3088 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3090 ; // else do nothing
3093 irmp_pulse_time
= 1; // set counter to 1, not 0
3094 irmp_pause_time
= 0;
3095 wait_for_start_space
= 0;
3098 else if (wait_for_space
) // the data section....
3099 { // counting the time of darkness....
3100 uint8_t got_light
= FALSE
;
3102 if (irmp_input
) // still dark?
3104 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3107 #if IRMP_SUPPORT_MANCHESTER == 1
3108 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3110 #if IRMP_SUPPORT_SERIAL == 1
3111 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3113 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3116 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3118 ANALYZE_PRINTF ("stop bit detected\n");
3121 irmp_param
.stop_bit
= 0;
3126 ANALYZE_PRINTF ("error: stop bit timing wrong, irmp_bit = %d, irmp_pulse_time = %d, pulse_0_len_min = %d, pulse_0_len_max = %d\n",
3127 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3129 irmp_start_bit_detected
= 0; // wait for another start bit...
3130 irmp_pulse_time
= 0;
3131 irmp_pause_time
= 0;
3136 irmp_pause_time
++; // increment counter
3138 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3139 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3140 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3141 irmp_bit
>= 12 - 1) // pause too long?
3142 { // yes, break and close this frame
3143 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3144 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3145 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3146 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3147 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3151 #if IRMP_SUPPORT_SERIAL == 1
3152 // NETBOX generates no stop bit, here is the timeout condition:
3153 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3154 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3156 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3160 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3161 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3163 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3166 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3168 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3169 irmp_param
.stop_bit
= TRUE
; // set flag
3171 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3172 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3173 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3174 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3175 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3176 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3178 irmp_tmp_command
<<= 1;
3179 irmp_tmp_command
|= first_bit
;
3181 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3182 { // special manchester decoder
3183 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3184 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3185 irmp_param
.stop_bit
= TRUE
; // set flag
3187 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3190 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");
3192 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3193 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3194 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3195 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3196 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3198 if (irmp_tmp_command
& 0x300)
3200 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3201 irmp_tmp_command
&= 0xFF;
3207 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3208 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3210 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3211 { // special manchester decoder
3212 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3213 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3214 irmp_param
.stop_bit
= TRUE
; // set flag
3216 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3219 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3221 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3222 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3223 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3224 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3225 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3228 // RUWIDO: AAAAAAAAACCCCCCCp
3229 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3230 irmp_tmp_address
<<= 2;
3231 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3232 irmp_tmp_command
&= 0x003F;
3233 // irmp_tmp_command <<= 4;
3234 irmp_tmp_command
|= last_value
;
3239 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3240 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3241 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3242 { // break and close this frame
3243 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3245 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3247 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3249 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3252 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3256 #if IRMP_SUPPORT_MANCHESTER == 1
3257 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3258 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3259 { // special manchester decoder
3260 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3261 irmp_param
.stop_bit
= TRUE
; // set flag
3264 #endif // IRMP_SUPPORT_MANCHESTER == 1
3265 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3267 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3271 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3272 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3275 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3277 irmp_param
.stop_bit
= TRUE
; // set flag
3278 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3279 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3280 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3281 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3282 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3284 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3285 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3286 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3289 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3291 irmp_param
.stop_bit
= TRUE
; // set flag
3292 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3293 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3294 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3295 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3296 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3298 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3300 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3301 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3302 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3305 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3307 irmp_param
.stop_bit
= TRUE
; // set flag
3308 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3309 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3311 // 0123456789ABC0123456789ABC0123456701234567
3312 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3313 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3314 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3315 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3317 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3318 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3319 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3322 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3324 irmp_param
.stop_bit
= TRUE
; // set flag
3325 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3326 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3327 irmp_tmp_address
= irmp_lgair_address
;
3328 irmp_tmp_command
= irmp_lgair_command
;
3330 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3331 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3332 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3335 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3337 irmp_param
.stop_bit
= TRUE
; // set flag
3338 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3339 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3341 // 0123456789ABC0123456789ABC0123456701234567
3342 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3343 // JVC: AAAACCCCCCCCCCCC
3344 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3345 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3347 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3348 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3350 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3351 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3354 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3356 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3357 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3358 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3359 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3361 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3363 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3364 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3368 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3369 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3372 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3374 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3376 else // if ((irmp_bit == 24)
3379 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3381 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3383 irmp_param
.stop_bit
= TRUE
; // set flag
3384 irmp_param
.complete_len
= irmp_bit
; // patch length
3386 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3390 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3391 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3393 irmp_start_bit_detected
= 0; // wait for another start bit...
3394 irmp_pulse_time
= 0;
3395 irmp_pause_time
= 0;
3408 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3411 #if IRMP_SUPPORT_MANCHESTER == 1
3412 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3415 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3416 #else // better, but some IR-RCs use asymmetric timings :-/
3417 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3418 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3421 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3422 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3425 ANALYZE_PUTCHAR ('T');
3427 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3442 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3445 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3447 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
3449 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3450 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3453 ANALYZE_PUTCHAR ('T');
3457 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
3470 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3473 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3475 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
3476 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3477 if (! irmp_param2
.protocol
)
3484 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
3488 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
3489 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
3491 uint8_t manchester_value
;
3493 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
3495 manchester_value
= last_value
? 0 : 1;
3496 last_value
= manchester_value
;
3500 manchester_value
= last_value
;
3504 ANALYZE_PUTCHAR (manchester_value
+ '0');
3507 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3508 if (! irmp_param2
.protocol
)
3516 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3517 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
3520 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
3522 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
3523 irmp_param
.address_offset
= 5;
3524 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
3525 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
3526 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
3527 irmp_tmp_address
= 0;
3529 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3531 irmp_store_bit (manchester_value
);
3535 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3536 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
3537 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
3538 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
3539 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
3542 ANALYZE_PUTCHAR ('?');
3544 irmp_param
.protocol
= 0; // switch to FDC, see below
3547 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3548 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3549 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
3550 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
3551 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
3552 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
3555 ANALYZE_PUTCHAR ('?');
3557 irmp_param
.protocol
= 0; // switch to RCCAR, see below
3560 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3563 ANALYZE_PUTCHAR ('?');
3565 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3566 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3568 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3569 irmp_pause_time
= 0;
3573 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3574 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
3576 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
3579 ANALYZE_PRINTF (" 1 (FDC)\n");
3581 irmp_store_bit2 (1);
3583 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
3586 ANALYZE_PRINTF (" 0 (FDC)\n");
3588 irmp_store_bit2 (0);
3591 if (! irmp_param
.protocol
)
3594 ANALYZE_PRINTF ("Switching to FDC protocol\n");
3596 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3597 irmp_param2
.protocol
= 0;
3598 irmp_tmp_address
= irmp_tmp_address2
;
3599 irmp_tmp_command
= irmp_tmp_command2
;
3602 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3603 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3604 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
3606 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
3609 ANALYZE_PRINTF (" 1 (RCCAR)\n");
3611 irmp_store_bit2 (1);
3613 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
3616 ANALYZE_PRINTF (" 0 (RCCAR)\n");
3618 irmp_store_bit2 (0);
3621 if (! irmp_param
.protocol
)
3624 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
3626 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3627 irmp_param2
.protocol
= 0;
3628 irmp_tmp_address
= irmp_tmp_address2
;
3629 irmp_tmp_command
= irmp_tmp_command2
;
3632 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3634 last_pause
= irmp_pause_time
;
3638 #endif // IRMP_SUPPORT_MANCHESTER == 1
3640 #if IRMP_SUPPORT_SERIAL == 1
3641 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3643 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
3646 ANALYZE_PUTCHAR ('1');
3650 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
3652 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
3656 irmp_pulse_time
= 0;
3660 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
3663 ANALYZE_PUTCHAR ('0');
3667 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
3669 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
3673 irmp_pause_time
= 0;
3682 #endif // IRMP_SUPPORT_SERIAL == 1
3684 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3685 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
3687 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
3688 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3691 ANALYZE_PRINTF ("SYNC\n");
3696 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
3698 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3700 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
3702 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
3703 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
3704 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
3705 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
3708 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
3710 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3711 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3712 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3713 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3715 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
3718 ANALYZE_PUTCHAR ('1');
3727 ANALYZE_PUTCHAR ('0');
3735 { // timing incorrect!
3737 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3738 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3740 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3741 irmp_pause_time
= 0;
3745 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
3747 #if IRMP_SUPPORT_NEC16_PROTOCOL
3748 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3749 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
3750 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
3751 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
3752 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3753 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
3756 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
3758 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
3759 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
3760 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
3761 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
3762 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
3763 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
3767 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
3769 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3770 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3772 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
3774 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
3776 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
3779 ANALYZE_PRINTF ("3rd start bit\n");
3785 { // timing incorrect!
3787 ANALYZE_PRINTF ("error 3a B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3788 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3790 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3791 irmp_pause_time
= 0;
3794 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
3796 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
3799 ANALYZE_PRINTF ("trailer bit\n");
3805 { // timing incorrect!
3807 ANALYZE_PRINTF ("error 3b B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3808 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3810 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3811 irmp_pause_time
= 0;
3816 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
3817 { // pulse & pause timings correct for "1"?
3819 ANALYZE_PUTCHAR ('1');
3826 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
3827 { // pulse & pause timings correct for "0"?
3829 ANALYZE_PUTCHAR ('0');
3836 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
3839 ANALYZE_PUTCHAR (last_value
+ '0');
3842 irmp_store_bit (last_value
);
3846 { // timing incorrect!
3848 ANALYZE_PRINTF ("error 3c B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3849 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3851 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3852 irmp_pause_time
= 0;
3857 { // timing incorrect!
3859 ANALYZE_PRINTF ("error 3d B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3860 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3862 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3863 irmp_pause_time
= 0;
3867 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
3869 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3870 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
3872 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
3875 ANALYZE_PUTCHAR ('0');
3876 ANALYZE_PUTCHAR ('0');
3881 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
3884 ANALYZE_PUTCHAR ('0');
3885 ANALYZE_PUTCHAR ('1');
3890 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
3893 ANALYZE_PUTCHAR ('1');
3894 ANALYZE_PUTCHAR ('0');
3899 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
3902 ANALYZE_PUTCHAR ('1');
3903 ANALYZE_PUTCHAR ('1');
3909 ANALYZE_PRINTF ("\n");
3916 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
3917 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
3918 { // pulse & pause timings correct for "1"?
3920 ANALYZE_PUTCHAR ('1');
3926 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
3927 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
3928 { // pulse & pause timings correct for "0"?
3930 ANALYZE_PUTCHAR ('0');
3937 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
3939 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
3940 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
3941 (((irmp_bit
== 8 || irmp_bit
== 6) &&
3942 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
3944 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
3951 ANALYZE_PUTCHAR ('S');
3954 irmp_tmp_command
<<= 1;
3959 ANALYZE_PUTCHAR ('S');
3967 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
3968 { // timing incorrect!
3970 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3971 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3973 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3974 irmp_pause_time
= 0;
3977 irmp_pulse_time
= 1; // set counter to 1, not 0
3981 { // counting the pulse length ...
3982 if (! irmp_input
) // still light?
3984 irmp_pulse_time
++; // increment counter
3988 wait_for_space
= 1; // let's count the time (see above)
3989 irmp_pause_time
= 1; // set pause counter to 1, not 0
3993 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
3995 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
3997 repetition_frame_number
++;
4001 repetition_frame_number
= 0;
4004 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4005 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4006 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4009 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4010 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4012 key_repetition_len
= 0;
4017 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4018 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4019 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4022 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4023 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4025 key_repetition_len
= 0;
4030 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4031 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4032 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4035 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4036 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4038 key_repetition_len
= 0;
4043 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4044 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4045 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4048 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4049 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4051 key_repetition_len
= 0;
4056 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4057 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4058 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4061 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4062 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4064 key_repetition_len
= 0;
4069 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4070 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4071 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4074 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4075 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4077 key_repetition_len
= 0;
4084 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4086 irmp_ir_detected
= TRUE
;
4088 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4089 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4090 { // check for repetition frame
4091 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4093 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4094 last_irmp_denon_command
= 0;
4096 irmp_protocol
= irmp_param
.protocol
; // store protocol
4097 irmp_address
= irmp_tmp_address
; // store address
4098 irmp_command
= irmp_tmp_command
; // store command
4102 if ((irmp_tmp_command
& 0x01) == 0x00)
4105 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4107 last_irmp_denon_command
= irmp_tmp_command
;
4108 denon_repetition_len
= 0;
4109 irmp_ir_detected
= FALSE
;
4114 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4116 last_irmp_denon_command
= 0;
4117 irmp_ir_detected
= FALSE
;
4122 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4124 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4125 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4126 { // Grundig start frame?
4128 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4130 irmp_ir_detected
= FALSE
;
4133 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4135 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4136 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4137 { // Nokia start frame?
4139 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4141 irmp_ir_detected
= FALSE
;
4144 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4146 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4147 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4149 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4152 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4153 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4155 irmp_tmp_address
= last_irmp_address
; // address is last address
4156 irmp_tmp_command
= last_irmp_command
; // command is last command
4157 irmp_flags
|= IRMP_FLAG_REPETITION
;
4158 key_repetition_len
= 0;
4163 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4164 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4166 irmp_ir_detected
= FALSE
;
4169 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4171 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4172 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4176 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4178 if (xor_value
!= (xor_check
[2] & 0x0F))
4181 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4183 irmp_ir_detected
= FALSE
;
4186 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4188 if (xor_value
!= xor_check
[5])
4191 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4193 irmp_ir_detected
= FALSE
;
4196 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4198 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4200 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4201 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4203 if (parity
== PARITY_CHECK_FAILED
)
4206 ANALYZE_PRINTF ("error 6: parity check failed\n");
4208 irmp_ir_detected
= FALSE
;
4211 if ((irmp_tmp_address
& 0x03) == 0x02)
4214 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4216 irmp_ir_detected
= FALSE
;
4218 irmp_tmp_address
>>= 2;
4220 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4222 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4223 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4225 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4228 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4230 irmp_protocol
= irmp_param
.protocol
;
4233 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4234 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4236 if (irmp_tmp_command
& 0x000F) // released key?
4238 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4242 irmp_tmp_command
>>= 4; // no, it's a pressed key
4244 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4245 irmp_tmp_address
&= 0x003F;
4249 irmp_address
= irmp_tmp_address
; // store address
4250 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4251 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4253 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4257 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4258 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4260 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4263 irmp_command
= irmp_tmp_command
; // store command
4265 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4266 irmp_id
= irmp_tmp_id
;
4271 if (irmp_ir_detected
)
4273 if (last_irmp_command
== irmp_tmp_command
&&
4274 last_irmp_address
== irmp_tmp_address
&&
4275 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4277 irmp_flags
|= IRMP_FLAG_REPETITION
;
4280 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4281 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4283 key_repetition_len
= 0;
4288 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4292 irmp_start_bit_detected
= 0; // and wait for next start bit
4293 irmp_tmp_command
= 0;
4294 irmp_pulse_time
= 0;
4295 irmp_pause_time
= 0;
4297 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4298 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4299 { // set pulse time here!
4300 irmp_pulse_time
= ((uint8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4302 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4307 #if defined(STELLARIS_ARM_CORTEX_M4)
4308 // Clear the timer interrupt
4309 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4312 return (irmp_ir_detected
);
4317 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4318 * main functions - for Unix/Linux + Windows only!
4322 * Compile it under linux with:
4325 * usage: ./irmp [-v|-s|-a|-l|-p] < file
4331 * -l list pulse/pauses
4333 *---------------------------------------------------------------------------------------------------------------------------------------------------
4337 print_timings (void)
4339 printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN
, sizeof (PAUSE_LEN
));
4340 printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN
);
4342 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");
4343 printf ("====================================================================================\n");
4344 printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4345 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
, SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
,
4346 SIRCS_0_PULSE_LEN_MIN
, SIRCS_0_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
,
4347 SIRCS_1_PULSE_LEN_MIN
, SIRCS_1_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
);
4349 printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4350 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
,
4351 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4352 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4354 printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4355 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
,
4356 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4357 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4359 printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4360 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
, SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
,
4361 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_0_PAUSE_LEN_MIN
, SAMSUNG_0_PAUSE_LEN_MAX
,
4362 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_1_PAUSE_LEN_MIN
, SAMSUNG_1_PAUSE_LEN_MAX
);
4364 printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4365 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
, MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
,
4366 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_0_PAUSE_LEN_MIN
, MATSUSHITA_0_PAUSE_LEN_MAX
,
4367 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_1_PAUSE_LEN_MIN
, MATSUSHITA_1_PAUSE_LEN_MAX
);
4369 printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4370 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
, KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
,
4371 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_0_PAUSE_LEN_MIN
, KASEIKYO_0_PAUSE_LEN_MAX
,
4372 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_1_PAUSE_LEN_MIN
, KASEIKYO_1_PAUSE_LEN_MAX
);
4374 printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4375 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
, RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
,
4376 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_0_PAUSE_LEN_MIN
, RECS80_0_PAUSE_LEN_MAX
,
4377 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_1_PAUSE_LEN_MIN
, RECS80_1_PAUSE_LEN_MAX
);
4379 printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",
4380 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
, RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
4381 RC5_BIT_LEN_MIN
, RC5_BIT_LEN_MAX
);
4383 printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4384 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
4385 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
,
4386 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
);
4388 printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4389 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
4390 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
,
4391 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
);
4393 printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4394 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
, RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
,
4395 RC6_BIT_PULSE_LEN_MIN
, RC6_BIT_PULSE_LEN_MAX
, RC6_BIT_PAUSE_LEN_MIN
, RC6_BIT_PAUSE_LEN_MAX
);
4397 printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4398 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
, RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
,
4399 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_0_PAUSE_LEN_MIN
, RECS80EXT_0_PAUSE_LEN_MAX
,
4400 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_1_PAUSE_LEN_MIN
, RECS80EXT_1_PAUSE_LEN_MAX
);
4402 printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4403 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
, NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
,
4404 NUBERT_0_PULSE_LEN_MIN
, NUBERT_0_PULSE_LEN_MAX
, NUBERT_0_PAUSE_LEN_MIN
, NUBERT_0_PAUSE_LEN_MAX
,
4405 NUBERT_1_PULSE_LEN_MIN
, NUBERT_1_PULSE_LEN_MAX
, NUBERT_1_PAUSE_LEN_MIN
, NUBERT_1_PAUSE_LEN_MAX
);
4407 printf ("SPEAKER 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4408 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
, SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
,
4409 SPEAKER_0_PULSE_LEN_MIN
, SPEAKER_0_PULSE_LEN_MAX
, SPEAKER_0_PAUSE_LEN_MIN
, SPEAKER_0_PAUSE_LEN_MAX
,
4410 SPEAKER_1_PULSE_LEN_MIN
, SPEAKER_1_PULSE_LEN_MAX
, SPEAKER_1_PAUSE_LEN_MIN
, SPEAKER_1_PAUSE_LEN_MAX
);
4412 printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",
4413 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
4414 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
4416 printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",
4417 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
4418 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
4420 printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",
4421 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
4422 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
4424 printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",
4425 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
4426 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
4428 printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4429 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_0_PAUSE_LEN_MIN
, BANG_OLUFSEN_0_PAUSE_LEN_MAX
,
4430 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_1_PAUSE_LEN_MIN
, BANG_OLUFSEN_1_PAUSE_LEN_MAX
);
4432 printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",
4433 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
4434 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
,
4435 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
);
4437 printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4438 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
4439 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
4440 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4441 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
,
4442 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4443 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
);
4445 printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4446 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
, FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
,
4447 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_0_PAUSE_LEN_MIN
, FDC_0_PAUSE_LEN_MAX
,
4448 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_1_PAUSE_LEN_MIN
, FDC_1_PAUSE_LEN_MAX
);
4450 printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4451 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
, RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
,
4452 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_0_PAUSE_LEN_MIN
, RCCAR_0_PAUSE_LEN_MAX
,
4453 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_1_PAUSE_LEN_MIN
, RCCAR_1_PAUSE_LEN_MAX
);
4455 printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4456 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
, NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
,
4457 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_0_PAUSE_LEN_MIN
, NIKON_0_PAUSE_LEN_MAX
,
4458 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_1_PAUSE_LEN_MIN
, NIKON_1_PAUSE_LEN_MAX
);
4460 printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4461 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
, LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
,
4462 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_0_PAUSE_LEN_MIN
, LEGO_0_PAUSE_LEN_MAX
,
4463 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_1_PAUSE_LEN_MIN
, LEGO_1_PAUSE_LEN_MAX
);
4466 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE PAUSE-00 PAUSE-01 PAUSE-10 PAUSE-11\n");
4467 printf ("================================================================================================\n");
4468 printf ("RCMM 1 %3d %3d %3d %3d %3d %3d %3d\n",
4469 (uint8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PULSE_TIME
), (uint8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PAUSE_TIME
),
4470 (uint8_t)(F_INTERRUPTS
* RCMM32_PULSE_TIME
),
4471 (uint8_t)(F_INTERRUPTS
* RCMM32_00_PAUSE_TIME
), (uint8_t)(F_INTERRUPTS
* RCMM32_01_PAUSE_TIME
),
4472 (uint8_t)(F_INTERRUPTS
* RCMM32_10_PAUSE_TIME
), (uint8_t)(F_INTERRUPTS
* RCMM32_11_PAUSE_TIME
));
4473 printf ("RCMM 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4474 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
, RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
,
4475 RCMM32_BIT_PULSE_LEN_MIN
, RCMM32_BIT_PULSE_LEN_MAX
, RCMM32_BIT_00_PAUSE_LEN_MIN
, RCMM32_BIT_00_PAUSE_LEN_MAX
,
4476 RCMM32_BIT_01_PAUSE_LEN_MIN
, RCMM32_BIT_01_PAUSE_LEN_MAX
, RCMM32_BIT_10_PAUSE_LEN_MIN
, RCMM32_BIT_10_PAUSE_LEN_MAX
,
4477 RCMM32_BIT_11_PAUSE_LEN_MIN
, RCMM32_BIT_11_PAUSE_LEN_MAX
);
4481 print_spectrum (char * text
, int * buf
, int is_pulse
)
4494 puts ("-------------------------------------------------------------------------------");
4495 printf ("%s:\n", text
);
4497 for (i
= 0; i
< 256; i
++)
4499 if (buf
[i
] > max_value
)
4505 for (i
= 1; i
< 200; i
++)
4510 value
= (buf
[i
] * 60) / max_value
;
4512 for (j
= 0; j
< value
; j
++)
4516 printf (" %d\n", buf
[i
]);
4527 average
= (float) sum
/ (float) counter
;
4538 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4539 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4540 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4542 tolerance
= (max
- average
);
4544 if (average
- min
> tolerance
)
4546 tolerance
= average
- min
;
4549 tolerance
= tolerance
* 100 / average
;
4550 printf ("tol: %4.1f%%\n", tolerance
);
4560 #define STATE_LEFT_SHIFT 0x01
4561 #define STATE_RIGHT_SHIFT 0x02
4562 #define STATE_LEFT_CTRL 0x04
4563 #define STATE_LEFT_ALT 0x08
4564 #define STATE_RIGHT_ALT 0x10
4566 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4567 #define KEY_MENUE 0x80 // keycode = 0x0070
4568 #define KEY_BACK 0x81 // keycode = 0x0071
4569 #define KEY_FORWARD 0x82 // keycode = 0x0072
4570 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4571 #define KEY_WINDOW 0x84 // keycode = 0x0074
4572 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4573 #define KEY_STOP 0x86 // keycode = 0x0076
4574 #define KEY_MAIL 0x87 // keycode = 0x0077
4575 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4576 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4577 #define KEY_SETUP 0x8A // keycode = 0x007a
4578 #define KEY_FONT 0x8B // keycode = 0x007b
4579 #define KEY_PRINT 0x8C // keycode = 0x007c
4580 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4582 #define KEY_INSERT 0x90 // keycode = 0x004b
4583 #define KEY_DELETE 0x91 // keycode = 0x004c
4584 #define KEY_LEFT 0x92 // keycode = 0x004f
4585 #define KEY_HOME 0x93 // keycode = 0x0050
4586 #define KEY_END 0x94 // keycode = 0x0051
4587 #define KEY_UP 0x95 // keycode = 0x0053
4588 #define KEY_DOWN 0x96 // keycode = 0x0054
4589 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
4590 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
4591 #define KEY_RIGHT 0x99 // keycode = 0x0059
4592 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
4593 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
4596 get_fdc_key (uint16_t cmd
)
4598 static uint8_t key_table
[128] =
4600 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
4601 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
4602 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
4603 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
4604 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
4606 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
4607 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
4608 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
4609 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
4611 static uint8_t state
;
4617 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
4618 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
4619 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
4620 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
4621 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
4622 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
4623 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
4624 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
4625 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
4626 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
4628 case 0x006e: key
= KEY_ESCAPE
; break;
4629 case 0x004b: key
= KEY_INSERT
; break;
4630 case 0x004c: key
= KEY_DELETE
; break;
4631 case 0x004f: key
= KEY_LEFT
; break;
4632 case 0x0050: key
= KEY_HOME
; break;
4633 case 0x0051: key
= KEY_END
; break;
4634 case 0x0053: key
= KEY_UP
; break;
4635 case 0x0054: key
= KEY_DOWN
; break;
4636 case 0x0055: key
= KEY_PAGE_UP
; break;
4637 case 0x0056: key
= KEY_PAGE_DOWN
; break;
4638 case 0x0059: key
= KEY_RIGHT
; break;
4639 case 0x0400: key
= KEY_MOUSE_1
; break;
4640 case 0x0800: key
= KEY_MOUSE_2
; break;
4644 if (!(cmd
& 0x80)) // pressed key
4646 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
4648 key
= cmd
+ 0x10; // 7x -> 8x
4650 else if (cmd
< 64) // key listed in key_table
4652 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
4656 case 0x0003: key
= '²'; break;
4657 case 0x0008: key
= '{'; break;
4658 case 0x0009: key
= '['; break;
4659 case 0x000A: key
= ']'; break;
4660 case 0x000B: key
= '}'; break;
4661 case 0x000C: key
= '\\'; break;
4662 case 0x001C: key
= '~'; break;
4663 case 0x002D: key
= '|'; break;
4664 case 0x0034: key
= 0xB5; break; // Mu
4667 else if (state
& (STATE_LEFT_CTRL
))
4669 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
4671 key
= key_table
[cmd
] - 'a' + 1;
4675 key
= key_table
[cmd
];
4680 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
4684 key
= key_table
[idx
];
4696 static int analyze
= FALSE
;
4697 static int list
= FALSE
;
4698 static IRMP_DATA irmp_data
;
4699 static int expected_protocol
;
4700 static int expected_address
;
4701 static int expected_command
;
4702 static int do_check_expected_values
;
4707 if (! analyze
&& ! list
)
4711 if (irmp_get_data (&irmp_data
))
4715 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
4719 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4722 if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
4724 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
4726 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
4727 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
4729 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
4731 char * p
= (char *) NULL
;
4735 case '\t' : p
= "TAB"; break;
4736 case '\r' : p
= "CR"; break;
4737 case KEY_ESCAPE
: p
= "ESCAPE"; break;
4738 case KEY_MENUE
: p
= "MENUE"; break;
4739 case KEY_BACK
: p
= "BACK"; break;
4740 case KEY_FORWARD
: p
= "FORWARD"; break;
4741 case KEY_ADDRESS
: p
= "ADDRESS"; break;
4742 case KEY_WINDOW
: p
= "WINDOW"; break;
4743 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
4744 case KEY_STOP
: p
= "STOP"; break;
4745 case KEY_MAIL
: p
= "MAIL"; break;
4746 case KEY_FAVORITES
: p
= "FAVORITES"; break;
4747 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
4748 case KEY_SETUP
: p
= "SETUP"; break;
4749 case KEY_FONT
: p
= "FONT"; break;
4750 case KEY_PRINT
: p
= "PRINT"; break;
4751 case KEY_ON_OFF
: p
= "ON_OFF"; break;
4753 case KEY_INSERT
: p
= "INSERT"; break;
4754 case KEY_DELETE
: p
= "DELETE"; break;
4755 case KEY_LEFT
: p
= "LEFT"; break;
4756 case KEY_HOME
: p
= "HOME"; break;
4757 case KEY_END
: p
= "END"; break;
4758 case KEY_UP
: p
= "UP"; break;
4759 case KEY_DOWN
: p
= "DOWN"; break;
4760 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
4761 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
4762 case KEY_RIGHT
: p
= "RIGHT"; break;
4763 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
4764 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
4765 default : p
= "<UNKNWON>"; break;
4768 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
4769 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
4773 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
4774 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
4779 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
4780 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
4783 if (do_check_expected_values
)
4785 if (irmp_data
.protocol
!= expected_protocol
||
4786 irmp_data
.address
!= expected_address
||
4787 irmp_data
.command
!= expected_command
)
4789 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
4790 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
4794 printf (" checked!\n");
4796 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
4807 main (int argc
, char ** argv
)
4815 int start_pulses
[256];
4816 int start_pauses
[256];
4820 int first_pulse
= TRUE
;
4821 int first_pause
= TRUE
;
4825 if (! strcmp (argv
[1], "-v"))
4829 else if (! strcmp (argv
[1], "-l"))
4833 else if (! strcmp (argv
[1], "-a"))
4837 else if (! strcmp (argv
[1], "-s"))
4841 else if (! strcmp (argv
[1], "-p"))
4846 else if (! strcmp (argv
[1], "-r"))
4852 for (i
= 0; i
< 256; i
++)
4854 start_pulses
[i
] = 0;
4855 start_pauses
[i
] = 0;
4862 while ((ch
= getchar ()) != EOF
)
4864 if (ch
== '_' || ch
== '0')
4872 printf ("pause: %d\n", pause
);
4881 start_pauses
[pause
]++;
4883 first_pause
= FALSE
;
4899 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
4905 printf ("pulse: %d ", pulse
);
4914 start_pulses
[pulse
]++;
4916 first_pulse
= FALSE
;
4932 else if (ch
== '\n')
4937 if (list
&& pause
> 0)
4939 printf ("pause: %d\n", pause
);
4945 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
4959 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
4970 puts ("-------------------------------------------------------------------");
4974 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
4976 if (ch
!= '\r') // ignore CR in DOS/Windows files
4978 if (ch
== '[' && idx
== -1)
4986 do_check_expected_values
= FALSE
;
4990 expected_protocol
= atoi (buf
);
4992 if (expected_protocol
> 0)
5001 if (sscanf (p
, "%x", &expected_address
) == 1)
5003 do_check_expected_values
= TRUE
;
5010 if (do_check_expected_values
)
5012 do_check_expected_values
= FALSE
;
5020 if (sscanf (p
, "%x", &expected_command
) == 1)
5022 do_check_expected_values
= TRUE
;
5029 if (do_check_expected_values
)
5031 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5036 else if (idx
< 1024 - 2)
5056 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5057 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5058 print_spectrum ("PULSES", pulses
, TRUE
);
5059 print_spectrum ("PAUSES", pauses
, FALSE
);
5060 puts ("-------------------------------------------------------------------------------");