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.184 2016/01/12 11:53:34 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 baud rate, 8 data bits, 1 stop bit, no parity, no 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 baud rate, 8 data bits, 1 stop bit, no parity, no 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 INT level (receive)
852 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; // activated RX and TX
853 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; // 8 Bit
854 PORTC
.DIR |= (1<<7); // TXD is output
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;
2025 #if defined(__MBED__)
2026 // DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp
2027 gpio_t gpioIRin
; // use low level c function instead
2032 #define input(x) (x)
2033 static uint_fast8_t IRMP_PIN
;
2034 static uint_fast8_t radio
;
2037 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2038 * Initialize IRMP decoder
2039 * @details Configures IRMP input pin
2040 *---------------------------------------------------------------------------------------------------------------------------------------------------
2046 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
2047 #elif defined (ARM_STM32) // STM32
2048 GPIO_InitTypeDef GPIO_InitStructure
;
2050 /* GPIOx clock enable */
2051 # if defined (ARM_STM32L1XX)
2052 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2053 # elif defined (ARM_STM32F10X)
2054 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2055 # elif defined (ARM_STM32F4XX)
2056 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2059 /* GPIO Configuration */
2060 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
2061 # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
2062 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
2063 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2064 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
2065 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
2066 # elif defined (ARM_STM32F10X)
2067 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2068 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
2070 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
2072 #elif defined(STELLARIS_ARM_CORTEX_M4)
2073 // Enable the GPIO port
2074 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
2077 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
2078 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_STRENGTH_2MA
, GPIO_PIN_TYPE_STD_WPU
);
2080 #elif defined(__SDCC_stm8) // STM8
2081 IRMP_GPIO_STRUCT
->DDR
&= ~(1<<IRMP_BIT
); // pin is input
2082 IRMP_GPIO_STRUCT
->CR1
|= (1<<IRMP_BIT
); // activate pullup
2084 #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
2085 pinMode(IRMP_PIN
, INPUT
);
2087 #elif defined(__xtensa__) // ESP8266
2088 // select pin function
2089 # if (IRMP_BIT_NUMBER == 12)
2090 PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U
, FUNC_GPIO12
);
2091 // doesn't work for me:
2092 // # elif (IRMP_BIT_NUMBER == 13)
2093 // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);
2095 # warning Please add PIN_FUNC_SELECT when necessary.
2097 GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER
);
2099 #elif defined(__MBED__)
2100 gpio_init_in_ex(&gpioIRin
, IRMP_PIN
, IRMP_PINMODE
); // initialize input for IR diode
2103 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
2104 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
2107 #if IRMP_LOGGING == 1
2112 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2114 * @details gets decoded IRMP data
2115 * @param pointer in order to store IRMP data
2116 * @return TRUE: successful, FALSE: failed
2117 *---------------------------------------------------------------------------------------------------------------------------------------------------
2120 irmp_get_data (IRMP_DATA
* irmp_data_p
)
2122 uint_fast8_t rtc
= FALSE
;
2124 if (irmp_ir_detected
)
2126 switch (irmp_protocol
)
2128 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2129 case IRMP_SAMSUNG_PROTOCOL
:
2130 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2132 irmp_command
&= 0xff;
2133 irmp_command
|= irmp_id
<< 8;
2138 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2139 case IRMP_SAMSUNG48_PROTOCOL
:
2140 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2146 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2147 case IRMP_NEC_PROTOCOL
:
2148 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2150 irmp_command
&= 0xff;
2153 else if (irmp_address
== 0x87EE)
2156 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2158 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2159 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2160 irmp_command
&= 0x00FF;
2165 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2166 case IRMP_BOSE_PROTOCOL
:
2167 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2169 irmp_command
&= 0xff;
2174 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2175 case IRMP_SIEMENS_PROTOCOL
:
2176 case IRMP_RUWIDO_PROTOCOL
:
2177 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2184 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2185 case IRMP_KATHREIN_PROTOCOL
:
2186 if (irmp_command
!= 0x0000)
2192 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2193 case IRMP_RC5_PROTOCOL
:
2194 irmp_address
&= ~0x20; // clear toggle bit
2198 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2199 case IRMP_S100_PROTOCOL
:
2200 irmp_address
&= ~0x20; // clear toggle bit
2204 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2205 case IRMP_IR60_PROTOCOL
:
2206 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2213 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2218 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2219 case IRMP_RCCAR_PROTOCOL
:
2220 // frame in irmp_data:
2221 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2222 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2223 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2224 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2225 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2226 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2227 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2231 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2232 case IRMP_NETBOX_PROTOCOL
:
2233 if (irmp_command
& 0x1000) // last bit set?
2235 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2238 irmp_command
&= 0x7F;
2241 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2244 irmp_command
|= 0x80;
2250 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2257 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2262 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2263 case IRMP_LEGO_PROTOCOL
:
2265 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2267 if ((irmp_command
& 0x000F) == crc
)
2275 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2277 // rtc = TRUE; // don't accept codes with CRC errors
2292 irmp_data_p
->protocol
= irmp_protocol
;
2293 irmp_data_p
->address
= irmp_address
;
2294 irmp_data_p
->command
= irmp_command
;
2295 irmp_data_p
->flags
= irmp_flags
;
2301 irmp_ir_detected
= FALSE
;
2307 #if IRMP_USE_CALLBACK == 1
2309 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2311 irmp_callback_ptr
= cb
;
2313 #endif // IRMP_USE_CALLBACK == 1
2315 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2316 static uint_fast16_t irmp_tmp_address
; // ir address
2317 static uint_fast16_t irmp_tmp_command
; // ir command
2319 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2320 static uint_fast16_t irmp_tmp_address2
; // ir address
2321 static uint_fast16_t irmp_tmp_command2
; // ir command
2324 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2325 static uint_fast16_t irmp_lgair_address
; // ir address
2326 static uint_fast16_t irmp_lgair_command
; // ir command
2329 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2330 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2332 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2333 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2334 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2337 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2338 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2341 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2343 * @details store bit in temp address or temp command
2344 * @param value to store: 0 or 1
2345 *---------------------------------------------------------------------------------------------------------------------------------------------------
2347 // verhindert, dass irmp_store_bit() inline compiliert wird:
2348 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2351 irmp_store_bit (uint_fast8_t value
)
2353 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2354 if (irmp_param
.protocol
== IRMP_ACP24_PROTOCOL
) // squeeze 64 bits into 16 bits:
2360 // 0123456789012345678901234567890123456789012345678901234567890123456789
2361 // N VVMMM ? ??? t vmA x y TTTT
2363 // irmp_data_p->command:
2370 case 0: irmp_tmp_command
|= (1<<15); break; // N
2371 case 2: irmp_tmp_command
|= (1<<13); break; // V
2372 case 3: irmp_tmp_command
|= (1<<12); break; // V
2373 case 4: irmp_tmp_command
|= (1<<10); break; // M
2374 case 5: irmp_tmp_command
|= (1<< 9); break; // M
2375 case 6: irmp_tmp_command
|= (1<< 8); break; // M
2376 case 20: irmp_tmp_command
|= (1<< 6); break; // t
2377 case 22: irmp_tmp_command
|= (1<<11); break; // v
2378 case 23: irmp_tmp_command
|= (1<< 7); break; // m
2379 case 24: irmp_tmp_command
|= (1<<14); break; // A
2380 case 26: irmp_tmp_command
|= (1<< 5); break; // x
2381 case 44: irmp_tmp_command
|= (1<< 4); break; // y
2382 case 66: irmp_tmp_command
|= (1<< 3); break; // T
2383 case 67: irmp_tmp_command
|= (1<< 2); break; // T
2384 case 68: irmp_tmp_command
|= (1<< 1); break; // T
2385 case 69: irmp_tmp_command
|= (1<< 0); break; // T
2390 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2392 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2393 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2402 else if (irmp_bit
== 14)
2404 if (value
) // value == 1: even parity
2408 parity
= PARITY_CHECK_FAILED
;
2412 parity
= PARITY_CHECK_OK
;
2417 if (parity
& 0x01) // value == 0: odd parity
2419 parity
= PARITY_CHECK_OK
;
2423 parity
= PARITY_CHECK_FAILED
;
2434 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2435 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2442 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2444 if (irmp_param
.lsb_first
)
2446 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2450 irmp_tmp_address
<<= 1;
2451 irmp_tmp_address
|= value
;
2454 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2456 if (irmp_param
.lsb_first
)
2458 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2459 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2461 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2466 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2471 irmp_tmp_command
<<= 1;
2472 irmp_tmp_command
|= value
;
2476 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2477 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2481 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2482 irmp_lgair_address
|= value
;
2484 else if (irmp_bit
< 24)
2486 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2487 irmp_lgair_command
|= value
;
2493 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2494 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2496 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2501 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2502 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2504 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2509 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2510 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2512 if (irmp_bit
>= 20 && irmp_bit
< 24)
2514 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2516 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2518 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2521 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2525 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2529 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2542 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2544 * @details store bit in temp address or temp command
2545 * @param value to store: 0 or 1
2546 *---------------------------------------------------------------------------------------------------------------------------------------------------
2548 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2550 irmp_store_bit2 (uint_fast8_t value
)
2552 uint_fast8_t irmp_bit2
;
2554 if (irmp_param
.protocol
)
2556 irmp_bit2
= irmp_bit
- 2;
2560 irmp_bit2
= irmp_bit
- 1;
2563 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2565 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2567 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2569 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2572 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2574 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2576 * @details ISR routine, called 10000 times per second
2577 *---------------------------------------------------------------------------------------------------------------------------------------------------
2582 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2583 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2584 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2585 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2586 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2587 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2588 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2589 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2590 static uint_fast8_t repetition_frame_number
;
2591 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2592 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2593 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2595 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2596 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2598 #if IRMP_SUPPORT_MANCHESTER == 1
2599 static PAUSE_LEN last_pause
; // last pause value
2601 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2602 static uint_fast8_t last_value
; // last bit value
2604 uint_fast8_t irmp_input
; // input value
2610 #if defined(__SDCC_stm8)
2611 irmp_input
= input(IRMP_GPIO_STRUCT
->IDR
)
2612 #elif defined(__MBED__)
2613 //irmp_input = inputPin;
2614 irmp_input
= gpio_read (&gpioIRin
);
2616 irmp_input
= input(IRMP_PIN
);
2619 #if IRMP_USE_CALLBACK == 1
2620 if (irmp_callback_ptr
)
2622 static uint_fast8_t last_inverted_input
;
2624 if (last_inverted_input
!= !irmp_input
)
2626 (*irmp_callback_ptr
) (! irmp_input
);
2627 last_inverted_input
= !irmp_input
;
2630 #endif // IRMP_USE_CALLBACK == 1
2632 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2634 if (! irmp_ir_detected
) // ir code already detected?
2636 if (! irmp_start_bit_detected
) // start bit detected?
2638 if (! irmp_input
) // receiving burst?
2640 // irmp_busy_flag = TRUE;
2642 if (! irmp_pulse_time
)
2644 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2647 irmp_pulse_time
++; // increment counter
2651 if (irmp_pulse_time
) // it's dark....
2652 { // set flags for counting the time of darkness...
2653 irmp_start_bit_detected
= 1;
2654 wait_for_start_space
= 1;
2656 irmp_tmp_command
= 0;
2657 irmp_tmp_address
= 0;
2658 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2661 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2665 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2666 irmp_tmp_command2
= 0;
2667 irmp_tmp_address2
= 0;
2669 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2670 irmp_lgair_command
= 0;
2671 irmp_lgair_address
= 0;
2674 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2675 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2676 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2681 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2683 key_repetition_len
++;
2685 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2686 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2688 denon_repetition_len
++;
2690 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2693 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2694 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2696 last_irmp_denon_command
= 0;
2697 denon_repetition_len
= 0xFFFF;
2700 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2707 if (wait_for_start_space
) // we have received start bit...
2708 { // ...and are counting the time of darkness
2709 if (irmp_input
) // still dark?
2711 irmp_pause_time
++; // increment counter
2713 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2714 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
) ||
2715 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2717 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2720 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2721 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2726 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2729 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
);
2730 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2734 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2735 irmp_pulse_time
= 0;
2736 irmp_pause_time
= 0;
2740 { // receiving first data pulse!
2741 IRMP_PARAMETER
* irmp_param_p
;
2742 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2744 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2745 irmp_param2
.protocol
= 0;
2749 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2752 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2753 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2754 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2757 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2758 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2759 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2761 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2764 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2766 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2767 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2768 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2769 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2772 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2773 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2774 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2776 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2779 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2781 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2782 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2783 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2785 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2787 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2788 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2789 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2791 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2794 ANALYZE_PRINTF ("protocol = NEC, 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_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2798 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2801 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2802 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2804 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2805 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2806 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2808 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2809 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2810 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2812 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2815 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2818 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2819 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2820 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2823 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2828 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2829 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2830 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2831 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2832 { // it's JVC repetition type 3
2834 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2835 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2836 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2838 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2841 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2843 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2845 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2846 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2847 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2850 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2851 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2852 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2854 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2857 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2859 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2860 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2861 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2864 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2865 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2866 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2868 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2871 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2873 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2874 if (irmp_pulse_time
>= ACP24_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ACP24_START_BIT_PULSE_LEN_MAX
&&
2875 irmp_pause_time
>= ACP24_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ACP24_START_BIT_PAUSE_LEN_MAX
)
2878 ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2879 ACP24_START_BIT_PULSE_LEN_MIN
, ACP24_START_BIT_PULSE_LEN_MAX
,
2880 ACP24_START_BIT_PAUSE_LEN_MIN
, ACP24_START_BIT_PAUSE_LEN_MAX
);
2882 irmp_param_p
= (IRMP_PARAMETER
*) &acp24_param
;
2885 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2887 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2888 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
2889 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
2892 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2893 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
2894 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
2896 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
2899 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2901 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2902 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2903 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2906 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2907 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2908 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2910 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2913 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2915 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2916 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2917 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2920 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2921 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2922 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2924 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2927 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2929 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2930 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2931 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2932 { // it's MATSUSHITA
2934 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2935 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2936 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2938 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2941 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2943 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2944 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2945 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2948 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2949 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2950 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2952 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2955 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2957 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
2958 if (irmp_pulse_time
>= PANASONIC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PANASONIC_START_BIT_PULSE_LEN_MAX
&&
2959 irmp_pause_time
>= PANASONIC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PANASONIC_START_BIT_PAUSE_LEN_MAX
)
2962 ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2963 PANASONIC_START_BIT_PULSE_LEN_MIN
, PANASONIC_START_BIT_PULSE_LEN_MAX
,
2964 PANASONIC_START_BIT_PAUSE_LEN_MIN
, PANASONIC_START_BIT_PAUSE_LEN_MAX
);
2966 irmp_param_p
= (IRMP_PARAMETER
*) &panasonic_param
;
2969 #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
2971 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2972 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2973 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2976 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2977 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2978 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2980 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2983 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2985 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2986 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2987 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2990 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2991 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2992 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2994 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2997 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2999 #if IRMP_SUPPORT_S100_PROTOCOL == 1
3000 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
3001 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
3002 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
3003 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
3006 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3007 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3008 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
3009 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3010 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
3013 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
3014 last_pause
= irmp_pause_time
;
3016 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
3017 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
3020 rc5_cmd_bit6
= 1<<6;
3028 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
3030 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3031 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
3032 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
3033 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
3034 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
3036 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3037 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3038 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3041 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
3042 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3043 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3044 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3045 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3046 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3047 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3049 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
3052 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3054 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3055 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3056 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3059 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
3060 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3061 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3062 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3063 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3064 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3065 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3067 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
3070 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3073 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3074 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3075 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
3076 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3077 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
3081 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
3082 last_pause
= irmp_pause_time
;
3084 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
3085 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
3088 rc5_cmd_bit6
= 1<<6;
3096 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
3098 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3099 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
3100 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
3101 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
3104 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3105 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
3106 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
3107 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
3109 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
3112 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3114 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3115 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
3116 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
3117 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
3120 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3121 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3122 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
3123 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
3125 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
3128 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3130 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3131 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
3132 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
3135 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3136 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
3137 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
3139 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
3142 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3144 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3145 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
3146 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
3149 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3150 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
3151 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
3153 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
3158 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3160 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3161 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
3162 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
3165 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3166 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
3167 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
3169 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
3172 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3174 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3175 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
3176 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
3179 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3180 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
3181 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
3183 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
3186 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3188 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3189 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
3190 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
3193 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3194 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
3195 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
3197 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
3200 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3202 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3203 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3204 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3207 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3208 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3209 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3211 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3214 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3216 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3217 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3218 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3219 { // it's BANG_OLUFSEN
3221 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3222 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3223 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3224 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3225 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3226 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3227 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3228 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3229 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3230 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3231 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3232 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3233 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3235 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3239 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3241 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3242 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3243 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3246 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3247 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3248 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3250 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3251 last_pause
= irmp_pause_time
;
3255 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3257 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3258 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3259 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3262 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3263 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3264 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3266 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3271 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3273 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3274 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3275 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3276 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3277 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3278 { // it's RUWIDO or SIEMENS
3280 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3281 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3282 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3283 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3284 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3286 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3287 last_pause
= irmp_pause_time
;
3291 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3293 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3294 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3295 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3298 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3299 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3300 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3302 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3305 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3307 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3308 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3309 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3312 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3313 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3314 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3316 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3319 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3321 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3322 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3323 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3326 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3327 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3328 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3330 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3333 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3335 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3336 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3337 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3340 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3341 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3342 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3344 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3347 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3349 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3350 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3351 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3354 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3355 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3356 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3358 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3361 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3363 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3364 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3365 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3368 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3369 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3370 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3372 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3377 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3379 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3380 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3381 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3382 { // it's ORTEK (Hama)
3384 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3385 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3386 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3388 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3394 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3396 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3397 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3398 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3401 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3402 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3403 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3405 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3408 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3411 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3413 irmp_start_bit_detected
= 0; // wait for another start bit...
3416 if (irmp_start_bit_detected
)
3418 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3420 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3423 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3424 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3430 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3431 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3432 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3433 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3437 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3438 if (irmp_param2
.protocol
)
3441 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3442 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3443 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3444 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3450 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3451 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3454 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3459 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3462 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3463 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3469 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3470 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3471 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3472 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3477 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3478 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3480 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3481 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3485 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3486 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3487 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3488 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3494 #if IRMP_SUPPORT_MANCHESTER == 1
3495 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3496 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3497 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3499 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3502 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3503 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3506 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3508 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3511 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3512 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3515 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3519 #endif // IRMP_SUPPORT_MANCHESTER == 1
3521 #if IRMP_SUPPORT_SERIAL == 1
3522 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3527 #endif // IRMP_SUPPORT_SERIAL == 1
3530 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3531 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3534 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3537 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3538 { // pause timings correct for "1"?
3540 ANALYZE_PUTCHAR ('1'); // yes, store 1
3545 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3546 { // pause timings correct for "0"?
3548 ANALYZE_PUTCHAR ('0'); // yes, store 0
3555 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3556 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3557 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3560 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3563 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3564 { // pause timings correct for "1"?
3566 ANALYZE_PUTCHAR ('1'); // yes, store 1
3571 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3572 { // pause timings correct for "0"?
3574 ANALYZE_PUTCHAR ('0'); // yes, store 0
3581 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3583 ; // else do nothing
3586 irmp_pulse_time
= 1; // set counter to 1, not 0
3587 irmp_pause_time
= 0;
3588 wait_for_start_space
= 0;
3591 else if (wait_for_space
) // the data section....
3592 { // counting the time of darkness....
3593 uint_fast8_t got_light
= FALSE
;
3595 if (irmp_input
) // still dark?
3597 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3600 #if IRMP_SUPPORT_MANCHESTER == 1
3601 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3603 #if IRMP_SUPPORT_SERIAL == 1
3604 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3606 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3609 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3611 ANALYZE_PRINTF ("stop bit detected\n");
3614 irmp_param
.stop_bit
= 0;
3619 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",
3620 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3622 irmp_start_bit_detected
= 0; // wait for another start bit...
3623 irmp_pulse_time
= 0;
3624 irmp_pause_time
= 0;
3629 irmp_pause_time
++; // increment counter
3631 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3632 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3633 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3634 irmp_bit
>= 12 - 1) // pause too long?
3635 { // yes, break and close this frame
3636 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3637 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3638 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3639 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3640 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3644 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3645 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3646 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3647 { // yes, break and close this frame
3648 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3651 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3653 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3655 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3658 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3660 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3665 #if IRMP_SUPPORT_SERIAL == 1
3666 // NETBOX generates no stop bit, here is the timeout condition:
3667 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3668 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3670 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3674 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3675 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3677 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3680 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3682 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3683 irmp_param
.stop_bit
= TRUE
; // set flag
3685 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3686 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3687 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3688 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3689 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3690 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3692 irmp_tmp_command
<<= 1;
3693 irmp_tmp_command
|= first_bit
;
3695 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3696 { // special manchester decoder
3697 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3698 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3699 irmp_param
.stop_bit
= TRUE
; // set flag
3701 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3704 ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit
);
3706 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3707 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3708 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3709 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3710 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3712 if (irmp_tmp_command
& 0x300)
3714 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3715 irmp_tmp_command
&= 0xFF;
3721 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3722 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3724 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3725 { // special manchester decoder
3726 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3727 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3728 irmp_param
.stop_bit
= TRUE
; // set flag
3730 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3733 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3735 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3736 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3737 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3738 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3739 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3742 // RUWIDO: AAAAAAAAACCCCCCCp
3743 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3744 irmp_tmp_address
<<= 2;
3745 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3746 irmp_tmp_command
&= 0x003F;
3747 // irmp_tmp_command <<= 4;
3748 irmp_tmp_command
|= last_value
;
3753 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3754 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3755 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3756 { // break and close this frame
3757 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3759 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3761 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3763 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3766 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3770 #if IRMP_SUPPORT_MANCHESTER == 1
3771 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3772 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3773 { // special manchester decoder
3774 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3775 irmp_param
.stop_bit
= TRUE
; // set flag
3778 #endif // IRMP_SUPPORT_MANCHESTER == 1
3779 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3781 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3785 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3786 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3789 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3791 irmp_param
.stop_bit
= TRUE
; // set flag
3792 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3793 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3794 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3795 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3796 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3798 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3799 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3800 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3803 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3805 irmp_param
.stop_bit
= TRUE
; // set flag
3806 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3807 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3808 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3809 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3810 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3812 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3814 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3815 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3816 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3819 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3821 irmp_param
.stop_bit
= TRUE
; // set flag
3822 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3823 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3825 // 0123456789ABC0123456789ABC0123456701234567
3826 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3827 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3828 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3829 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3831 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3832 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3833 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3836 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3838 irmp_param
.stop_bit
= TRUE
; // set flag
3839 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3840 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3841 irmp_tmp_address
= irmp_lgair_address
;
3842 irmp_tmp_command
= irmp_lgair_command
;
3844 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3845 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3846 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3849 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3851 irmp_param
.stop_bit
= TRUE
; // set flag
3852 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3853 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3855 // 0123456789ABC0123456789ABC0123456701234567
3856 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3857 // JVC: AAAACCCCCCCCCCCC
3858 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3859 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3861 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3862 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3864 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3865 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3868 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3870 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3871 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3872 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3873 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3875 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3877 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3878 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3882 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3883 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3886 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3888 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3890 else // if ((irmp_bit == 24)
3893 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3895 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3897 irmp_param
.stop_bit
= TRUE
; // set flag
3898 irmp_param
.complete_len
= irmp_bit
; // patch length
3900 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3902 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
3903 else if (irmp_param
.protocol
== IRMP_MATSUSHITA_PROTOCOL
&& irmp_bit
== 22) // it was a TECHNICS stop bit
3906 ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit
);
3909 // The first 12 bits have been stored in irmp_tmp_command (LSB first)
3910 // The following 10 bits have been stored in irmp_tmp_address (LSB first)
3911 // The code of TECHNICS is:
3912 // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)
3913 // ccccccccccccaaaaaaaaaa
3914 // where C is inverted value of c
3916 irmp_tmp_address
<<= 1;
3917 if (irmp_tmp_command
& (1<<11))
3919 irmp_tmp_address
|= 1;
3920 irmp_tmp_command
&= ~(1<<11);
3923 if (irmp_tmp_command
== ((~irmp_tmp_address
) & 0x07FF))
3925 irmp_tmp_address
= 0;
3927 irmp_param
.protocol
= IRMP_TECHNICS_PROTOCOL
; // switch protocol
3928 irmp_param
.complete_len
= irmp_bit
; // patch length
3933 ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");
3934 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3936 irmp_start_bit_detected
= 0; // wait for another start bit...
3937 irmp_pulse_time
= 0;
3938 irmp_pause_time
= 0;
3941 #endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
3945 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3946 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3948 irmp_start_bit_detected
= 0; // wait for another start bit...
3949 irmp_pulse_time
= 0;
3950 irmp_pause_time
= 0;
3963 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3966 #if IRMP_SUPPORT_MANCHESTER == 1
3967 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3970 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3971 #else // better, but some IR-RCs use asymmetric timings :-/
3972 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3973 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3976 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3977 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3980 ANALYZE_PUTCHAR ('T');
3982 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3997 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4000 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
4002 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
4004 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4005 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4008 ANALYZE_PUTCHAR ('T');
4012 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
4025 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4028 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
4030 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
4031 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4032 if (! irmp_param2
.protocol
)
4039 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
4043 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
4044 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
4046 uint_fast8_t manchester_value
;
4048 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
4050 manchester_value
= last_value
? 0 : 1;
4051 last_value
= manchester_value
;
4055 manchester_value
= last_value
;
4059 ANALYZE_PUTCHAR (manchester_value
+ '0');
4062 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4063 if (! irmp_param2
.protocol
)
4071 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4072 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
4075 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
4077 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
4078 irmp_param
.address_offset
= 5;
4079 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
4080 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
4081 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
4082 irmp_tmp_address
= 0;
4084 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4086 irmp_store_bit (manchester_value
);
4090 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4091 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
4092 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
4093 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
4094 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
4097 ANALYZE_PUTCHAR ('?');
4099 irmp_param
.protocol
= 0; // switch to FDC, see below
4102 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4103 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4104 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
4105 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
4106 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
4107 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
4110 ANALYZE_PUTCHAR ('?');
4112 irmp_param
.protocol
= 0; // switch to RCCAR, see below
4115 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4118 ANALYZE_PUTCHAR ('?');
4120 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4121 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4123 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4124 irmp_pause_time
= 0;
4128 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4129 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
4131 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
4134 ANALYZE_PRINTF (" 1 (FDC)\n");
4136 irmp_store_bit2 (1);
4138 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
4141 ANALYZE_PRINTF (" 0 (FDC)\n");
4143 irmp_store_bit2 (0);
4146 if (! irmp_param
.protocol
)
4149 ANALYZE_PRINTF ("Switching to FDC protocol\n");
4151 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4152 irmp_param2
.protocol
= 0;
4153 irmp_tmp_address
= irmp_tmp_address2
;
4154 irmp_tmp_command
= irmp_tmp_command2
;
4157 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4158 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4159 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
4161 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
4164 ANALYZE_PRINTF (" 1 (RCCAR)\n");
4166 irmp_store_bit2 (1);
4168 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
4171 ANALYZE_PRINTF (" 0 (RCCAR)\n");
4173 irmp_store_bit2 (0);
4176 if (! irmp_param
.protocol
)
4179 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4181 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4182 irmp_param2
.protocol
= 0;
4183 irmp_tmp_address
= irmp_tmp_address2
;
4184 irmp_tmp_command
= irmp_tmp_command2
;
4187 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4189 last_pause
= irmp_pause_time
;
4193 #endif // IRMP_SUPPORT_MANCHESTER == 1
4195 #if IRMP_SUPPORT_SERIAL == 1
4196 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
4198 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
4201 ANALYZE_PUTCHAR ('1');
4205 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
4207 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
4211 irmp_pulse_time
= 0;
4215 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
4218 ANALYZE_PUTCHAR ('0');
4222 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
4224 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
4228 irmp_pause_time
= 0;
4237 #endif // IRMP_SUPPORT_SERIAL == 1
4239 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4240 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
4242 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
4243 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4246 ANALYZE_PRINTF ("SYNC\n");
4251 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4253 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4255 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4257 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4258 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4259 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4260 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4263 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4265 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4266 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4267 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4268 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4270 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4273 ANALYZE_PUTCHAR ('1');
4282 ANALYZE_PUTCHAR ('0');
4290 { // timing incorrect!
4292 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4293 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4295 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4296 irmp_pause_time
= 0;
4300 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4302 #if IRMP_SUPPORT_NEC16_PROTOCOL
4303 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4304 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4305 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4306 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4307 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4308 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4311 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4313 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4314 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4315 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4316 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4317 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4318 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4322 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4324 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4325 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4327 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4329 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4331 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4334 ANALYZE_PRINTF ("3rd start bit\n");
4340 { // timing incorrect!
4342 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
);
4343 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4345 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4346 irmp_pause_time
= 0;
4349 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4351 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4354 ANALYZE_PRINTF ("trailer bit\n");
4360 { // timing incorrect!
4362 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
);
4363 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4365 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4366 irmp_pause_time
= 0;
4371 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4372 { // pulse & pause timings correct for "1"?
4374 ANALYZE_PUTCHAR ('1');
4381 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4382 { // pulse & pause timings correct for "0"?
4384 ANALYZE_PUTCHAR ('0');
4391 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4394 ANALYZE_PUTCHAR (last_value
+ '0');
4397 irmp_store_bit (last_value
);
4401 { // timing incorrect!
4403 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
);
4404 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4406 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4407 irmp_pause_time
= 0;
4412 { // timing incorrect!
4414 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
);
4415 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4417 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4418 irmp_pause_time
= 0;
4422 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4424 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4425 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4427 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4430 ANALYZE_PUTCHAR ('0');
4431 ANALYZE_PUTCHAR ('0');
4436 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4439 ANALYZE_PUTCHAR ('0');
4440 ANALYZE_PUTCHAR ('1');
4445 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4448 ANALYZE_PUTCHAR ('1');
4449 ANALYZE_PUTCHAR ('0');
4454 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4457 ANALYZE_PUTCHAR ('1');
4458 ANALYZE_PUTCHAR ('1');
4464 ANALYZE_PRINTF ("\n");
4471 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4472 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4473 { // pulse & pause timings correct for "1"?
4475 ANALYZE_PUTCHAR ('1');
4481 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4482 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4483 { // pulse & pause timings correct for "0"?
4485 ANALYZE_PUTCHAR ('0');
4492 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4494 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4495 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4496 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4497 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4499 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4506 ANALYZE_PUTCHAR ('S');
4509 irmp_tmp_command
<<= 1;
4514 ANALYZE_PUTCHAR ('S');
4522 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4523 { // timing incorrect!
4525 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4526 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4528 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4529 irmp_pause_time
= 0;
4532 irmp_pulse_time
= 1; // set counter to 1, not 0
4536 { // counting the pulse length ...
4537 if (! irmp_input
) // still light?
4539 irmp_pulse_time
++; // increment counter
4543 wait_for_space
= 1; // let's count the time (see above)
4544 irmp_pause_time
= 1; // set pause counter to 1, not 0
4548 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4550 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4552 repetition_frame_number
++;
4556 repetition_frame_number
= 0;
4559 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4560 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4561 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4564 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4565 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4567 key_repetition_len
= 0;
4572 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4573 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4574 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4577 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4578 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4580 key_repetition_len
= 0;
4585 #if 0 && IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4586 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4587 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4590 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4591 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4593 key_repetition_len
= 0;
4598 #if 0 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4599 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4600 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4603 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4604 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4606 key_repetition_len
= 0;
4611 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4612 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4613 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4616 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4617 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4619 key_repetition_len
= 0;
4624 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4625 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4626 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4629 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4630 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4632 key_repetition_len
= 0;
4639 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4641 irmp_ir_detected
= TRUE
;
4643 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4644 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4645 { // check for repetition frame
4646 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4648 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4649 last_irmp_denon_command
= 0;
4651 irmp_protocol
= irmp_param
.protocol
; // store protocol
4652 irmp_address
= irmp_tmp_address
; // store address
4653 irmp_command
= irmp_tmp_command
; // store command
4657 if ((irmp_tmp_command
& 0x01) == 0x00)
4660 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4662 last_irmp_denon_command
= irmp_tmp_command
;
4663 denon_repetition_len
= 0;
4664 irmp_ir_detected
= FALSE
;
4669 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4671 last_irmp_denon_command
= 0;
4672 irmp_ir_detected
= FALSE
;
4677 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4679 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4680 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4681 { // Grundig start frame?
4683 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4685 irmp_ir_detected
= FALSE
;
4688 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4690 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4691 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4692 { // Nokia start frame?
4694 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4696 irmp_ir_detected
= FALSE
;
4699 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4701 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4702 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4704 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4707 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4708 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4710 irmp_tmp_address
= last_irmp_address
; // address is last address
4711 irmp_tmp_command
= last_irmp_command
; // command is last command
4712 irmp_flags
|= IRMP_FLAG_REPETITION
;
4713 key_repetition_len
= 0;
4718 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4719 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4721 irmp_ir_detected
= FALSE
;
4724 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4726 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4727 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4729 uint_fast8_t xor_value
;
4731 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4733 if (xor_value
!= (xor_check
[2] & 0x0F))
4736 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4738 irmp_ir_detected
= FALSE
;
4741 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4743 if (xor_value
!= xor_check
[5])
4746 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4748 irmp_ir_detected
= FALSE
;
4751 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4753 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4755 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4756 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4758 if (parity
== PARITY_CHECK_FAILED
)
4761 ANALYZE_PRINTF ("error 6: parity check failed\n");
4763 irmp_ir_detected
= FALSE
;
4766 if ((irmp_tmp_address
& 0x03) == 0x02)
4769 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4771 irmp_ir_detected
= FALSE
;
4773 irmp_tmp_address
>>= 2;
4775 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4777 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4778 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4780 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4783 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4785 irmp_protocol
= irmp_param
.protocol
;
4788 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4789 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4791 if (irmp_tmp_command
& 0x000F) // released key?
4793 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4797 irmp_tmp_command
>>= 4; // no, it's a pressed key
4799 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4800 irmp_tmp_address
&= 0x003F;
4804 irmp_address
= irmp_tmp_address
; // store address
4805 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4806 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4808 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4812 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4813 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4815 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4818 #if IRMP_SUPPORT_S100_PROTOCOL == 1
4819 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
4821 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4824 irmp_command
= irmp_tmp_command
; // store command
4826 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4827 irmp_id
= irmp_tmp_id
;
4832 if (irmp_ir_detected
)
4834 if (last_irmp_command
== irmp_tmp_command
&&
4835 last_irmp_address
== irmp_tmp_address
&&
4836 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4838 irmp_flags
|= IRMP_FLAG_REPETITION
;
4841 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4842 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4844 key_repetition_len
= 0;
4849 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4853 irmp_start_bit_detected
= 0; // and wait for next start bit
4854 irmp_tmp_command
= 0;
4855 irmp_pulse_time
= 0;
4856 irmp_pause_time
= 0;
4858 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4859 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4860 { // set pulse time here!
4861 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4863 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4868 #if defined(STELLARIS_ARM_CORTEX_M4)
4869 // Clear the timer interrupt
4870 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4873 return (irmp_ir_detected
);
4878 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4879 * main functions - for Unix/Linux + Windows only!
4883 * Compile it under linux with:
4886 * usage: ./irmp [-v|-s|-a|-l] < file
4892 * -l list pulse/pauses
4893 *---------------------------------------------------------------------------------------------------------------------------------------------------
4897 print_spectrum (char * text
, int * buf
, int is_pulse
)
4910 puts ("-----------------------------------------------------------------------------");
4911 printf ("%s:\n", text
);
4913 for (i
= 0; i
< 256; i
++)
4915 if (buf
[i
] > max_value
)
4921 for (i
= 1; i
< 200; i
++)
4926 value
= (buf
[i
] * 60) / max_value
;
4928 for (j
= 0; j
< value
; j
++)
4932 printf (" %d\n", buf
[i
]);
4943 average
= (float) sum
/ (float) counter
;
4954 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4955 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4956 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4958 tolerance
= (max
- average
);
4960 if (average
- min
> tolerance
)
4962 tolerance
= average
- min
;
4965 tolerance
= tolerance
* 100 / average
;
4966 printf ("tol: %4.1f%%\n", tolerance
);
4976 #define STATE_LEFT_SHIFT 0x01
4977 #define STATE_RIGHT_SHIFT 0x02
4978 #define STATE_LEFT_CTRL 0x04
4979 #define STATE_LEFT_ALT 0x08
4980 #define STATE_RIGHT_ALT 0x10
4982 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4983 #define KEY_MENUE 0x80 // keycode = 0x0070
4984 #define KEY_BACK 0x81 // keycode = 0x0071
4985 #define KEY_FORWARD 0x82 // keycode = 0x0072
4986 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4987 #define KEY_WINDOW 0x84 // keycode = 0x0074
4988 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4989 #define KEY_STOP 0x86 // keycode = 0x0076
4990 #define KEY_MAIL 0x87 // keycode = 0x0077
4991 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4992 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4993 #define KEY_SETUP 0x8A // keycode = 0x007a
4994 #define KEY_FONT 0x8B // keycode = 0x007b
4995 #define KEY_PRINT 0x8C // keycode = 0x007c
4996 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4998 #define KEY_INSERT 0x90 // keycode = 0x004b
4999 #define KEY_DELETE 0x91 // keycode = 0x004c
5000 #define KEY_LEFT 0x92 // keycode = 0x004f
5001 #define KEY_HOME 0x93 // keycode = 0x0050
5002 #define KEY_END 0x94 // keycode = 0x0051
5003 #define KEY_UP 0x95 // keycode = 0x0053
5004 #define KEY_DOWN 0x96 // keycode = 0x0054
5005 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
5006 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
5007 #define KEY_RIGHT 0x99 // keycode = 0x0059
5008 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
5009 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
5012 get_fdc_key (uint_fast16_t cmd
)
5014 static uint8_t key_table
[128] =
5016 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
5017 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0xDF, '´', 0, '\b',
5018 '\t', 'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 0xFC, '+', 0, 0, 'a',
5019 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0xF6, 0xE4, '#', '\r', 0, '<', 'y', 'x',
5020 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
5022 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
5023 '\t', 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 0xDC, '*', 0, 0, 'A',
5024 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 0xD6, 0xC4, '\'', '\r', 0, '>', 'Y', 'X',
5025 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5027 static uint_fast8_t state
;
5029 uint_fast8_t key
= 0;
5033 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
5034 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
5035 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
5036 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
5037 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
5038 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
5039 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
5040 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
5041 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
5042 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
5044 case 0x006e: key
= KEY_ESCAPE
; break;
5045 case 0x004b: key
= KEY_INSERT
; break;
5046 case 0x004c: key
= KEY_DELETE
; break;
5047 case 0x004f: key
= KEY_LEFT
; break;
5048 case 0x0050: key
= KEY_HOME
; break;
5049 case 0x0051: key
= KEY_END
; break;
5050 case 0x0053: key
= KEY_UP
; break;
5051 case 0x0054: key
= KEY_DOWN
; break;
5052 case 0x0055: key
= KEY_PAGE_UP
; break;
5053 case 0x0056: key
= KEY_PAGE_DOWN
; break;
5054 case 0x0059: key
= KEY_RIGHT
; break;
5055 case 0x0400: key
= KEY_MOUSE_1
; break;
5056 case 0x0800: key
= KEY_MOUSE_2
; break;
5060 if (!(cmd
& 0x80)) // pressed key
5062 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
5064 key
= cmd
+ 0x10; // 7x -> 8x
5066 else if (cmd
< 64) // key listed in key_table
5068 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
5072 case 0x0003: key
= '²'; break;
5073 case 0x0008: key
= '{'; break;
5074 case 0x0009: key
= '['; break;
5075 case 0x000A: key
= ']'; break;
5076 case 0x000B: key
= '}'; break;
5077 case 0x000C: key
= '\\'; break;
5078 case 0x001C: key
= '~'; break;
5079 case 0x002D: key
= '|'; break;
5080 case 0x0034: key
= 0xB5; break; // Mu
5083 else if (state
& (STATE_LEFT_CTRL
))
5085 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
5087 key
= key_table
[cmd
] - 'a' + 1;
5091 key
= key_table
[cmd
];
5096 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5100 key
= key_table
[idx
];
5112 static int analyze
= FALSE
;
5113 static int list
= FALSE
;
5114 static IRMP_DATA irmp_data
;
5115 static int expected_protocol
;
5116 static int expected_address
;
5117 static int expected_command
;
5118 static int do_check_expected_values
;
5123 if (! analyze
&& ! list
)
5127 if (irmp_get_data (&irmp_data
))
5131 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5135 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5138 if (irmp_data
.protocol
== IRMP_ACP24_PROTOCOL
)
5140 uint16_t temp
= (irmp_data
.command
& 0x000F) + 15;
5142 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5143 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, temp
);
5145 else if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5147 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5149 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5150 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5152 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5154 char * p
= (char *) NULL
;
5158 case '\t' : p
= "TAB"; break;
5159 case '\r' : p
= "CR"; break;
5160 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5161 case KEY_MENUE
: p
= "MENUE"; break;
5162 case KEY_BACK
: p
= "BACK"; break;
5163 case KEY_FORWARD
: p
= "FORWARD"; break;
5164 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5165 case KEY_WINDOW
: p
= "WINDOW"; break;
5166 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5167 case KEY_STOP
: p
= "STOP"; break;
5168 case KEY_MAIL
: p
= "MAIL"; break;
5169 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5170 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5171 case KEY_SETUP
: p
= "SETUP"; break;
5172 case KEY_FONT
: p
= "FONT"; break;
5173 case KEY_PRINT
: p
= "PRINT"; break;
5174 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5176 case KEY_INSERT
: p
= "INSERT"; break;
5177 case KEY_DELETE
: p
= "DELETE"; break;
5178 case KEY_LEFT
: p
= "LEFT"; break;
5179 case KEY_HOME
: p
= "HOME"; break;
5180 case KEY_END
: p
= "END"; break;
5181 case KEY_UP
: p
= "UP"; break;
5182 case KEY_DOWN
: p
= "DOWN"; break;
5183 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5184 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5185 case KEY_RIGHT
: p
= "RIGHT"; break;
5186 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5187 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5188 default : p
= "<UNKNWON>"; break;
5191 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5192 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5196 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5197 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5202 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5203 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5206 if (do_check_expected_values
)
5208 if (irmp_data
.protocol
!= expected_protocol
||
5209 irmp_data
.address
!= expected_address
||
5210 irmp_data
.command
!= expected_command
)
5212 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5213 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5217 printf (" checked!\n");
5219 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5230 main (int argc
, char ** argv
)
5238 int start_pulses
[256];
5239 int start_pauses
[256];
5243 int first_pulse
= TRUE
;
5244 int first_pause
= TRUE
;
5248 if (! strcmp (argv
[1], "-v"))
5252 else if (! strcmp (argv
[1], "-l"))
5256 else if (! strcmp (argv
[1], "-a"))
5260 else if (! strcmp (argv
[1], "-s"))
5264 else if (! strcmp (argv
[1], "-r"))
5270 for (i
= 0; i
< 256; i
++)
5272 start_pulses
[i
] = 0;
5273 start_pauses
[i
] = 0;
5280 while ((ch
= getchar ()) != EOF
)
5282 if (ch
== '_' || ch
== '0')
5290 printf ("pause: %d\n", pause
);
5299 start_pauses
[pause
]++;
5301 first_pause
= FALSE
;
5317 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5323 printf ("pulse: %d ", pulse
);
5332 start_pulses
[pulse
]++;
5334 first_pulse
= FALSE
;
5350 else if (ch
== '\n')
5355 if (list
&& pause
> 0)
5357 printf ("pause: %d\n", pause
);
5363 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5377 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5388 puts ("----------------------------------------------------------------------");
5392 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5394 if (ch
!= '\r') // ignore CR in DOS/Windows files
5396 if (ch
== '[' && idx
== -1)
5404 do_check_expected_values
= FALSE
;
5408 expected_protocol
= atoi (buf
);
5410 if (expected_protocol
> 0)
5419 if (sscanf (p
, "%x", &expected_address
) == 1)
5421 do_check_expected_values
= TRUE
;
5428 if (do_check_expected_values
)
5430 do_check_expected_values
= FALSE
;
5438 if (sscanf (p
, "%x", &expected_command
) == 1)
5440 do_check_expected_values
= TRUE
;
5447 if (do_check_expected_values
)
5449 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5454 else if (idx
< 1024 - 2)
5474 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5475 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5476 print_spectrum ("PULSES", pulses
, TRUE
);
5477 print_spectrum ("PAUSES", pauses
, FALSE
);
5478 puts ("-----------------------------------------------------------------------------");