1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.181 2015/11/17 13:51:45 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_S100_PROTOCOL == 1 || \
41 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
42 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
43 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
44 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
45 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
46 IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \
47 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
48 # define IRMP_SUPPORT_MANCHESTER 1
50 # define IRMP_SUPPORT_MANCHESTER 0
53 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
54 # define IRMP_SUPPORT_SERIAL 1
56 # define IRMP_SUPPORT_SERIAL 0
59 #define IRMP_KEY_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
61 #define MIN_TOLERANCE_00 1.0 // -0%
62 #define MAX_TOLERANCE_00 1.0 // +0%
64 #define MIN_TOLERANCE_02 0.98 // -2%
65 #define MAX_TOLERANCE_02 1.02 // +2%
67 #define MIN_TOLERANCE_03 0.97 // -3%
68 #define MAX_TOLERANCE_03 1.03 // +3%
70 #define MIN_TOLERANCE_05 0.95 // -5%
71 #define MAX_TOLERANCE_05 1.05 // +5%
73 #define MIN_TOLERANCE_10 0.9 // -10%
74 #define MAX_TOLERANCE_10 1.1 // +10%
76 #define MIN_TOLERANCE_15 0.85 // -15%
77 #define MAX_TOLERANCE_15 1.15 // +15%
79 #define MIN_TOLERANCE_20 0.8 // -20%
80 #define MAX_TOLERANCE_20 1.2 // +20%
82 #define MIN_TOLERANCE_30 0.7 // -30%
83 #define MAX_TOLERANCE_30 1.3 // +30%
85 #define MIN_TOLERANCE_40 0.6 // -40%
86 #define MAX_TOLERANCE_40 1.4 // +40%
88 #define MIN_TOLERANCE_50 0.5 // -50%
89 #define MAX_TOLERANCE_50 1.5 // +50%
91 #define MIN_TOLERANCE_60 0.4 // -60%
92 #define MAX_TOLERANCE_60 1.6 // +60%
94 #define MIN_TOLERANCE_70 0.3 // -70%
95 #define MAX_TOLERANCE_70 1.7 // +70%
97 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
98 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
99 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
100 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
101 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
102 #else // only 5% + 1 to avoid conflict with RC6:
103 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
105 #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
106 #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
107 #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
108 #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
109 #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
110 #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
112 #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
117 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
118 #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
119 #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
120 #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
121 #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
122 #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
123 #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
124 // autodetect nec repetition frame within 50 msec:
125 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
127 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
129 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
132 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
133 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
134 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
135 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
136 #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
137 #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
138 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
139 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
140 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
141 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
143 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
144 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
145 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
146 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
147 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
148 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
149 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
150 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
151 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
152 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
154 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
155 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
156 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
157 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
158 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
159 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
160 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
161 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
162 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
163 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
165 #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
167 #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
168 #define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
169 #define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
170 #define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
171 #define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
172 #define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
173 #define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
174 #define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
176 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
177 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
178 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
179 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
180 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
181 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
182 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
183 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
184 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
185 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
188 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
189 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
190 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
192 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
193 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
196 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
197 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
199 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
200 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
201 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
203 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
204 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
207 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
208 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
210 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
211 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
212 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
213 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
214 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
215 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
217 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
219 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
220 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
221 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
222 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
223 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
224 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
226 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
227 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
228 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
229 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
230 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
231 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
232 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
233 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
234 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
235 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
237 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
238 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
239 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
240 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
241 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
242 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
243 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
244 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
245 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
246 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
248 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
249 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
250 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
251 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
252 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
253 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
254 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
255 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
256 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
257 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
258 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
259 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
261 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
262 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
263 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
264 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
265 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
266 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
267 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
268 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
269 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
270 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
271 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
272 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
274 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
275 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
276 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
277 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
278 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
279 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
280 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
281 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
282 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
283 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
284 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
285 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
287 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
288 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
289 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
290 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
291 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
292 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
293 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
294 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
295 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
296 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
297 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
298 #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
299 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
300 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
301 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
302 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
303 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
304 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
305 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
306 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
307 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
308 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
309 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
310 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
311 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
312 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
314 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
315 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
316 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
317 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
318 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
319 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
320 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
322 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
323 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
324 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
325 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
326 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
327 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
328 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
329 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
331 #define FDC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
332 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
333 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
334 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
335 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
336 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
337 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
338 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
340 #define FDC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255
342 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
344 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
346 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
347 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
348 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
349 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
350 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
351 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
352 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
353 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
354 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
355 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
357 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
358 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
359 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!
360 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!
361 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
362 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
363 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
364 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
365 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
366 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
367 // autodetect JVC repetition frame within 50 msec:
368 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
370 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
371 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
372 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
373 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
374 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
375 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
376 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
377 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
378 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
379 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
380 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
381 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
382 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
384 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
385 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
386 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
387 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
388 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
389 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
390 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
391 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
392 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
393 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
394 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
395 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
396 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
397 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
399 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
400 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
401 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
402 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
403 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
404 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
405 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
406 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
408 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
409 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
410 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
411 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
412 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
413 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
414 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
415 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
416 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
417 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
419 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
420 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
421 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
422 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
423 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
424 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
425 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
426 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
427 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
428 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
429 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
431 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
432 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
433 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
434 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
435 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
436 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
437 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
438 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
440 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
441 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
442 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
443 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
444 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
445 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
446 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
447 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
449 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
450 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
451 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
452 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
453 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
454 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
455 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
456 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
458 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
459 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
460 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
461 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
462 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
463 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
464 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
465 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
466 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
467 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
468 // autodetect TELEFUNKEN repetition frame within 50 msec:
469 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
471 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
472 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
473 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
474 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
475 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
476 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
477 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
478 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
479 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
480 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
481 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
482 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
483 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
484 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
486 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
487 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
488 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
489 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
490 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
491 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
492 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
493 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
494 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
495 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
496 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
497 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
498 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
499 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
501 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
502 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
503 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
504 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
505 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
506 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
507 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
508 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
509 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
510 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
511 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
512 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
513 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
514 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
516 #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
517 #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
518 #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
519 #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
520 #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
521 #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
522 #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
523 #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
524 #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
525 #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
527 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
528 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
529 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
530 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
531 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
532 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
533 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
534 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
535 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
536 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
537 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
538 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
539 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
540 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
542 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
545 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
546 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
547 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
548 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
549 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
551 static int time_counter
;
554 /******************************* not every PIC compiler knows variadic macros :-(
556 # define ANALYZE_PUTCHAR(a)
557 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
558 # define ANALYZE_PRINTF(...)
559 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
561 # define ANALYZE_NEWLINE()
562 *********************************/
565 #if IRMP_USE_CALLBACK == 1
566 static void (*irmp_callback_ptr
) (uint_fast8_t);
567 #endif // IRMP_USE_CALLBACK == 1
569 #define PARITY_CHECK_OK 1
570 #define PARITY_CHECK_FAILED 0
572 /*---------------------------------------------------------------------------------------------------------------------------------------------------
574 *---------------------------------------------------------------------------------------------------------------------------------------------------
576 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
577 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
578 static const char proto_sircs
[] PROGMEM
= "SIRCS";
579 static const char proto_nec
[] PROGMEM
= "NEC";
580 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
581 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
582 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
583 static const char proto_recs80
[] PROGMEM
= "RECS80";
584 static const char proto_rc5
[] PROGMEM
= "RC5";
585 static const char proto_denon
[] PROGMEM
= "DENON";
586 static const char proto_rc6
[] PROGMEM
= "RC6";
587 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
588 static const char proto_apple
[] PROGMEM
= "APPLE";
589 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
590 static const char proto_nubert
[] PROGMEM
= "NUBERT";
591 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
592 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
593 static const char proto_nokia
[] PROGMEM
= "NOKIA";
594 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
595 static const char proto_fdc
[] PROGMEM
= "FDC";
596 static const char proto_rccar
[] PROGMEM
= "RCCAR";
597 static const char proto_jvc
[] PROGMEM
= "JVC";
598 static const char proto_rc6a
[] PROGMEM
= "RC6A";
599 static const char proto_nikon
[] PROGMEM
= "NIKON";
600 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
601 static const char proto_ir60
[] PROGMEM
= "IR60";
602 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
603 static const char proto_netbox
[] PROGMEM
= "NETBOX";
604 static const char proto_nec16
[] PROGMEM
= "NEC16";
605 static const char proto_nec42
[] PROGMEM
= "NEC42";
606 static const char proto_lego
[] PROGMEM
= "LEGO";
607 static const char proto_thomson
[] PROGMEM
= "THOMSON";
608 static const char proto_bose
[] PROGMEM
= "BOSE";
609 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
610 static const char proto_ortek
[] PROGMEM
= "ORTEK";
611 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
612 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
613 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
614 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
615 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
616 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
617 static const char proto_lgair
[] PROGMEM
= "LGAIR";
618 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
619 static const char proto_merlin
[] PROGMEM
= "MERLIN";
620 static const char proto_pentax
[] PROGMEM
= "PENTAX";
621 static const char proto_fan
[] PROGMEM
= "FAN";
622 static const char proto_s100
[] PROGMEM
= "S100";
623 static const char proto_acp24
[] PROGMEM
= "ACP24";
624 static const char proto_technics
[] PROGMEM
= "TECHNICS";
625 static const char proto_panasonic
[] PROGMEM
= "PANASONIC";
627 static const char proto_radio1
[] PROGMEM
= "RADIO1";
630 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
686 /*---------------------------------------------------------------------------------------------------------------------------------------------------
688 *---------------------------------------------------------------------------------------------------------------------------------------------------
690 #if IRMP_LOGGING == 1 // logging via UART
692 #if defined(ARM_STM32F4XX)
693 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
694 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
695 # define STM32_GPIO_PORT GPIOA
696 # define STM32_GPIO_PIN GPIO_Pin_2
697 # define STM32_GPIO_SOURCE GPIO_PinSource2
698 # define STM32_UART_AF GPIO_AF_USART2
699 # define STM32_UART_COM USART2
700 # define STM32_UART_BAUD 115200 // 115200 Baud
701 # include "stm32f4xx_usart.h"
702 #elif defined(ARM_STM32F10X)
703 # define STM32_UART_COM USART3 // UART3 on PB10
704 #elif defined(ARDUINO) // Arduino Serial implementation
705 # if defined(USB_SERIAL)
706 # include "usb_serial.h"
708 # error USB_SERIAL not defined in ARDUINO Environment
711 # if IRMP_EXT_LOGGING == 1 // use external logging
712 # include "irmpextlog.h"
713 # else // normal UART log (IRMP_EXT_LOGGING == 0)
715 # ifndef UNIX_OR_WINDOWS
716 # include <util/setbaud.h>
721 #define UART0_UBRRH UBRR0H
722 #define UART0_UBRRL UBRR0L
723 #define UART0_UCSRA UCSR0A
724 #define UART0_UCSRB UCSR0B
725 #define UART0_UCSRC UCSR0C
726 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
727 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
728 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
730 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
732 #define UART0_URSEL_BIT_VALUE (0)
734 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
735 #define UART0_UDR UDR0
736 #define UART0_U2X U2X0
740 #define UART0_UBRRH UBRRH
741 #define UART0_UBRRL UBRRL
742 #define UART0_UCSRA UCSRA
743 #define UART0_UCSRB UCSRB
744 #define UART0_UCSRC UCSRC
745 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
746 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
747 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
749 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
751 #define UART0_URSEL_BIT_VALUE (0)
753 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
754 #define UART0_UDR UDR
755 #define UART0_U2X U2X
758 #endif //IRMP_EXT_LOGGING
759 #endif //ARM_STM32F4XX
761 /*---------------------------------------------------------------------------------------------------------------------------------------------------
763 * @details Initializes UART
764 *---------------------------------------------------------------------------------------------------------------------------------------------------
767 irmp_uart_init (void)
769 #ifndef UNIX_OR_WINDOWS
770 #if defined(ARM_STM32F4XX)
771 GPIO_InitTypeDef GPIO_InitStructure
;
772 USART_InitTypeDef USART_InitStructure
;
774 // Clock enable vom TX Pin
775 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
777 // Clock enable der UART
778 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
780 // UART Alternative-Funktion mit dem IO-Pin verbinden
781 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
783 // UART als Alternative-Funktion mit PushPull
784 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
785 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
786 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
787 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
790 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
791 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
794 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
796 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
797 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
798 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
799 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
800 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
801 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
802 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
803 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
806 USART_Cmd(STM32_UART_COM
, ENABLE
);
808 #elif defined(ARM_STM32F10X)
809 GPIO_InitTypeDef GPIO_InitStructure
;
810 USART_InitTypeDef USART_InitStructure
;
812 // Clock enable vom TX Pin
813 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
815 // Clock enable der UART
816 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
818 // UART als Alternative-Funktion mit PushPull
819 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
820 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
823 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
824 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
827 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
829 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
830 USART_InitStructure
.USART_BaudRate
= 115200;
831 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
832 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
833 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
834 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
835 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
836 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
839 USART_Cmd(STM32_UART_COM
, ENABLE
);
841 #elif defined(ARDUINO)
842 // we use the Arduino Serial Imlementation
843 // you have to call Serial.begin(SER_BAUD); in Arduino setup() function
845 #elif defined (__AVR_XMEGA__)
847 PMIC
.CTRL
|= PMIC_HILVLEN_bm
;
849 USARTC1
.BAUDCTRLB
= 0;
850 USARTC1
.BAUDCTRLA
= F_CPU
/ 153600 - 1;
851 USARTC1
.CTRLA
= USART_RXCINTLVL_HI_gc
; // High Level (Empfangen)
852 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; //Aktiviert Senden und Empfangen
853 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; //Größe der Zeichen: 8 Bit
854 PORTC
.DIR |= (1<<7); //TXD als Ausgang setzen
855 PORTC
.DIR &= ~(1<<6);
859 #if (IRMP_EXT_LOGGING == 0) // use UART
860 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
861 UART0_UBRRL
= UBRRL_VALUE
;
864 UART0_UCSRA
|= (1<<UART0_U2X
);
866 UART0_UCSRA
&= ~(1<<UART0_U2X
);
869 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
870 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
871 #else // other log method
873 #endif //IRMP_EXT_LOGGING
874 #endif //ARM_STM32F4XX
875 #endif // UNIX_OR_WINDOWS
878 /*---------------------------------------------------------------------------------------------------------------------------------------------------
880 * @details Sends character
881 * @param ch character to be transmitted
882 *---------------------------------------------------------------------------------------------------------------------------------------------------
885 irmp_uart_putc (unsigned char ch
)
887 #ifndef UNIX_OR_WINDOWS
888 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
889 // warten bis altes Byte gesendet wurde
890 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
895 USART_SendData(STM32_UART_COM
, ch
);
899 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
900 USART_SendData(STM32_UART_COM
, '\r');
903 #elif defined(ARDUINO)
904 // we use the Arduino Serial Imlementation
905 usb_serial_putchar(ch
);
908 #if (IRMP_EXT_LOGGING == 0)
910 # if defined (__AVR_XMEGA__)
911 while (!(USARTC1
.STATUS
& USART_DREIF_bm
));
915 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
921 #endif //__AVR_XMEGA__
924 sendextlog(ch
); // use external log
926 #endif //IRMP_EXT_LOGGING
927 #endif //ARM_STM32F4XX
930 #endif // UNIX_OR_WINDOWS
933 /*---------------------------------------------------------------------------------------------------------------------------------------------------
935 *---------------------------------------------------------------------------------------------------------------------------------------------------
938 #define STARTCYCLES 2 // min count of zeros before start of logging
939 #define ENDBITS 1000 // number of sequenced highbits to detect end
940 #define DATALEN 700 // log buffer size
943 irmp_log (uint_fast8_t val
)
945 static uint8_t buf
[DATALEN
]; // logging buffer
946 static uint_fast16_t buf_idx
; // index
947 static uint_fast8_t startcycles
; // current number of start-zeros
948 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
949 static uint_fast8_t last_val
= 1;
951 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
959 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
965 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
966 { // if stop condition is true, output on uart
970 uint_fast8_t v
= '1';
973 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
975 irmp_uart_putc ('0'); // the ignored starting zeros
978 for (i
= 0; i
< buf_idx
; i
++)
987 d
|= ((uint_fast16_t) buf
[i
] << 8);
990 for (j
= 0; j
< d
; j
++)
995 v
= (v
== '1') ? '0' : '1';
998 for (i8
= 0; i8
< 20; i8
++)
1000 irmp_uart_putc ('1');
1003 irmp_uart_putc ('\n');
1009 else if (buf_idx
< DATALEN
- 3)
1013 buf
[buf_idx
++] = 0xff;
1014 buf
[buf_idx
++] = (cnt
& 0xff);
1015 buf
[buf_idx
] = (cnt
>> 8);
1031 #define irmp_log(val)
1032 #endif //IRMP_LOGGING
1036 uint_fast8_t protocol
; // ir protocol
1037 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
1038 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
1039 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
1040 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
1041 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
1042 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
1043 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
1044 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
1045 uint_fast8_t address_offset
; // address offset
1046 uint_fast8_t address_end
; // end of address
1047 uint_fast8_t command_offset
; // command offset
1048 uint_fast8_t command_end
; // end of command
1049 uint_fast8_t complete_len
; // complete length of frame
1050 uint_fast8_t stop_bit
; // flag: frame has stop bit
1051 uint_fast8_t lsb_first
; // flag: LSB first
1052 uint_fast8_t flags
; // some flags
1055 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1057 static const PROGMEM IRMP_PARAMETER sircs_param
=
1059 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
1060 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1061 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1062 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1063 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1064 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1065 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1066 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1067 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1068 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
1069 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
1070 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
1071 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
1072 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1073 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
1074 SIRCS_LSB
, // lsb_first: flag: LSB first
1075 SIRCS_FLAGS
// flags: some flags
1080 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1082 static const PROGMEM IRMP_PARAMETER nec_param
=
1084 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1085 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1086 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1087 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1088 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1089 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1090 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1091 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1092 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1093 NEC_ADDRESS_OFFSET
, // address_offset: address offset
1094 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
1095 NEC_COMMAND_OFFSET
, // command_offset: command offset
1096 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
1097 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1098 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1099 NEC_LSB
, // lsb_first: flag: LSB first
1100 NEC_FLAGS
// flags: some flags
1103 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1105 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1106 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1107 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1108 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1109 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1110 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1111 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1112 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1113 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1114 0, // address_offset: address offset
1115 0, // address_end: end of address
1116 0, // command_offset: command offset
1117 0, // command_end: end of command
1118 0, // complete_len: complete length of frame
1119 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1120 NEC_LSB
, // lsb_first: flag: LSB first
1121 NEC_FLAGS
// flags: some flags
1126 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1128 static const PROGMEM IRMP_PARAMETER nec42_param
=
1130 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1131 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1132 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1133 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1134 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1135 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1136 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1137 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1138 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1139 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1140 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1141 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1142 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1143 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1144 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1145 NEC_LSB
, // lsb_first: flag: LSB first
1146 NEC_FLAGS
// flags: some flags
1151 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1153 static const PROGMEM IRMP_PARAMETER lgair_param
=
1155 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1156 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1157 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1158 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1159 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1160 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1161 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1162 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1163 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1164 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1165 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1166 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1167 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1168 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1169 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1170 NEC_LSB
, // lsb_first: flag: LSB first
1171 NEC_FLAGS
// flags: some flags
1176 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1178 static const PROGMEM IRMP_PARAMETER samsung_param
=
1180 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1181 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1182 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1183 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1184 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1185 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1186 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1187 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1188 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1189 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1190 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1191 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1192 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1193 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1194 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1195 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1196 SAMSUNG_FLAGS
// flags: some flags
1201 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1203 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1205 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1206 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1207 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1208 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1209 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1210 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1211 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1212 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1213 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1214 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1215 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1216 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1217 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1218 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1219 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1220 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1221 TELEFUNKEN_FLAGS
// flags: some flags
1226 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1228 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1230 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1231 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1232 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1233 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1234 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1235 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1236 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1237 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1238 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1239 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1240 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1241 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1242 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1243 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1244 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1245 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1246 MATSUSHITA_FLAGS
// flags: some flags
1251 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1253 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1255 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1256 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1257 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1258 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1259 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1260 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1261 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1262 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1263 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1264 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1265 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1266 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1267 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1268 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1269 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1270 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1271 KASEIKYO_FLAGS
// flags: some flags
1276 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
1278 static const PROGMEM IRMP_PARAMETER panasonic_param
=
1280 IRMP_PANASONIC_PROTOCOL
, // protocol: ir protocol
1281 PANASONIC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1282 PANASONIC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1283 PANASONIC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1284 PANASONIC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1285 PANASONIC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1286 PANASONIC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1287 PANASONIC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1288 PANASONIC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1289 PANASONIC_ADDRESS_OFFSET
, // address_offset: address offset
1290 PANASONIC_ADDRESS_OFFSET
+ PANASONIC_ADDRESS_LEN
, // address_end: end of address
1291 PANASONIC_COMMAND_OFFSET
, // command_offset: command offset
1292 PANASONIC_COMMAND_OFFSET
+ PANASONIC_COMMAND_LEN
, // command_end: end of command
1293 PANASONIC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1294 PANASONIC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1295 PANASONIC_LSB
, // lsb_first: flag: LSB first
1296 PANASONIC_FLAGS
// flags: some flags
1301 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1303 static const PROGMEM IRMP_PARAMETER recs80_param
=
1305 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1306 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1307 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1308 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1309 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1310 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1311 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1312 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1313 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1314 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1315 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1316 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1317 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1318 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1319 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1320 RECS80_LSB
, // lsb_first: flag: LSB first
1321 RECS80_FLAGS
// flags: some flags
1326 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1328 static const PROGMEM IRMP_PARAMETER rc5_param
=
1330 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1331 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1332 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1333 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1334 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1335 0, // pulse_0_len_min: here: not used
1336 0, // pulse_0_len_max: here: not used
1337 0, // pause_0_len_min: here: not used
1338 0, // pause_0_len_max: here: not used
1339 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1340 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1341 RC5_COMMAND_OFFSET
, // command_offset: command offset
1342 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1343 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1344 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1345 RC5_LSB
, // lsb_first: flag: LSB first
1346 RC5_FLAGS
// flags: some flags
1351 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1353 static const PROGMEM IRMP_PARAMETER s100_param
=
1355 IRMP_S100_PROTOCOL
, // protocol: ir protocol
1356 S100_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1357 S100_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1358 S100_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1359 S100_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1360 0, // pulse_0_len_min: here: not used
1361 0, // pulse_0_len_max: here: not used
1362 0, // pause_0_len_min: here: not used
1363 0, // pause_0_len_max: here: not used
1364 S100_ADDRESS_OFFSET
, // address_offset: address offset
1365 S100_ADDRESS_OFFSET
+ S100_ADDRESS_LEN
, // address_end: end of address
1366 S100_COMMAND_OFFSET
, // command_offset: command offset
1367 S100_COMMAND_OFFSET
+ S100_COMMAND_LEN
, // command_end: end of command
1368 S100_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1369 S100_STOP_BIT
, // stop_bit: flag: frame has stop bit
1370 S100_LSB
, // lsb_first: flag: LSB first
1371 S100_FLAGS
// flags: some flags
1376 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1378 static const PROGMEM IRMP_PARAMETER denon_param
=
1380 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1381 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1382 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1383 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1384 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1385 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1386 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1387 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1388 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1389 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1390 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1391 DENON_COMMAND_OFFSET
, // command_offset: command offset
1392 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1393 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1394 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1395 DENON_LSB
, // lsb_first: flag: LSB first
1396 DENON_FLAGS
// flags: some flags
1401 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1403 static const PROGMEM IRMP_PARAMETER rc6_param
=
1405 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1407 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1408 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1409 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1410 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1411 0, // pulse_0_len_min: here: not used
1412 0, // pulse_0_len_max: here: not used
1413 0, // pause_0_len_min: here: not used
1414 0, // pause_0_len_max: here: not used
1415 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1416 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1417 RC6_COMMAND_OFFSET
, // command_offset: command offset
1418 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1419 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1420 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1421 RC6_LSB
, // lsb_first: flag: LSB first
1422 RC6_FLAGS
// flags: some flags
1427 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1429 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1431 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1432 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1433 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1434 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1435 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1436 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1437 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1438 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1439 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1440 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1441 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1442 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1443 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1444 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1445 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1446 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1447 RECS80EXT_FLAGS
// flags: some flags
1452 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1454 static const PROGMEM IRMP_PARAMETER nubert_param
=
1456 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1457 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1458 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1459 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1460 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1461 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1462 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1463 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1464 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1465 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1466 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1467 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1468 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1469 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1470 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1471 NUBERT_LSB
, // lsb_first: flag: LSB first
1472 NUBERT_FLAGS
// flags: some flags
1477 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1479 static const PROGMEM IRMP_PARAMETER fan_param
=
1481 IRMP_FAN_PROTOCOL
, // protocol: ir protocol
1482 FAN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1483 FAN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1484 FAN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1485 FAN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1486 FAN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1487 FAN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1488 FAN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1489 FAN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1490 FAN_ADDRESS_OFFSET
, // address_offset: address offset
1491 FAN_ADDRESS_OFFSET
+ FAN_ADDRESS_LEN
, // address_end: end of address
1492 FAN_COMMAND_OFFSET
, // command_offset: command offset
1493 FAN_COMMAND_OFFSET
+ FAN_COMMAND_LEN
, // command_end: end of command
1494 FAN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1495 FAN_STOP_BIT
, // stop_bit: flag: frame has NO stop bit
1496 FAN_LSB
, // lsb_first: flag: LSB first
1497 FAN_FLAGS
// flags: some flags
1502 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1504 static const PROGMEM IRMP_PARAMETER speaker_param
=
1506 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1507 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1508 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1509 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1510 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1511 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1512 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1513 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1514 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1515 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1516 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1517 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1518 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1519 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1520 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1521 SPEAKER_LSB
, // lsb_first: flag: LSB first
1522 SPEAKER_FLAGS
// flags: some flags
1527 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1529 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1531 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1532 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1533 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1534 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1535 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1536 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1537 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1538 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1539 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1540 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1541 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1542 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1543 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1544 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1545 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1546 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1547 BANG_OLUFSEN_FLAGS
// flags: some flags
1552 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1554 static uint_fast8_t first_bit
;
1556 static const PROGMEM IRMP_PARAMETER grundig_param
=
1558 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1560 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1561 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1562 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1563 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1564 0, // pulse_0_len_min: here: not used
1565 0, // pulse_0_len_max: here: not used
1566 0, // pause_0_len_min: here: not used
1567 0, // pause_0_len_max: here: not used
1568 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1569 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1570 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1571 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1572 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1573 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1574 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1575 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1580 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1582 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1584 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1585 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1586 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1587 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1588 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1589 0, // pulse_0_len_min: here: not used
1590 0, // pulse_0_len_max: here: not used
1591 0, // pause_0_len_min: here: not used
1592 0, // pause_0_len_max: here: not used
1593 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1594 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1595 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1596 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1597 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1598 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1599 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1600 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1605 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1607 static const PROGMEM IRMP_PARAMETER fdc_param
=
1609 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1610 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1611 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1612 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1613 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1614 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1615 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1616 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1617 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1618 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1619 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1620 FDC_COMMAND_OFFSET
, // command_offset: command offset
1621 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1622 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1623 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1624 FDC_LSB
, // lsb_first: flag: LSB first
1625 FDC_FLAGS
// flags: some flags
1630 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1632 static const PROGMEM IRMP_PARAMETER rccar_param
=
1634 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1635 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1636 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1637 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1638 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1639 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1640 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1641 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1642 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1643 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1644 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1645 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1646 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1647 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1648 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1649 RCCAR_LSB
, // lsb_first: flag: LSB first
1650 RCCAR_FLAGS
// flags: some flags
1655 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1657 static const PROGMEM IRMP_PARAMETER nikon_param
=
1659 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1660 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1661 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1662 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1663 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1664 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1665 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1666 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1667 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1668 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1669 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1670 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1671 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1672 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1673 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1674 NIKON_LSB
, // lsb_first: flag: LSB first
1675 NIKON_FLAGS
// flags: some flags
1680 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1682 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1684 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1685 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1686 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1687 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1688 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1689 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1690 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1691 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1692 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1693 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1694 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1695 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1696 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1697 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1698 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1699 KATHREIN_LSB
, // lsb_first: flag: LSB first
1700 KATHREIN_FLAGS
// flags: some flags
1705 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1707 static const PROGMEM IRMP_PARAMETER netbox_param
=
1709 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1710 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1711 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1712 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1713 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1714 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1715 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1716 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1717 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1718 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1719 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1720 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1721 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1722 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1723 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1724 NETBOX_LSB
, // lsb_first: flag: LSB first
1725 NETBOX_FLAGS
// flags: some flags
1730 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1732 static const PROGMEM IRMP_PARAMETER lego_param
=
1734 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1735 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1736 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1737 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1738 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1739 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1740 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1741 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1742 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1743 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1744 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1745 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1746 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1747 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1748 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1749 LEGO_LSB
, // lsb_first: flag: LSB first
1750 LEGO_FLAGS
// flags: some flags
1755 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1757 static const PROGMEM IRMP_PARAMETER thomson_param
=
1759 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1760 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1761 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1762 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1763 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1764 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1765 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1766 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1767 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1768 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1769 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1770 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1771 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1772 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1773 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1774 THOMSON_LSB
, // lsb_first: flag: LSB first
1775 THOMSON_FLAGS
// flags: some flags
1780 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1782 static const PROGMEM IRMP_PARAMETER bose_param
=
1784 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1785 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1786 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1787 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1788 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1789 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1790 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1791 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1792 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1793 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1794 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1795 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1796 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1797 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1798 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1799 BOSE_LSB
, // lsb_first: flag: LSB first
1800 BOSE_FLAGS
// flags: some flags
1805 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1807 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1809 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1811 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1812 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1813 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1814 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1815 0, // pulse_0_len_min: here: not used
1816 0, // pulse_0_len_max: here: not used
1817 0, // pause_0_len_min: here: not used
1818 0, // pause_0_len_max: here: not used
1819 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1820 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1821 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1822 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1823 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1824 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1825 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1826 A1TVBOX_FLAGS
// flags: some flags
1831 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
1833 static const PROGMEM IRMP_PARAMETER merlin_param
=
1835 IRMP_MERLIN_PROTOCOL
, // protocol: ir protocol
1837 MERLIN_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1838 MERLIN_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1839 MERLIN_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1840 MERLIN_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1841 0, // pulse_0_len_min: here: not used
1842 0, // pulse_0_len_max: here: not used
1843 0, // pause_0_len_min: here: not used
1844 0, // pause_0_len_max: here: not used
1845 MERLIN_ADDRESS_OFFSET
, // address_offset: address offset
1846 MERLIN_ADDRESS_OFFSET
+ MERLIN_ADDRESS_LEN
, // address_end: end of address
1847 MERLIN_COMMAND_OFFSET
, // command_offset: command offset
1848 MERLIN_COMMAND_OFFSET
+ MERLIN_COMMAND_LEN
, // command_end: end of command
1849 MERLIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1850 MERLIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1851 MERLIN_LSB
, // lsb_first: flag: LSB first
1852 MERLIN_FLAGS
// flags: some flags
1857 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1859 static const PROGMEM IRMP_PARAMETER ortek_param
=
1861 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1863 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1864 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1865 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1866 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1867 0, // pulse_0_len_min: here: not used
1868 0, // pulse_0_len_max: here: not used
1869 0, // pause_0_len_min: here: not used
1870 0, // pause_0_len_max: here: not used
1871 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1872 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1873 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1874 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1875 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1876 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1877 ORTEK_LSB
, // lsb_first: flag: LSB first
1878 ORTEK_FLAGS
// flags: some flags
1883 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1885 static const PROGMEM IRMP_PARAMETER roomba_param
=
1887 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1888 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1889 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1890 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1891 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1892 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1893 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1894 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1895 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1896 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1897 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1898 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1899 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1900 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1901 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1902 ROOMBA_LSB
, // lsb_first: flag: LSB first
1903 ROOMBA_FLAGS
// flags: some flags
1908 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1910 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1912 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1914 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1915 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1916 0, // pause_1_len_min: here: minimum length of short pause
1917 0, // pause_1_len_max: here: maximum length of short pause
1918 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1919 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1920 0, // pause_0_len_min: here: not used
1921 0, // pause_0_len_max: here: not used
1922 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1923 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1924 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1925 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1926 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1927 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1928 RCMM32_LSB
, // lsb_first: flag: LSB first
1929 RCMM32_FLAGS
// flags: some flags
1934 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
1936 static const PROGMEM IRMP_PARAMETER pentax_param
=
1938 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
1939 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1940 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1941 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1942 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1943 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1944 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1945 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1946 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1947 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
1948 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
1949 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
1950 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
1951 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1952 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1953 PENTAX_LSB
, // lsb_first: flag: LSB first
1954 PENTAX_FLAGS
// flags: some flags
1959 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
1961 static const PROGMEM IRMP_PARAMETER acp24_param
=
1963 IRMP_ACP24_PROTOCOL
, // protocol: ir protocol
1964 ACP24_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1965 ACP24_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1966 ACP24_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1967 ACP24_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1968 ACP24_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1969 ACP24_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1970 ACP24_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1971 ACP24_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1972 ACP24_ADDRESS_OFFSET
, // address_offset: address offset
1973 ACP24_ADDRESS_OFFSET
+ ACP24_ADDRESS_LEN
, // address_end: end of address
1974 ACP24_COMMAND_OFFSET
, // command_offset: command offset
1975 ACP24_COMMAND_OFFSET
+ ACP24_COMMAND_LEN
, // command_end: end of command
1976 ACP24_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1977 ACP24_STOP_BIT
, // stop_bit: flag: frame has stop bit
1978 ACP24_LSB
, // lsb_first: flag: LSB first
1979 ACP24_FLAGS
// flags: some flags
1984 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
1986 static const PROGMEM IRMP_PARAMETER radio1_param
=
1988 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
1990 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1991 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1992 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1993 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1994 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1995 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1996 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1997 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1998 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
1999 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
2000 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
2001 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
2002 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2003 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
2004 RADIO1_LSB
, // lsb_first: flag: LSB first
2005 RADIO1_FLAGS
// flags: some flags
2010 static uint_fast8_t irmp_bit
; // current bit position
2011 static IRMP_PARAMETER irmp_param
;
2013 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2014 static IRMP_PARAMETER irmp_param2
;
2017 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
2018 static volatile uint_fast8_t irmp_protocol
;
2019 static volatile uint_fast16_t irmp_address
;
2020 static volatile uint_fast16_t irmp_command
;
2021 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
2022 static volatile uint_fast8_t irmp_flags
;
2023 // static volatile uint_fast8_t irmp_busy_flag;
2026 #define input(x) (x)
2027 static uint_fast8_t IRMP_PIN
;
2028 static uint_fast8_t radio
;
2031 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2032 * Initialize IRMP decoder
2033 * @details Configures IRMP input pin
2034 *---------------------------------------------------------------------------------------------------------------------------------------------------
2040 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
2041 #elif defined (ARM_STM32) // STM32
2042 GPIO_InitTypeDef GPIO_InitStructure
;
2044 /* GPIOx clock enable */
2045 # if defined (ARM_STM32L1XX)
2046 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2047 # elif defined (ARM_STM32F10X)
2048 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2049 # elif defined (ARM_STM32F4XX)
2050 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2053 /* GPIO Configuration */
2054 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
2055 # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
2056 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
2057 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2058 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
2059 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
2060 # elif defined (ARM_STM32F10X)
2061 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2062 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
2064 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
2066 #elif defined(STELLARIS_ARM_CORTEX_M4)
2067 // Enable the GPIO port
2068 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
2071 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
2072 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_STRENGTH_2MA
, GPIO_PIN_TYPE_STD_WPU
);
2074 #elif defined(__SDCC_stm8) // STM8
2075 IRMP_GPIO_STRUCT
->DDR
&= ~(1<<IRMP_BIT
); // pin is input
2076 IRMP_GPIO_STRUCT
->CR1
|= (1<<IRMP_BIT
); // activate pullup
2078 #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
2079 pinMode(IRMP_PIN
, INPUT
);
2082 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
2083 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
2086 #if IRMP_LOGGING == 1
2091 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2093 * @details gets decoded IRMP data
2094 * @param pointer in order to store IRMP data
2095 * @return TRUE: successful, FALSE: failed
2096 *---------------------------------------------------------------------------------------------------------------------------------------------------
2099 irmp_get_data (IRMP_DATA
* irmp_data_p
)
2101 uint_fast8_t rtc
= FALSE
;
2103 if (irmp_ir_detected
)
2105 switch (irmp_protocol
)
2107 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2108 case IRMP_SAMSUNG_PROTOCOL
:
2109 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2111 irmp_command
&= 0xff;
2112 irmp_command
|= irmp_id
<< 8;
2117 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2118 case IRMP_SAMSUNG48_PROTOCOL
:
2119 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2125 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2126 case IRMP_NEC_PROTOCOL
:
2127 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2129 irmp_command
&= 0xff;
2132 else if (irmp_address
== 0x87EE)
2135 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2137 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2138 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2139 irmp_command
&= 0x00FF;
2144 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2145 case IRMP_BOSE_PROTOCOL
:
2146 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2148 irmp_command
&= 0xff;
2153 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2154 case IRMP_SIEMENS_PROTOCOL
:
2155 case IRMP_RUWIDO_PROTOCOL
:
2156 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2163 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2164 case IRMP_KATHREIN_PROTOCOL
:
2165 if (irmp_command
!= 0x0000)
2171 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2172 case IRMP_RC5_PROTOCOL
:
2173 irmp_address
&= ~0x20; // clear toggle bit
2177 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2178 case IRMP_S100_PROTOCOL
:
2179 irmp_address
&= ~0x20; // clear toggle bit
2183 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2184 case IRMP_IR60_PROTOCOL
:
2185 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2192 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2197 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2198 case IRMP_RCCAR_PROTOCOL
:
2199 // frame in irmp_data:
2200 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2201 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2202 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2203 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2204 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2205 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2206 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2210 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2211 case IRMP_NETBOX_PROTOCOL
:
2212 if (irmp_command
& 0x1000) // last bit set?
2214 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2217 irmp_command
&= 0x7F;
2220 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2223 irmp_command
|= 0x80;
2229 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2236 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2241 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2242 case IRMP_LEGO_PROTOCOL
:
2244 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2246 if ((irmp_command
& 0x000F) == crc
)
2254 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2256 // rtc = TRUE; // don't accept codes with CRC errors
2271 irmp_data_p
->protocol
= irmp_protocol
;
2272 irmp_data_p
->address
= irmp_address
;
2273 irmp_data_p
->command
= irmp_command
;
2274 irmp_data_p
->flags
= irmp_flags
;
2280 irmp_ir_detected
= FALSE
;
2286 #if IRMP_USE_CALLBACK == 1
2288 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2290 irmp_callback_ptr
= cb
;
2292 #endif // IRMP_USE_CALLBACK == 1
2294 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2295 static uint_fast16_t irmp_tmp_address
; // ir address
2296 static uint_fast16_t irmp_tmp_command
; // ir command
2298 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2299 static uint_fast16_t irmp_tmp_address2
; // ir address
2300 static uint_fast16_t irmp_tmp_command2
; // ir command
2303 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2304 static uint_fast16_t irmp_lgair_address
; // ir address
2305 static uint_fast16_t irmp_lgair_command
; // ir command
2308 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2309 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2311 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2312 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2313 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2316 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2317 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2320 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2322 * @details store bit in temp address or temp command
2323 * @param value to store: 0 or 1
2324 *---------------------------------------------------------------------------------------------------------------------------------------------------
2326 // verhindert, dass irmp_store_bit() inline compiliert wird:
2327 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2330 irmp_store_bit (uint_fast8_t value
)
2332 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2333 if (irmp_param
.protocol
== IRMP_ACP24_PROTOCOL
) // squeeze 64 bits into 16 bits:
2339 // 0123456789012345678901234567890123456789012345678901234567890123456789
2340 // N VVMMM ? ??? t vmA x y TTTT
2342 // irmp_data_p->command:
2349 case 0: irmp_tmp_command
|= (1<<15); break; // N
2350 case 2: irmp_tmp_command
|= (1<<13); break; // V
2351 case 3: irmp_tmp_command
|= (1<<12); break; // V
2352 case 4: irmp_tmp_command
|= (1<<10); break; // M
2353 case 5: irmp_tmp_command
|= (1<< 9); break; // M
2354 case 6: irmp_tmp_command
|= (1<< 8); break; // M
2355 case 20: irmp_tmp_command
|= (1<< 6); break; // t
2356 case 22: irmp_tmp_command
|= (1<<11); break; // v
2357 case 23: irmp_tmp_command
|= (1<< 7); break; // m
2358 case 24: irmp_tmp_command
|= (1<<14); break; // A
2359 case 26: irmp_tmp_command
|= (1<< 5); break; // x
2360 case 44: irmp_tmp_command
|= (1<< 4); break; // y
2361 case 66: irmp_tmp_command
|= (1<< 3); break; // T
2362 case 67: irmp_tmp_command
|= (1<< 2); break; // T
2363 case 68: irmp_tmp_command
|= (1<< 1); break; // T
2364 case 69: irmp_tmp_command
|= (1<< 0); break; // T
2369 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2371 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2372 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2381 else if (irmp_bit
== 14)
2383 if (value
) // value == 1: even parity
2387 parity
= PARITY_CHECK_FAILED
;
2391 parity
= PARITY_CHECK_OK
;
2396 if (parity
& 0x01) // value == 0: odd parity
2398 parity
= PARITY_CHECK_OK
;
2402 parity
= PARITY_CHECK_FAILED
;
2413 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2414 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2421 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2423 if (irmp_param
.lsb_first
)
2425 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2429 irmp_tmp_address
<<= 1;
2430 irmp_tmp_address
|= value
;
2433 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2435 if (irmp_param
.lsb_first
)
2437 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2438 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2440 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2445 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2450 irmp_tmp_command
<<= 1;
2451 irmp_tmp_command
|= value
;
2455 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2456 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2460 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2461 irmp_lgair_address
|= value
;
2463 else if (irmp_bit
< 24)
2465 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2466 irmp_lgair_command
|= value
;
2472 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2473 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2475 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2480 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2481 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2483 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2488 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2489 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2491 if (irmp_bit
>= 20 && irmp_bit
< 24)
2493 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2495 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2497 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2500 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2504 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2508 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2521 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2523 * @details store bit in temp address or temp command
2524 * @param value to store: 0 or 1
2525 *---------------------------------------------------------------------------------------------------------------------------------------------------
2527 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2529 irmp_store_bit2 (uint_fast8_t value
)
2531 uint_fast8_t irmp_bit2
;
2533 if (irmp_param
.protocol
)
2535 irmp_bit2
= irmp_bit
- 2;
2539 irmp_bit2
= irmp_bit
- 1;
2542 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2544 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2546 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2548 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2551 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2553 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2555 * @details ISR routine, called 10000 times per second
2556 *---------------------------------------------------------------------------------------------------------------------------------------------------
2561 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2562 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2563 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2564 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2565 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2566 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2567 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2568 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2569 static uint_fast8_t repetition_frame_number
;
2570 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2571 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2572 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2574 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2575 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2577 #if IRMP_SUPPORT_MANCHESTER == 1
2578 static PAUSE_LEN last_pause
; // last pause value
2580 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2581 static uint_fast8_t last_value
; // last bit value
2583 uint_fast8_t irmp_input
; // input value
2589 #if defined(__SDCC_stm8)
2590 irmp_input
= input(IRMP_GPIO_STRUCT
->IDR
)
2592 irmp_input
= input(IRMP_PIN
);
2595 #if IRMP_USE_CALLBACK == 1
2596 if (irmp_callback_ptr
)
2598 static uint_fast8_t last_inverted_input
;
2600 if (last_inverted_input
!= !irmp_input
)
2602 (*irmp_callback_ptr
) (! irmp_input
);
2603 last_inverted_input
= !irmp_input
;
2606 #endif // IRMP_USE_CALLBACK == 1
2608 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2610 if (! irmp_ir_detected
) // ir code already detected?
2612 if (! irmp_start_bit_detected
) // start bit detected?
2614 if (! irmp_input
) // receiving burst?
2616 // irmp_busy_flag = TRUE;
2618 if (! irmp_pulse_time
)
2620 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2623 irmp_pulse_time
++; // increment counter
2627 if (irmp_pulse_time
) // it's dark....
2628 { // set flags for counting the time of darkness...
2629 irmp_start_bit_detected
= 1;
2630 wait_for_start_space
= 1;
2632 irmp_tmp_command
= 0;
2633 irmp_tmp_address
= 0;
2634 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2637 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2641 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2642 irmp_tmp_command2
= 0;
2643 irmp_tmp_address2
= 0;
2645 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2646 irmp_lgair_command
= 0;
2647 irmp_lgair_address
= 0;
2650 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2651 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2652 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2657 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2659 key_repetition_len
++;
2661 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2662 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2664 denon_repetition_len
++;
2666 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2669 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2670 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2672 last_irmp_denon_command
= 0;
2673 denon_repetition_len
= 0xFFFF;
2676 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2683 if (wait_for_start_space
) // we have received start bit...
2684 { // ...and are counting the time of darkness
2685 if (irmp_input
) // still dark?
2687 irmp_pause_time
++; // increment counter
2689 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2690 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
) ||
2691 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2693 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2696 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2697 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2702 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2705 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
);
2706 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2710 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2711 irmp_pulse_time
= 0;
2712 irmp_pause_time
= 0;
2716 { // receiving first data pulse!
2717 IRMP_PARAMETER
* irmp_param_p
;
2718 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2720 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2721 irmp_param2
.protocol
= 0;
2725 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2728 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2729 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2730 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2733 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2734 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2735 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2737 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2740 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2742 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2743 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2744 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2745 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2748 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2749 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2750 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2752 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2755 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2757 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2758 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2759 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2761 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2763 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2764 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2765 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2767 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2770 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2771 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2772 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2774 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2777 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2778 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2780 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2781 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2782 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2784 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2785 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2786 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2788 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2791 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2794 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2795 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2796 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2799 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2804 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2805 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2806 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2807 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2808 { // it's JVC repetition type 3
2810 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2811 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2812 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2814 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2817 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2819 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2821 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2822 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2823 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2826 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2827 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2828 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2830 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2833 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2835 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2836 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2837 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2840 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2841 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2842 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2844 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2847 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2849 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2850 if (irmp_pulse_time
>= ACP24_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ACP24_START_BIT_PULSE_LEN_MAX
&&
2851 irmp_pause_time
>= ACP24_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ACP24_START_BIT_PAUSE_LEN_MAX
)
2854 ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2855 ACP24_START_BIT_PULSE_LEN_MIN
, ACP24_START_BIT_PULSE_LEN_MAX
,
2856 ACP24_START_BIT_PAUSE_LEN_MIN
, ACP24_START_BIT_PAUSE_LEN_MAX
);
2858 irmp_param_p
= (IRMP_PARAMETER
*) &acp24_param
;
2861 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2863 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2864 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
2865 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
2868 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2869 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
2870 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
2872 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
2875 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2877 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2878 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2879 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2882 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2883 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2884 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2886 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2889 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2891 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2892 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2893 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2896 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2897 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2898 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2900 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2903 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2905 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2906 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2907 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2908 { // it's MATSUSHITA
2910 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2911 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2912 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2914 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2917 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2919 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2920 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2921 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2924 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2925 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2926 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2928 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2931 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2933 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
2934 if (irmp_pulse_time
>= PANASONIC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PANASONIC_START_BIT_PULSE_LEN_MAX
&&
2935 irmp_pause_time
>= PANASONIC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PANASONIC_START_BIT_PAUSE_LEN_MAX
)
2938 ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2939 PANASONIC_START_BIT_PULSE_LEN_MIN
, PANASONIC_START_BIT_PULSE_LEN_MAX
,
2940 PANASONIC_START_BIT_PAUSE_LEN_MIN
, PANASONIC_START_BIT_PAUSE_LEN_MAX
);
2942 irmp_param_p
= (IRMP_PARAMETER
*) &panasonic_param
;
2945 #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
2947 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2948 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2949 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2952 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2953 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2954 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2956 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2959 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2961 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2962 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2963 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2966 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2967 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2968 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2970 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2973 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2975 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2976 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
2977 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
2978 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
2979 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
2982 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2983 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
2984 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
2985 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
2986 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
2989 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
2990 last_pause
= irmp_pause_time
;
2992 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
2993 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
2996 rc5_cmd_bit6
= 1<<6;
3004 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
3006 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3007 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
3008 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
3009 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
3010 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
3012 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3013 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3014 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3017 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
3018 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3019 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3020 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3021 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3022 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3023 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3025 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
3028 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3030 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3031 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3032 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3035 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
3036 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3037 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3038 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3039 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3040 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3041 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3043 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
3046 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3049 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3050 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3051 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
3052 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3053 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
3057 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
3058 last_pause
= irmp_pause_time
;
3060 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
3061 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
3064 rc5_cmd_bit6
= 1<<6;
3072 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
3074 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3075 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
3076 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
3077 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
3080 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3081 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
3082 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
3083 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
3085 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
3088 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3090 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3091 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
3092 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
3093 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
3096 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3097 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3098 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
3099 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
3101 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
3104 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3106 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3107 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
3108 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
3111 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3112 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
3113 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
3115 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
3118 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3120 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3121 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
3122 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
3125 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3126 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
3127 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
3129 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
3134 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3136 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3137 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
3138 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
3141 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3142 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
3143 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
3145 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
3148 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3150 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3151 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
3152 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
3155 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3156 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
3157 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
3159 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
3162 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3164 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3165 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
3166 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
3169 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3170 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
3171 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
3173 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
3176 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3178 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3179 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3180 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3183 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3184 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3185 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3187 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3190 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3192 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3193 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3194 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3195 { // it's BANG_OLUFSEN
3197 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3198 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3199 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3200 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3201 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3202 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3203 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3204 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3205 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3206 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3207 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3208 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3209 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3211 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3215 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3217 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3218 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3219 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3222 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3223 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3224 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3226 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3227 last_pause
= irmp_pause_time
;
3231 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3233 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3234 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3235 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3238 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3239 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3240 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3242 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3247 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3249 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3250 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3251 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3252 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3253 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3254 { // it's RUWIDO or SIEMENS
3256 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3257 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3258 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3259 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3260 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3262 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3263 last_pause
= irmp_pause_time
;
3267 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3269 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3270 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3271 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3274 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3275 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3276 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3278 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3281 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3283 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3284 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3285 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3288 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3289 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3290 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3292 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3295 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3297 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3298 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3299 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3302 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3303 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3304 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3306 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3309 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3311 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3312 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3313 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3316 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3317 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3318 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3320 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3323 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3325 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3326 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3327 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3330 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3331 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3332 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3334 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3337 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3339 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3340 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3341 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3344 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3345 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3346 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3348 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3353 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3355 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3356 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3357 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3358 { // it's ORTEK (Hama)
3360 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3361 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3362 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3364 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3370 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3372 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3373 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3374 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3377 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3378 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3379 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3381 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3384 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3387 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3389 irmp_start_bit_detected
= 0; // wait for another start bit...
3392 if (irmp_start_bit_detected
)
3394 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3396 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3399 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3400 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3406 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3407 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3408 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3409 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3413 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3414 if (irmp_param2
.protocol
)
3417 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3418 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3419 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3420 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3426 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3427 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3430 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3435 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3438 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3439 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3445 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3446 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3447 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3448 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3453 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3454 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3456 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3457 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3461 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3462 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3463 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3464 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3470 #if IRMP_SUPPORT_MANCHESTER == 1
3471 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3472 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3473 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3475 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3478 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3479 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3482 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3484 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3487 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3488 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3491 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3495 #endif // IRMP_SUPPORT_MANCHESTER == 1
3497 #if IRMP_SUPPORT_SERIAL == 1
3498 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3503 #endif // IRMP_SUPPORT_SERIAL == 1
3506 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3507 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3510 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3513 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3514 { // pause timings correct for "1"?
3516 ANALYZE_PUTCHAR ('1'); // yes, store 1
3521 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3522 { // pause timings correct for "0"?
3524 ANALYZE_PUTCHAR ('0'); // yes, store 0
3531 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3532 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3533 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3536 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3539 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3540 { // pause timings correct for "1"?
3542 ANALYZE_PUTCHAR ('1'); // yes, store 1
3547 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3548 { // pause timings correct for "0"?
3550 ANALYZE_PUTCHAR ('0'); // yes, store 0
3557 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3559 ; // else do nothing
3562 irmp_pulse_time
= 1; // set counter to 1, not 0
3563 irmp_pause_time
= 0;
3564 wait_for_start_space
= 0;
3567 else if (wait_for_space
) // the data section....
3568 { // counting the time of darkness....
3569 uint_fast8_t got_light
= FALSE
;
3571 if (irmp_input
) // still dark?
3573 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3576 #if IRMP_SUPPORT_MANCHESTER == 1
3577 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3579 #if IRMP_SUPPORT_SERIAL == 1
3580 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3582 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3585 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3587 ANALYZE_PRINTF ("stop bit detected\n");
3590 irmp_param
.stop_bit
= 0;
3595 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",
3596 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3598 irmp_start_bit_detected
= 0; // wait for another start bit...
3599 irmp_pulse_time
= 0;
3600 irmp_pause_time
= 0;
3605 irmp_pause_time
++; // increment counter
3607 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3608 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3609 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3610 irmp_bit
>= 12 - 1) // pause too long?
3611 { // yes, break and close this frame
3612 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3613 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3614 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3615 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3616 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3620 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3621 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3622 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3623 { // yes, break and close this frame
3624 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3627 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3629 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3631 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3634 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3636 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3641 #if IRMP_SUPPORT_SERIAL == 1
3642 // NETBOX generates no stop bit, here is the timeout condition:
3643 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3644 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3646 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3650 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3651 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3653 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3656 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3658 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3659 irmp_param
.stop_bit
= TRUE
; // set flag
3661 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3662 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3663 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3664 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3665 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3666 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3668 irmp_tmp_command
<<= 1;
3669 irmp_tmp_command
|= first_bit
;
3671 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3672 { // special manchester decoder
3673 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3674 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3675 irmp_param
.stop_bit
= TRUE
; // set flag
3677 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3680 ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit
);
3682 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3683 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3684 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3685 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3686 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3688 if (irmp_tmp_command
& 0x300)
3690 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3691 irmp_tmp_command
&= 0xFF;
3697 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3698 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3700 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3701 { // special manchester decoder
3702 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3703 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3704 irmp_param
.stop_bit
= TRUE
; // set flag
3706 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3709 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3711 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3712 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3713 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3714 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3715 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3718 // RUWIDO: AAAAAAAAACCCCCCCp
3719 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3720 irmp_tmp_address
<<= 2;
3721 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3722 irmp_tmp_command
&= 0x003F;
3723 // irmp_tmp_command <<= 4;
3724 irmp_tmp_command
|= last_value
;
3729 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3730 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3731 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3732 { // break and close this frame
3733 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3735 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3737 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3739 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3742 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3746 #if IRMP_SUPPORT_MANCHESTER == 1
3747 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3748 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3749 { // special manchester decoder
3750 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3751 irmp_param
.stop_bit
= TRUE
; // set flag
3754 #endif // IRMP_SUPPORT_MANCHESTER == 1
3755 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3757 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3761 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3762 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3765 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3767 irmp_param
.stop_bit
= TRUE
; // set flag
3768 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3769 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3770 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3771 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3772 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3774 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3775 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3776 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3779 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3781 irmp_param
.stop_bit
= TRUE
; // set flag
3782 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3783 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3784 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3785 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3786 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3788 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3790 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3791 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3792 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3795 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3797 irmp_param
.stop_bit
= TRUE
; // set flag
3798 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3799 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3801 // 0123456789ABC0123456789ABC0123456701234567
3802 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3803 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3804 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3805 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3807 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3808 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3809 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3812 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3814 irmp_param
.stop_bit
= TRUE
; // set flag
3815 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3816 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3817 irmp_tmp_address
= irmp_lgair_address
;
3818 irmp_tmp_command
= irmp_lgair_command
;
3820 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3821 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3822 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3825 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3827 irmp_param
.stop_bit
= TRUE
; // set flag
3828 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3829 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3831 // 0123456789ABC0123456789ABC0123456701234567
3832 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3833 // JVC: AAAACCCCCCCCCCCC
3834 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3835 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3837 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3838 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3840 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3841 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3844 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3846 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3847 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3848 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3849 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3851 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3853 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3854 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3858 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3859 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3862 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3864 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3866 else // if ((irmp_bit == 24)
3869 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3871 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3873 irmp_param
.stop_bit
= TRUE
; // set flag
3874 irmp_param
.complete_len
= irmp_bit
; // patch length
3876 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3878 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
3879 else if (irmp_param
.protocol
== IRMP_MATSUSHITA_PROTOCOL
&& irmp_bit
== 22) // it was a TECHNICS stop bit
3882 ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit
);
3885 // The first 12 bits have been stored in irmp_tmp_command (LSB first)
3886 // The following 10 bits have been stored in irmp_tmp_address (LSB first)
3887 // The code of TECHNICS is:
3888 // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)
3889 // ccccccccccccaaaaaaaaaa
3890 // where C is inverted value of c
3892 irmp_tmp_address
<<= 1;
3893 if (irmp_tmp_command
& (1<<11))
3895 irmp_tmp_address
|= 1;
3896 irmp_tmp_command
&= ~(1<<11);
3899 if (irmp_tmp_command
== ((~irmp_tmp_address
) & 0x07FF))
3901 irmp_tmp_address
= 0;
3903 irmp_param
.protocol
= IRMP_TECHNICS_PROTOCOL
; // switch protocol
3904 irmp_param
.complete_len
= irmp_bit
; // patch length
3909 ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");
3910 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3912 irmp_start_bit_detected
= 0; // wait for another start bit...
3913 irmp_pulse_time
= 0;
3914 irmp_pause_time
= 0;
3917 #endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
3921 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3922 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3924 irmp_start_bit_detected
= 0; // wait for another start bit...
3925 irmp_pulse_time
= 0;
3926 irmp_pause_time
= 0;
3939 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3942 #if IRMP_SUPPORT_MANCHESTER == 1
3943 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3946 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3947 #else // better, but some IR-RCs use asymmetric timings :-/
3948 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3949 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3952 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3953 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3956 ANALYZE_PUTCHAR ('T');
3958 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3973 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3976 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3978 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
3980 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3981 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3984 ANALYZE_PUTCHAR ('T');
3988 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
4001 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4004 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
4006 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
4007 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4008 if (! irmp_param2
.protocol
)
4015 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
4019 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
4020 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
4022 uint_fast8_t manchester_value
;
4024 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
4026 manchester_value
= last_value
? 0 : 1;
4027 last_value
= manchester_value
;
4031 manchester_value
= last_value
;
4035 ANALYZE_PUTCHAR (manchester_value
+ '0');
4038 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4039 if (! irmp_param2
.protocol
)
4047 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4048 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
4051 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
4053 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
4054 irmp_param
.address_offset
= 5;
4055 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
4056 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
4057 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
4058 irmp_tmp_address
= 0;
4060 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4062 irmp_store_bit (manchester_value
);
4066 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4067 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
4068 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
4069 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
4070 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
4073 ANALYZE_PUTCHAR ('?');
4075 irmp_param
.protocol
= 0; // switch to FDC, see below
4078 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4079 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4080 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
4081 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
4082 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
4083 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
4086 ANALYZE_PUTCHAR ('?');
4088 irmp_param
.protocol
= 0; // switch to RCCAR, see below
4091 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4094 ANALYZE_PUTCHAR ('?');
4096 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4097 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4099 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4100 irmp_pause_time
= 0;
4104 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4105 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
4107 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
4110 ANALYZE_PRINTF (" 1 (FDC)\n");
4112 irmp_store_bit2 (1);
4114 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
4117 ANALYZE_PRINTF (" 0 (FDC)\n");
4119 irmp_store_bit2 (0);
4122 if (! irmp_param
.protocol
)
4125 ANALYZE_PRINTF ("Switching to FDC protocol\n");
4127 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4128 irmp_param2
.protocol
= 0;
4129 irmp_tmp_address
= irmp_tmp_address2
;
4130 irmp_tmp_command
= irmp_tmp_command2
;
4133 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4134 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4135 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
4137 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
4140 ANALYZE_PRINTF (" 1 (RCCAR)\n");
4142 irmp_store_bit2 (1);
4144 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
4147 ANALYZE_PRINTF (" 0 (RCCAR)\n");
4149 irmp_store_bit2 (0);
4152 if (! irmp_param
.protocol
)
4155 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4157 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4158 irmp_param2
.protocol
= 0;
4159 irmp_tmp_address
= irmp_tmp_address2
;
4160 irmp_tmp_command
= irmp_tmp_command2
;
4163 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4165 last_pause
= irmp_pause_time
;
4169 #endif // IRMP_SUPPORT_MANCHESTER == 1
4171 #if IRMP_SUPPORT_SERIAL == 1
4172 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
4174 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
4177 ANALYZE_PUTCHAR ('1');
4181 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
4183 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
4187 irmp_pulse_time
= 0;
4191 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
4194 ANALYZE_PUTCHAR ('0');
4198 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
4200 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
4204 irmp_pause_time
= 0;
4213 #endif // IRMP_SUPPORT_SERIAL == 1
4215 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4216 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
4218 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
4219 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4222 ANALYZE_PRINTF ("SYNC\n");
4227 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4229 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4231 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4233 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4234 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4235 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4236 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4239 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4241 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4242 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4243 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4244 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4246 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4249 ANALYZE_PUTCHAR ('1');
4258 ANALYZE_PUTCHAR ('0');
4266 { // timing incorrect!
4268 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4269 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4271 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4272 irmp_pause_time
= 0;
4276 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4278 #if IRMP_SUPPORT_NEC16_PROTOCOL
4279 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4280 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4281 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4282 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4283 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4284 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4287 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4289 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4290 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4291 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4292 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4293 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4294 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4298 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4300 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4301 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4303 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4305 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4307 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4310 ANALYZE_PRINTF ("3rd start bit\n");
4316 { // timing incorrect!
4318 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
);
4319 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4321 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4322 irmp_pause_time
= 0;
4325 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4327 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4330 ANALYZE_PRINTF ("trailer bit\n");
4336 { // timing incorrect!
4338 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
);
4339 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4341 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4342 irmp_pause_time
= 0;
4347 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4348 { // pulse & pause timings correct for "1"?
4350 ANALYZE_PUTCHAR ('1');
4357 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4358 { // pulse & pause timings correct for "0"?
4360 ANALYZE_PUTCHAR ('0');
4367 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4370 ANALYZE_PUTCHAR (last_value
+ '0');
4373 irmp_store_bit (last_value
);
4377 { // timing incorrect!
4379 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
);
4380 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4382 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4383 irmp_pause_time
= 0;
4388 { // timing incorrect!
4390 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
);
4391 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4393 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4394 irmp_pause_time
= 0;
4398 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4400 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4401 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4403 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4406 ANALYZE_PUTCHAR ('0');
4407 ANALYZE_PUTCHAR ('0');
4412 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4415 ANALYZE_PUTCHAR ('0');
4416 ANALYZE_PUTCHAR ('1');
4421 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4424 ANALYZE_PUTCHAR ('1');
4425 ANALYZE_PUTCHAR ('0');
4430 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4433 ANALYZE_PUTCHAR ('1');
4434 ANALYZE_PUTCHAR ('1');
4440 ANALYZE_PRINTF ("\n");
4447 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4448 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4449 { // pulse & pause timings correct for "1"?
4451 ANALYZE_PUTCHAR ('1');
4457 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4458 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4459 { // pulse & pause timings correct for "0"?
4461 ANALYZE_PUTCHAR ('0');
4468 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4470 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4471 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4472 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4473 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4475 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4482 ANALYZE_PUTCHAR ('S');
4485 irmp_tmp_command
<<= 1;
4490 ANALYZE_PUTCHAR ('S');
4498 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4499 { // timing incorrect!
4501 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4502 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4504 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4505 irmp_pause_time
= 0;
4508 irmp_pulse_time
= 1; // set counter to 1, not 0
4512 { // counting the pulse length ...
4513 if (! irmp_input
) // still light?
4515 irmp_pulse_time
++; // increment counter
4519 wait_for_space
= 1; // let's count the time (see above)
4520 irmp_pause_time
= 1; // set pause counter to 1, not 0
4524 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4526 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4528 repetition_frame_number
++;
4532 repetition_frame_number
= 0;
4535 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4536 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4537 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4540 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4541 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4543 key_repetition_len
= 0;
4548 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4549 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4550 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4553 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4554 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4556 key_repetition_len
= 0;
4561 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4562 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4563 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4566 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4567 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4569 key_repetition_len
= 0;
4574 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4575 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4576 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4579 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4580 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4582 key_repetition_len
= 0;
4587 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4588 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4589 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4592 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4593 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4595 key_repetition_len
= 0;
4600 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4601 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4602 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4605 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4606 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4608 key_repetition_len
= 0;
4615 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4617 irmp_ir_detected
= TRUE
;
4619 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4620 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4621 { // check for repetition frame
4622 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4624 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4625 last_irmp_denon_command
= 0;
4627 irmp_protocol
= irmp_param
.protocol
; // store protocol
4628 irmp_address
= irmp_tmp_address
; // store address
4629 irmp_command
= irmp_tmp_command
; // store command
4633 if ((irmp_tmp_command
& 0x01) == 0x00)
4636 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4638 last_irmp_denon_command
= irmp_tmp_command
;
4639 denon_repetition_len
= 0;
4640 irmp_ir_detected
= FALSE
;
4645 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4647 last_irmp_denon_command
= 0;
4648 irmp_ir_detected
= FALSE
;
4653 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4655 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4656 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4657 { // Grundig start frame?
4659 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4661 irmp_ir_detected
= FALSE
;
4664 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4666 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4667 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4668 { // Nokia start frame?
4670 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4672 irmp_ir_detected
= FALSE
;
4675 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4677 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4678 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4680 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4683 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4684 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4686 irmp_tmp_address
= last_irmp_address
; // address is last address
4687 irmp_tmp_command
= last_irmp_command
; // command is last command
4688 irmp_flags
|= IRMP_FLAG_REPETITION
;
4689 key_repetition_len
= 0;
4694 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4695 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4697 irmp_ir_detected
= FALSE
;
4700 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4702 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4703 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4705 uint_fast8_t xor_value
;
4707 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4709 if (xor_value
!= (xor_check
[2] & 0x0F))
4712 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4714 irmp_ir_detected
= FALSE
;
4717 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4719 if (xor_value
!= xor_check
[5])
4722 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4724 irmp_ir_detected
= FALSE
;
4727 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4729 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4731 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4732 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4734 if (parity
== PARITY_CHECK_FAILED
)
4737 ANALYZE_PRINTF ("error 6: parity check failed\n");
4739 irmp_ir_detected
= FALSE
;
4742 if ((irmp_tmp_address
& 0x03) == 0x02)
4745 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4747 irmp_ir_detected
= FALSE
;
4749 irmp_tmp_address
>>= 2;
4751 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4753 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4754 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4756 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4759 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4761 irmp_protocol
= irmp_param
.protocol
;
4764 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4765 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4767 if (irmp_tmp_command
& 0x000F) // released key?
4769 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4773 irmp_tmp_command
>>= 4; // no, it's a pressed key
4775 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4776 irmp_tmp_address
&= 0x003F;
4780 irmp_address
= irmp_tmp_address
; // store address
4781 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4782 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4784 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4788 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4789 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4791 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4794 #if IRMP_SUPPORT_S100_PROTOCOL == 1
4795 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
4797 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4800 irmp_command
= irmp_tmp_command
; // store command
4802 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4803 irmp_id
= irmp_tmp_id
;
4808 if (irmp_ir_detected
)
4810 if (last_irmp_command
== irmp_tmp_command
&&
4811 last_irmp_address
== irmp_tmp_address
&&
4812 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4814 irmp_flags
|= IRMP_FLAG_REPETITION
;
4817 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4818 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4820 key_repetition_len
= 0;
4825 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4829 irmp_start_bit_detected
= 0; // and wait for next start bit
4830 irmp_tmp_command
= 0;
4831 irmp_pulse_time
= 0;
4832 irmp_pause_time
= 0;
4834 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4835 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4836 { // set pulse time here!
4837 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4839 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4844 #if defined(STELLARIS_ARM_CORTEX_M4)
4845 // Clear the timer interrupt
4846 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4849 return (irmp_ir_detected
);
4854 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4855 * main functions - for Unix/Linux + Windows only!
4859 * Compile it under linux with:
4862 * usage: ./irmp [-v|-s|-a|-l] < file
4868 * -l list pulse/pauses
4869 *---------------------------------------------------------------------------------------------------------------------------------------------------
4873 print_spectrum (char * text
, int * buf
, int is_pulse
)
4886 puts ("-----------------------------------------------------------------------------");
4887 printf ("%s:\n", text
);
4889 for (i
= 0; i
< 256; i
++)
4891 if (buf
[i
] > max_value
)
4897 for (i
= 1; i
< 200; i
++)
4902 value
= (buf
[i
] * 60) / max_value
;
4904 for (j
= 0; j
< value
; j
++)
4908 printf (" %d\n", buf
[i
]);
4919 average
= (float) sum
/ (float) counter
;
4930 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4931 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4932 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4934 tolerance
= (max
- average
);
4936 if (average
- min
> tolerance
)
4938 tolerance
= average
- min
;
4941 tolerance
= tolerance
* 100 / average
;
4942 printf ("tol: %4.1f%%\n", tolerance
);
4952 #define STATE_LEFT_SHIFT 0x01
4953 #define STATE_RIGHT_SHIFT 0x02
4954 #define STATE_LEFT_CTRL 0x04
4955 #define STATE_LEFT_ALT 0x08
4956 #define STATE_RIGHT_ALT 0x10
4958 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4959 #define KEY_MENUE 0x80 // keycode = 0x0070
4960 #define KEY_BACK 0x81 // keycode = 0x0071
4961 #define KEY_FORWARD 0x82 // keycode = 0x0072
4962 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4963 #define KEY_WINDOW 0x84 // keycode = 0x0074
4964 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4965 #define KEY_STOP 0x86 // keycode = 0x0076
4966 #define KEY_MAIL 0x87 // keycode = 0x0077
4967 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4968 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4969 #define KEY_SETUP 0x8A // keycode = 0x007a
4970 #define KEY_FONT 0x8B // keycode = 0x007b
4971 #define KEY_PRINT 0x8C // keycode = 0x007c
4972 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4974 #define KEY_INSERT 0x90 // keycode = 0x004b
4975 #define KEY_DELETE 0x91 // keycode = 0x004c
4976 #define KEY_LEFT 0x92 // keycode = 0x004f
4977 #define KEY_HOME 0x93 // keycode = 0x0050
4978 #define KEY_END 0x94 // keycode = 0x0051
4979 #define KEY_UP 0x95 // keycode = 0x0053
4980 #define KEY_DOWN 0x96 // keycode = 0x0054
4981 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
4982 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
4983 #define KEY_RIGHT 0x99 // keycode = 0x0059
4984 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
4985 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
4988 get_fdc_key (uint_fast16_t cmd
)
4990 static uint8_t key_table
[128] =
4992 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
4993 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
4994 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
4995 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
4996 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
4998 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
4999 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
5000 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
5001 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5003 static uint_fast8_t state
;
5005 uint_fast8_t key
= 0;
5009 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
5010 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
5011 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
5012 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
5013 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
5014 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
5015 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
5016 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
5017 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
5018 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
5020 case 0x006e: key
= KEY_ESCAPE
; break;
5021 case 0x004b: key
= KEY_INSERT
; break;
5022 case 0x004c: key
= KEY_DELETE
; break;
5023 case 0x004f: key
= KEY_LEFT
; break;
5024 case 0x0050: key
= KEY_HOME
; break;
5025 case 0x0051: key
= KEY_END
; break;
5026 case 0x0053: key
= KEY_UP
; break;
5027 case 0x0054: key
= KEY_DOWN
; break;
5028 case 0x0055: key
= KEY_PAGE_UP
; break;
5029 case 0x0056: key
= KEY_PAGE_DOWN
; break;
5030 case 0x0059: key
= KEY_RIGHT
; break;
5031 case 0x0400: key
= KEY_MOUSE_1
; break;
5032 case 0x0800: key
= KEY_MOUSE_2
; break;
5036 if (!(cmd
& 0x80)) // pressed key
5038 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
5040 key
= cmd
+ 0x10; // 7x -> 8x
5042 else if (cmd
< 64) // key listed in key_table
5044 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
5048 case 0x0003: key
= '²'; break;
5049 case 0x0008: key
= '{'; break;
5050 case 0x0009: key
= '['; break;
5051 case 0x000A: key
= ']'; break;
5052 case 0x000B: key
= '}'; break;
5053 case 0x000C: key
= '\\'; break;
5054 case 0x001C: key
= '~'; break;
5055 case 0x002D: key
= '|'; break;
5056 case 0x0034: key
= 0xB5; break; // Mu
5059 else if (state
& (STATE_LEFT_CTRL
))
5061 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
5063 key
= key_table
[cmd
] - 'a' + 1;
5067 key
= key_table
[cmd
];
5072 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5076 key
= key_table
[idx
];
5088 static int analyze
= FALSE
;
5089 static int list
= FALSE
;
5090 static IRMP_DATA irmp_data
;
5091 static int expected_protocol
;
5092 static int expected_address
;
5093 static int expected_command
;
5094 static int do_check_expected_values
;
5099 if (! analyze
&& ! list
)
5103 if (irmp_get_data (&irmp_data
))
5107 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5111 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5114 if (irmp_data
.protocol
== IRMP_ACP24_PROTOCOL
)
5116 uint16_t temp
= (irmp_data
.command
& 0x000F) + 15;
5118 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5119 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, temp
);
5121 else if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5123 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5125 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5126 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5128 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5130 char * p
= (char *) NULL
;
5134 case '\t' : p
= "TAB"; break;
5135 case '\r' : p
= "CR"; break;
5136 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5137 case KEY_MENUE
: p
= "MENUE"; break;
5138 case KEY_BACK
: p
= "BACK"; break;
5139 case KEY_FORWARD
: p
= "FORWARD"; break;
5140 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5141 case KEY_WINDOW
: p
= "WINDOW"; break;
5142 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5143 case KEY_STOP
: p
= "STOP"; break;
5144 case KEY_MAIL
: p
= "MAIL"; break;
5145 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5146 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5147 case KEY_SETUP
: p
= "SETUP"; break;
5148 case KEY_FONT
: p
= "FONT"; break;
5149 case KEY_PRINT
: p
= "PRINT"; break;
5150 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5152 case KEY_INSERT
: p
= "INSERT"; break;
5153 case KEY_DELETE
: p
= "DELETE"; break;
5154 case KEY_LEFT
: p
= "LEFT"; break;
5155 case KEY_HOME
: p
= "HOME"; break;
5156 case KEY_END
: p
= "END"; break;
5157 case KEY_UP
: p
= "UP"; break;
5158 case KEY_DOWN
: p
= "DOWN"; break;
5159 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5160 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5161 case KEY_RIGHT
: p
= "RIGHT"; break;
5162 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5163 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5164 default : p
= "<UNKNWON>"; break;
5167 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5168 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5172 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5173 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5178 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5179 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5182 if (do_check_expected_values
)
5184 if (irmp_data
.protocol
!= expected_protocol
||
5185 irmp_data
.address
!= expected_address
||
5186 irmp_data
.command
!= expected_command
)
5188 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5189 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5193 printf (" checked!\n");
5195 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5206 main (int argc
, char ** argv
)
5214 int start_pulses
[256];
5215 int start_pauses
[256];
5219 int first_pulse
= TRUE
;
5220 int first_pause
= TRUE
;
5224 if (! strcmp (argv
[1], "-v"))
5228 else if (! strcmp (argv
[1], "-l"))
5232 else if (! strcmp (argv
[1], "-a"))
5236 else if (! strcmp (argv
[1], "-s"))
5240 else if (! strcmp (argv
[1], "-r"))
5246 for (i
= 0; i
< 256; i
++)
5248 start_pulses
[i
] = 0;
5249 start_pauses
[i
] = 0;
5256 while ((ch
= getchar ()) != EOF
)
5258 if (ch
== '_' || ch
== '0')
5266 printf ("pause: %d\n", pause
);
5275 start_pauses
[pause
]++;
5277 first_pause
= FALSE
;
5293 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5299 printf ("pulse: %d ", pulse
);
5308 start_pulses
[pulse
]++;
5310 first_pulse
= FALSE
;
5326 else if (ch
== '\n')
5331 if (list
&& pause
> 0)
5333 printf ("pause: %d\n", pause
);
5339 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5353 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5364 puts ("----------------------------------------------------------------------");
5368 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5370 if (ch
!= '\r') // ignore CR in DOS/Windows files
5372 if (ch
== '[' && idx
== -1)
5380 do_check_expected_values
= FALSE
;
5384 expected_protocol
= atoi (buf
);
5386 if (expected_protocol
> 0)
5395 if (sscanf (p
, "%x", &expected_address
) == 1)
5397 do_check_expected_values
= TRUE
;
5404 if (do_check_expected_values
)
5406 do_check_expected_values
= FALSE
;
5414 if (sscanf (p
, "%x", &expected_command
) == 1)
5416 do_check_expected_values
= TRUE
;
5423 if (do_check_expected_values
)
5425 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5430 else if (idx
< 1024 - 2)
5450 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5451 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5452 print_spectrum ("PULSES", pulses
, TRUE
);
5453 print_spectrum ("PAUSES", pauses
, FALSE
);
5454 puts ("-----------------------------------------------------------------------------");