1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.187 2016/09/09 07:53:29 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 MITSU_HEAVY_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define MITSU_HEAVY_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
167 #define MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
168 #define MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
169 #define MITSU_HEAVY_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
170 #define MITSU_HEAVY_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
171 #define MITSU_HEAVY_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
172 #define MITSU_HEAVY_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
173 #define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
174 #define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
176 #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
177 #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
178 #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
179 #define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
180 #define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
181 #define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
182 #define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
183 #define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
184 #define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
185 #define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
187 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
188 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
189 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
190 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
192 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
193 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
195 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
196 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
199 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
200 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
201 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
203 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
204 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
207 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
208 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
210 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
211 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
212 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
214 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
215 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
218 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
219 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
221 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
222 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
223 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
224 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
225 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
226 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
227 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
228 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
230 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
231 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
232 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
233 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
234 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
235 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
237 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
238 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
239 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
240 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
241 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
242 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
243 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
244 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
245 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
246 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
248 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
249 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
250 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
251 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
252 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
253 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
254 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
255 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
256 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
257 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
259 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
260 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
261 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
262 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
263 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
264 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
265 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
266 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
267 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
268 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
269 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
270 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
272 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
273 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
274 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
275 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
276 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
277 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
278 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
279 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
280 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
281 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
282 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
283 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
285 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
286 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
287 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
288 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
289 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
290 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
291 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
292 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
293 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
294 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
295 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
296 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
298 #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)
299 #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)
300 #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)
301 #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)
302 #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)
303 #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)
304 #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)
305 #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)
306 #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)
307 #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)
308 #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)
309 #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
310 #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)
311 #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)
312 #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)
313 #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)
314 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
315 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
316 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
317 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
318 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
319 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
320 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
321 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
322 #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)
323 #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)
325 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
326 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
327 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
328 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
329 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
330 #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)
331 #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)
333 #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)
334 #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)
335 #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)
336 #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)
337 #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)
338 #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)
339 #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)
340 #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)
342 #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
343 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
344 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
345 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
346 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
347 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
348 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
349 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
351 #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
353 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
355 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
357 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
358 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
359 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
360 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
361 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
362 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
363 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
364 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
365 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
366 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
368 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
369 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
370 #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!
371 #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!
372 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
373 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
374 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
375 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
376 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
377 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
378 // autodetect JVC repetition frame within 50 msec:
379 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
381 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
382 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
383 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
384 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
385 #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)
386 #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)
387 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
388 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
389 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
390 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
391 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
392 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
393 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
395 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
396 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
397 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
398 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
399 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
400 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
401 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
402 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
403 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
404 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
405 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
406 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
407 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
408 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
410 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
411 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
412 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
413 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
414 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
415 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
416 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
417 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
419 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
420 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
421 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
422 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
423 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
424 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
425 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
426 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
427 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
428 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
430 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
431 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
432 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
433 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
434 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
435 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
436 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
437 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
438 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
439 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
440 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
442 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
443 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
444 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
445 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
446 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
447 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
448 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
449 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
451 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
452 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
453 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
454 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
455 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
456 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
457 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
458 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
460 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
461 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
462 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
463 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
464 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
465 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
466 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
467 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
469 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
470 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
471 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
472 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
473 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
474 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
475 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
476 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
477 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
478 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
479 // autodetect TELEFUNKEN repetition frame within 50 msec:
480 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
482 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
483 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
484 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
485 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
486 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
487 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
488 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
489 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
490 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
491 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
492 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
493 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
494 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
495 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
497 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
498 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
499 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
500 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
501 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
502 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
503 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
504 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
505 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
506 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
507 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
508 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
509 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
510 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
512 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
513 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
514 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
515 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
516 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
517 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
518 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
519 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
520 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
521 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
522 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
523 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
524 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
525 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
527 #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
528 #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
529 #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
530 #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
531 #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
532 #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
533 #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
534 #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
535 #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
536 #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
538 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
539 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
540 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
541 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
542 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
543 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
544 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
545 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
546 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
547 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
548 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
549 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
550 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
551 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
553 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
556 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
557 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
558 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
559 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
560 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
562 static int time_counter
;
565 /******************************* not every PIC compiler knows variadic macros :-(
567 # define ANALYZE_PUTCHAR(a)
568 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
569 # define ANALYZE_PRINTF(...)
570 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
572 # define ANALYZE_NEWLINE()
573 *********************************/
576 #if IRMP_USE_CALLBACK == 1
577 static void (*irmp_callback_ptr
) (uint_fast8_t);
578 #endif // IRMP_USE_CALLBACK == 1
580 #define PARITY_CHECK_OK 1
581 #define PARITY_CHECK_FAILED 0
583 /*---------------------------------------------------------------------------------------------------------------------------------------------------
585 *---------------------------------------------------------------------------------------------------------------------------------------------------
587 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
588 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
589 static const char proto_sircs
[] PROGMEM
= "SIRCS";
590 static const char proto_nec
[] PROGMEM
= "NEC";
591 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
592 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
593 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
594 static const char proto_recs80
[] PROGMEM
= "RECS80";
595 static const char proto_rc5
[] PROGMEM
= "RC5";
596 static const char proto_denon
[] PROGMEM
= "DENON";
597 static const char proto_rc6
[] PROGMEM
= "RC6";
598 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
599 static const char proto_apple
[] PROGMEM
= "APPLE";
600 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
601 static const char proto_nubert
[] PROGMEM
= "NUBERT";
602 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
603 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
604 static const char proto_nokia
[] PROGMEM
= "NOKIA";
605 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
606 static const char proto_fdc
[] PROGMEM
= "FDC";
607 static const char proto_rccar
[] PROGMEM
= "RCCAR";
608 static const char proto_jvc
[] PROGMEM
= "JVC";
609 static const char proto_rc6a
[] PROGMEM
= "RC6A";
610 static const char proto_nikon
[] PROGMEM
= "NIKON";
611 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
612 static const char proto_ir60
[] PROGMEM
= "IR60";
613 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
614 static const char proto_netbox
[] PROGMEM
= "NETBOX";
615 static const char proto_nec16
[] PROGMEM
= "NEC16";
616 static const char proto_nec42
[] PROGMEM
= "NEC42";
617 static const char proto_lego
[] PROGMEM
= "LEGO";
618 static const char proto_thomson
[] PROGMEM
= "THOMSON";
619 static const char proto_bose
[] PROGMEM
= "BOSE";
620 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
621 static const char proto_ortek
[] PROGMEM
= "ORTEK";
622 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
623 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
624 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
625 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
626 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
627 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
628 static const char proto_lgair
[] PROGMEM
= "LGAIR";
629 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
630 static const char proto_merlin
[] PROGMEM
= "MERLIN";
631 static const char proto_pentax
[] PROGMEM
= "PENTAX";
632 static const char proto_fan
[] PROGMEM
= "FAN";
633 static const char proto_s100
[] PROGMEM
= "S100";
634 static const char proto_acp24
[] PROGMEM
= "ACP24";
635 static const char proto_technics
[] PROGMEM
= "TECHNICS";
636 static const char proto_panasonic
[] PROGMEM
= "PANASONIC";
637 static const char proto_mitsu_heavy
[] PROGMEM
= "MITSU_HEAVY";
639 static const char proto_radio1
[] PROGMEM
= "RADIO1";
642 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
699 /*---------------------------------------------------------------------------------------------------------------------------------------------------
701 *---------------------------------------------------------------------------------------------------------------------------------------------------
703 #if IRMP_LOGGING == 1 // logging via UART
705 #if defined(ARM_STM32F4XX)
706 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
707 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
708 # define STM32_GPIO_PORT GPIOA
709 # define STM32_GPIO_PIN GPIO_Pin_2
710 # define STM32_GPIO_SOURCE GPIO_PinSource2
711 # define STM32_UART_AF GPIO_AF_USART2
712 # define STM32_UART_COM USART2
713 # define STM32_UART_BAUD 115200 // 115200 Baud
714 # include "stm32f4xx_usart.h"
715 #elif defined(ARM_STM32F10X)
716 # define STM32_UART_COM USART3 // UART3 on PB10
717 #elif defined(ARDUINO) // Arduino Serial implementation
718 # if defined(USB_SERIAL)
719 # include "usb_serial.h"
721 # error USB_SERIAL not defined in ARDUINO Environment
724 # if IRMP_EXT_LOGGING == 1 // use external logging
725 # include "irmpextlog.h"
726 # else // normal UART log (IRMP_EXT_LOGGING == 0)
728 # ifndef UNIX_OR_WINDOWS
729 # include <util/setbaud.h>
734 #define UART0_UBRRH UBRR0H
735 #define UART0_UBRRL UBRR0L
736 #define UART0_UCSRA UCSR0A
737 #define UART0_UCSRB UCSR0B
738 #define UART0_UCSRC UCSR0C
739 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
740 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
741 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
743 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
745 #define UART0_URSEL_BIT_VALUE (0)
747 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
748 #define UART0_UDR UDR0
749 #define UART0_U2X U2X0
753 #define UART0_UBRRH UBRRH
754 #define UART0_UBRRL UBRRL
755 #define UART0_UCSRA UCSRA
756 #define UART0_UCSRB UCSRB
757 #define UART0_UCSRC UCSRC
758 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
759 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
760 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
762 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
764 #define UART0_URSEL_BIT_VALUE (0)
766 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
767 #define UART0_UDR UDR
768 #define UART0_U2X U2X
771 #endif //IRMP_EXT_LOGGING
772 #endif //ARM_STM32F4XX
774 /*---------------------------------------------------------------------------------------------------------------------------------------------------
776 * @details Initializes UART
777 *---------------------------------------------------------------------------------------------------------------------------------------------------
780 irmp_uart_init (void)
782 #ifndef UNIX_OR_WINDOWS
783 #if defined(ARM_STM32F4XX)
784 GPIO_InitTypeDef GPIO_InitStructure
;
785 USART_InitTypeDef USART_InitStructure
;
787 // Clock enable vom TX Pin
788 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
790 // Clock enable der UART
791 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
793 // UART Alternative-Funktion mit dem IO-Pin verbinden
794 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
796 // UART als Alternative-Funktion mit PushPull
797 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
798 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
799 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
800 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
803 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
804 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
807 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
809 // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
810 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
811 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
812 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
813 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
814 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
815 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
816 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
819 USART_Cmd(STM32_UART_COM
, ENABLE
);
821 #elif defined(ARM_STM32F10X)
822 GPIO_InitTypeDef GPIO_InitStructure
;
823 USART_InitTypeDef USART_InitStructure
;
825 // Clock enable vom TX Pin
826 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
828 // Clock enable der UART
829 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
831 // UART als Alternative-Funktion mit PushPull
832 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
833 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
836 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
837 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
840 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
842 // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
843 USART_InitStructure
.USART_BaudRate
= 115200;
844 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
845 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
846 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
847 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
848 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
849 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
852 USART_Cmd(STM32_UART_COM
, ENABLE
);
854 #elif defined(ARDUINO)
855 // we use the Arduino Serial Imlementation
856 // you have to call Serial.begin(SER_BAUD); in Arduino setup() function
858 #elif defined (__AVR_XMEGA__)
860 PMIC
.CTRL
|= PMIC_HILVLEN_bm
;
862 USARTC1
.BAUDCTRLB
= 0;
863 USARTC1
.BAUDCTRLA
= F_CPU
/ 153600 - 1;
864 USARTC1
.CTRLA
= USART_RXCINTLVL_HI_gc
; // high INT level (receive)
865 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; // activated RX and TX
866 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; // 8 Bit
867 PORTC
.DIR |= (1<<7); // TXD is output
868 PORTC
.DIR &= ~(1<<6);
872 #if (IRMP_EXT_LOGGING == 0) // use UART
873 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
874 UART0_UBRRL
= UBRRL_VALUE
;
877 UART0_UCSRA
|= (1<<UART0_U2X
);
879 UART0_UCSRA
&= ~(1<<UART0_U2X
);
882 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
883 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
884 #else // other log method
886 #endif //IRMP_EXT_LOGGING
887 #endif //ARM_STM32F4XX
888 #endif // UNIX_OR_WINDOWS
891 /*---------------------------------------------------------------------------------------------------------------------------------------------------
893 * @details Sends character
894 * @param ch character to be transmitted
895 *---------------------------------------------------------------------------------------------------------------------------------------------------
898 irmp_uart_putc (unsigned char ch
)
900 #ifndef UNIX_OR_WINDOWS
901 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
902 // warten bis altes Byte gesendet wurde
903 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
908 USART_SendData(STM32_UART_COM
, ch
);
912 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
913 USART_SendData(STM32_UART_COM
, '\r');
916 #elif defined(ARDUINO)
917 // we use the Arduino Serial Imlementation
918 usb_serial_putchar(ch
);
921 #if (IRMP_EXT_LOGGING == 0)
923 # if defined (__AVR_XMEGA__)
924 while (!(USARTC1
.STATUS
& USART_DREIF_bm
));
928 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
934 #endif //__AVR_XMEGA__
937 sendextlog(ch
); // use external log
939 #endif //IRMP_EXT_LOGGING
940 #endif //ARM_STM32F4XX
943 #endif // UNIX_OR_WINDOWS
946 /*---------------------------------------------------------------------------------------------------------------------------------------------------
948 *---------------------------------------------------------------------------------------------------------------------------------------------------
951 #define STARTCYCLES 2 // min count of zeros before start of logging
952 #define ENDBITS 1000 // number of sequenced highbits to detect end
953 #define DATALEN 700 // log buffer size
956 irmp_log (uint_fast8_t val
)
958 static uint8_t buf
[DATALEN
]; // logging buffer
959 static uint_fast16_t buf_idx
; // index
960 static uint_fast8_t startcycles
; // current number of start-zeros
961 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
962 static uint_fast8_t last_val
= 1;
964 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
972 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
978 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
979 { // if stop condition is true, output on uart
983 uint_fast8_t v
= '1';
986 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
988 irmp_uart_putc ('0'); // the ignored starting zeros
991 for (i
= 0; i
< buf_idx
; i
++)
1000 d
|= ((uint_fast16_t) buf
[i
] << 8);
1003 for (j
= 0; j
< d
; j
++)
1008 v
= (v
== '1') ? '0' : '1';
1011 for (i8
= 0; i8
< 20; i8
++)
1013 irmp_uart_putc ('1');
1016 irmp_uart_putc ('\n');
1022 else if (buf_idx
< DATALEN
- 3)
1026 buf
[buf_idx
++] = 0xff;
1027 buf
[buf_idx
++] = (cnt
& 0xff);
1028 buf
[buf_idx
] = (cnt
>> 8);
1044 #define irmp_log(val)
1045 #endif //IRMP_LOGGING
1049 uint_fast8_t protocol
; // ir protocol
1050 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
1051 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
1052 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
1053 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
1054 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
1055 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
1056 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
1057 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
1058 uint_fast8_t address_offset
; // address offset
1059 uint_fast8_t address_end
; // end of address
1060 uint_fast8_t command_offset
; // command offset
1061 uint_fast8_t command_end
; // end of command
1062 uint_fast8_t complete_len
; // complete length of frame
1063 uint_fast8_t stop_bit
; // flag: frame has stop bit
1064 uint_fast8_t lsb_first
; // flag: LSB first
1065 uint_fast8_t flags
; // some flags
1068 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1070 static const PROGMEM IRMP_PARAMETER sircs_param
=
1072 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
1073 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1074 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1075 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1076 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1077 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1078 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1079 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1080 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1081 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
1082 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
1083 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
1084 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
1085 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1086 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
1087 SIRCS_LSB
, // lsb_first: flag: LSB first
1088 SIRCS_FLAGS
// flags: some flags
1093 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1095 static const PROGMEM IRMP_PARAMETER nec_param
=
1097 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1098 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1099 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1100 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1101 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1102 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1103 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1104 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1105 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1106 NEC_ADDRESS_OFFSET
, // address_offset: address offset
1107 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
1108 NEC_COMMAND_OFFSET
, // command_offset: command offset
1109 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
1110 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1111 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1112 NEC_LSB
, // lsb_first: flag: LSB first
1113 NEC_FLAGS
// flags: some flags
1116 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1118 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1119 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1120 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1121 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1122 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1123 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1124 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1125 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1126 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1127 0, // address_offset: address offset
1128 0, // address_end: end of address
1129 0, // command_offset: command offset
1130 0, // command_end: end of command
1131 0, // complete_len: complete length of frame
1132 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1133 NEC_LSB
, // lsb_first: flag: LSB first
1134 NEC_FLAGS
// flags: some flags
1139 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1141 static const PROGMEM IRMP_PARAMETER nec42_param
=
1143 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1144 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1145 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1146 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1147 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1148 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1149 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1150 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1151 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1152 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1153 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1154 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1155 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1156 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1157 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1158 NEC_LSB
, // lsb_first: flag: LSB first
1159 NEC_FLAGS
// flags: some flags
1164 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1166 static const PROGMEM IRMP_PARAMETER lgair_param
=
1168 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1169 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1170 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1171 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1172 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1173 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1174 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1175 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1176 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1177 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1178 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1179 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1180 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1181 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1182 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1183 NEC_LSB
, // lsb_first: flag: LSB first
1184 NEC_FLAGS
// flags: some flags
1189 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1191 static const PROGMEM IRMP_PARAMETER samsung_param
=
1193 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1194 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1195 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1196 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1197 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1198 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1199 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1200 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1201 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1202 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1203 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1204 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1205 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1206 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1207 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1208 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1209 SAMSUNG_FLAGS
// flags: some flags
1214 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1216 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1218 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1219 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1220 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1221 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1222 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1223 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1224 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1225 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1226 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1227 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1228 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1229 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1230 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1231 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1232 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1233 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1234 TELEFUNKEN_FLAGS
// flags: some flags
1239 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1241 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1243 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1244 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1245 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1246 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1247 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1248 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1249 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1250 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1251 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1252 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1253 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1254 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1255 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1256 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1257 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1258 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1259 MATSUSHITA_FLAGS
// flags: some flags
1264 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1266 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1268 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1269 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1270 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1271 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1272 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1273 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1274 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1275 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1276 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1277 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1278 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1279 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1280 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1281 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1282 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1283 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1284 KASEIKYO_FLAGS
// flags: some flags
1289 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
1291 static const PROGMEM IRMP_PARAMETER panasonic_param
=
1293 IRMP_PANASONIC_PROTOCOL
, // protocol: ir protocol
1294 PANASONIC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1295 PANASONIC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1296 PANASONIC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1297 PANASONIC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1298 PANASONIC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1299 PANASONIC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1300 PANASONIC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1301 PANASONIC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1302 PANASONIC_ADDRESS_OFFSET
, // address_offset: address offset
1303 PANASONIC_ADDRESS_OFFSET
+ PANASONIC_ADDRESS_LEN
, // address_end: end of address
1304 PANASONIC_COMMAND_OFFSET
, // command_offset: command offset
1305 PANASONIC_COMMAND_OFFSET
+ PANASONIC_COMMAND_LEN
, // command_end: end of command
1306 PANASONIC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1307 PANASONIC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1308 PANASONIC_LSB
, // lsb_first: flag: LSB first
1309 PANASONIC_FLAGS
// flags: some flags
1314 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
1316 static const PROGMEM IRMP_PARAMETER mitsu_heavy_param
=
1318 IRMP_MITSU_HEAVY_PROTOCOL
, // protocol: ir protocol
1319 MITSU_HEAVY_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1320 MITSU_HEAVY_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1321 MITSU_HEAVY_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1322 MITSU_HEAVY_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1323 MITSU_HEAVY_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1324 MITSU_HEAVY_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1325 MITSU_HEAVY_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1326 MITSU_HEAVY_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1327 MITSU_HEAVY_ADDRESS_OFFSET
, // address_offset: address offset
1328 MITSU_HEAVY_ADDRESS_OFFSET
+ MITSU_HEAVY_ADDRESS_LEN
, // address_end: end of address
1329 MITSU_HEAVY_COMMAND_OFFSET
, // command_offset: command offset
1330 MITSU_HEAVY_COMMAND_OFFSET
+ MITSU_HEAVY_COMMAND_LEN
, // command_end: end of command
1331 MITSU_HEAVY_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1332 MITSU_HEAVY_STOP_BIT
, // stop_bit: flag: frame has stop bit
1333 MITSU_HEAVY_LSB
, // lsb_first: flag: LSB first
1334 MITSU_HEAVY_FLAGS
// flags: some flags
1339 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1341 static const PROGMEM IRMP_PARAMETER recs80_param
=
1343 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1344 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1345 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1346 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1347 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1348 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1349 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1350 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1351 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1352 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1353 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1354 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1355 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1356 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1357 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1358 RECS80_LSB
, // lsb_first: flag: LSB first
1359 RECS80_FLAGS
// flags: some flags
1364 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1366 static const PROGMEM IRMP_PARAMETER rc5_param
=
1368 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1369 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1370 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1371 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1372 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1373 0, // pulse_0_len_min: here: not used
1374 0, // pulse_0_len_max: here: not used
1375 0, // pause_0_len_min: here: not used
1376 0, // pause_0_len_max: here: not used
1377 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1378 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1379 RC5_COMMAND_OFFSET
, // command_offset: command offset
1380 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1381 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1382 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1383 RC5_LSB
, // lsb_first: flag: LSB first
1384 RC5_FLAGS
// flags: some flags
1389 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1391 static const PROGMEM IRMP_PARAMETER s100_param
=
1393 IRMP_S100_PROTOCOL
, // protocol: ir protocol
1394 S100_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1395 S100_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1396 S100_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1397 S100_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1398 0, // pulse_0_len_min: here: not used
1399 0, // pulse_0_len_max: here: not used
1400 0, // pause_0_len_min: here: not used
1401 0, // pause_0_len_max: here: not used
1402 S100_ADDRESS_OFFSET
, // address_offset: address offset
1403 S100_ADDRESS_OFFSET
+ S100_ADDRESS_LEN
, // address_end: end of address
1404 S100_COMMAND_OFFSET
, // command_offset: command offset
1405 S100_COMMAND_OFFSET
+ S100_COMMAND_LEN
, // command_end: end of command
1406 S100_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1407 S100_STOP_BIT
, // stop_bit: flag: frame has stop bit
1408 S100_LSB
, // lsb_first: flag: LSB first
1409 S100_FLAGS
// flags: some flags
1414 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1416 static const PROGMEM IRMP_PARAMETER denon_param
=
1418 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1419 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1420 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1421 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1422 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1423 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1424 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1425 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1426 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1427 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1428 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1429 DENON_COMMAND_OFFSET
, // command_offset: command offset
1430 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1431 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1432 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1433 DENON_LSB
, // lsb_first: flag: LSB first
1434 DENON_FLAGS
// flags: some flags
1439 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1441 static const PROGMEM IRMP_PARAMETER rc6_param
=
1443 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1445 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1446 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1447 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1448 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1449 0, // pulse_0_len_min: here: not used
1450 0, // pulse_0_len_max: here: not used
1451 0, // pause_0_len_min: here: not used
1452 0, // pause_0_len_max: here: not used
1453 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1454 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1455 RC6_COMMAND_OFFSET
, // command_offset: command offset
1456 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1457 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1458 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1459 RC6_LSB
, // lsb_first: flag: LSB first
1460 RC6_FLAGS
// flags: some flags
1465 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1467 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1469 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1470 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1471 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1472 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1473 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1474 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1475 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1476 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1477 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1478 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1479 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1480 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1481 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1482 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1483 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1484 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1485 RECS80EXT_FLAGS
// flags: some flags
1490 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1492 static const PROGMEM IRMP_PARAMETER nubert_param
=
1494 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1495 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1496 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1497 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1498 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1499 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1500 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1501 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1502 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1503 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1504 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1505 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1506 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1507 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1508 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1509 NUBERT_LSB
, // lsb_first: flag: LSB first
1510 NUBERT_FLAGS
// flags: some flags
1515 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1517 static const PROGMEM IRMP_PARAMETER fan_param
=
1519 IRMP_FAN_PROTOCOL
, // protocol: ir protocol
1520 FAN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1521 FAN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1522 FAN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1523 FAN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1524 FAN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1525 FAN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1526 FAN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1527 FAN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1528 FAN_ADDRESS_OFFSET
, // address_offset: address offset
1529 FAN_ADDRESS_OFFSET
+ FAN_ADDRESS_LEN
, // address_end: end of address
1530 FAN_COMMAND_OFFSET
, // command_offset: command offset
1531 FAN_COMMAND_OFFSET
+ FAN_COMMAND_LEN
, // command_end: end of command
1532 FAN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1533 FAN_STOP_BIT
, // stop_bit: flag: frame has NO stop bit
1534 FAN_LSB
, // lsb_first: flag: LSB first
1535 FAN_FLAGS
// flags: some flags
1540 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1542 static const PROGMEM IRMP_PARAMETER speaker_param
=
1544 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1545 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1546 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1547 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1548 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1549 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1550 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1551 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1552 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1553 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1554 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1555 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1556 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1557 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1558 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1559 SPEAKER_LSB
, // lsb_first: flag: LSB first
1560 SPEAKER_FLAGS
// flags: some flags
1565 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1567 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1569 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1570 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1571 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1572 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1573 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1574 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1575 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1576 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1577 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1578 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1579 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1580 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1581 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1582 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1583 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1584 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1585 BANG_OLUFSEN_FLAGS
// flags: some flags
1590 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1592 static uint_fast8_t first_bit
;
1594 static const PROGMEM IRMP_PARAMETER grundig_param
=
1596 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1598 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1599 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1600 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1601 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1602 0, // pulse_0_len_min: here: not used
1603 0, // pulse_0_len_max: here: not used
1604 0, // pause_0_len_min: here: not used
1605 0, // pause_0_len_max: here: not used
1606 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1607 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1608 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1609 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1610 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1611 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1612 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1613 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1618 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1620 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1622 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1623 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1624 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1625 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1626 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1627 0, // pulse_0_len_min: here: not used
1628 0, // pulse_0_len_max: here: not used
1629 0, // pause_0_len_min: here: not used
1630 0, // pause_0_len_max: here: not used
1631 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1632 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1633 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1634 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1635 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1636 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1637 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1638 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1643 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1645 static const PROGMEM IRMP_PARAMETER fdc_param
=
1647 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1648 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1649 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1650 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1651 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1652 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1653 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1654 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1655 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1656 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1657 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1658 FDC_COMMAND_OFFSET
, // command_offset: command offset
1659 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1660 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1661 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1662 FDC_LSB
, // lsb_first: flag: LSB first
1663 FDC_FLAGS
// flags: some flags
1668 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1670 static const PROGMEM IRMP_PARAMETER rccar_param
=
1672 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1673 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1674 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1675 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1676 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1677 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1678 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1679 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1680 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1681 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1682 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1683 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1684 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1685 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1686 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1687 RCCAR_LSB
, // lsb_first: flag: LSB first
1688 RCCAR_FLAGS
// flags: some flags
1693 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1695 static const PROGMEM IRMP_PARAMETER nikon_param
=
1697 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1698 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1699 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1700 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1701 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1702 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1703 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1704 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1705 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1706 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1707 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1708 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1709 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1710 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1711 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1712 NIKON_LSB
, // lsb_first: flag: LSB first
1713 NIKON_FLAGS
// flags: some flags
1718 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1720 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1722 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1723 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1724 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1725 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1726 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1727 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1728 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1729 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1730 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1731 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1732 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1733 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1734 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1735 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1736 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1737 KATHREIN_LSB
, // lsb_first: flag: LSB first
1738 KATHREIN_FLAGS
// flags: some flags
1743 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1745 static const PROGMEM IRMP_PARAMETER netbox_param
=
1747 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1748 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1749 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1750 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1751 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1752 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1753 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1754 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1755 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1756 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1757 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1758 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1759 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1760 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1761 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1762 NETBOX_LSB
, // lsb_first: flag: LSB first
1763 NETBOX_FLAGS
// flags: some flags
1768 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1770 static const PROGMEM IRMP_PARAMETER lego_param
=
1772 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1773 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1774 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1775 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1776 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1777 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1778 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1779 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1780 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1781 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1782 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1783 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1784 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1785 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1786 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1787 LEGO_LSB
, // lsb_first: flag: LSB first
1788 LEGO_FLAGS
// flags: some flags
1793 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1795 static const PROGMEM IRMP_PARAMETER thomson_param
=
1797 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1798 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1799 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1800 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1801 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1802 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1803 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1804 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1805 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1806 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1807 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1808 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1809 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1810 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1811 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1812 THOMSON_LSB
, // lsb_first: flag: LSB first
1813 THOMSON_FLAGS
// flags: some flags
1818 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1820 static const PROGMEM IRMP_PARAMETER bose_param
=
1822 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1823 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1824 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1825 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1826 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1827 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1828 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1829 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1830 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1831 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1832 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1833 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1834 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1835 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1836 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1837 BOSE_LSB
, // lsb_first: flag: LSB first
1838 BOSE_FLAGS
// flags: some flags
1843 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1845 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1847 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1849 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1850 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1851 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1852 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1853 0, // pulse_0_len_min: here: not used
1854 0, // pulse_0_len_max: here: not used
1855 0, // pause_0_len_min: here: not used
1856 0, // pause_0_len_max: here: not used
1857 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1858 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1859 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1860 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1861 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1862 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1863 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1864 A1TVBOX_FLAGS
// flags: some flags
1869 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
1871 static const PROGMEM IRMP_PARAMETER merlin_param
=
1873 IRMP_MERLIN_PROTOCOL
, // protocol: ir protocol
1875 MERLIN_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1876 MERLIN_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1877 MERLIN_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1878 MERLIN_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1879 0, // pulse_0_len_min: here: not used
1880 0, // pulse_0_len_max: here: not used
1881 0, // pause_0_len_min: here: not used
1882 0, // pause_0_len_max: here: not used
1883 MERLIN_ADDRESS_OFFSET
, // address_offset: address offset
1884 MERLIN_ADDRESS_OFFSET
+ MERLIN_ADDRESS_LEN
, // address_end: end of address
1885 MERLIN_COMMAND_OFFSET
, // command_offset: command offset
1886 MERLIN_COMMAND_OFFSET
+ MERLIN_COMMAND_LEN
, // command_end: end of command
1887 MERLIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1888 MERLIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1889 MERLIN_LSB
, // lsb_first: flag: LSB first
1890 MERLIN_FLAGS
// flags: some flags
1895 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1897 static const PROGMEM IRMP_PARAMETER ortek_param
=
1899 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1901 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1902 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1903 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1904 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1905 0, // pulse_0_len_min: here: not used
1906 0, // pulse_0_len_max: here: not used
1907 0, // pause_0_len_min: here: not used
1908 0, // pause_0_len_max: here: not used
1909 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1910 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1911 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1912 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1913 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1914 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1915 ORTEK_LSB
, // lsb_first: flag: LSB first
1916 ORTEK_FLAGS
// flags: some flags
1921 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1923 static const PROGMEM IRMP_PARAMETER roomba_param
=
1925 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1926 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1927 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1928 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1929 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1930 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1931 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1932 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1933 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1934 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1935 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1936 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1937 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1938 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1939 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1940 ROOMBA_LSB
, // lsb_first: flag: LSB first
1941 ROOMBA_FLAGS
// flags: some flags
1946 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1948 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1950 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1952 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1953 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1954 0, // pause_1_len_min: here: minimum length of short pause
1955 0, // pause_1_len_max: here: maximum length of short pause
1956 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1957 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1958 0, // pause_0_len_min: here: not used
1959 0, // pause_0_len_max: here: not used
1960 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1961 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1962 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1963 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1964 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1965 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1966 RCMM32_LSB
, // lsb_first: flag: LSB first
1967 RCMM32_FLAGS
// flags: some flags
1972 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
1974 static const PROGMEM IRMP_PARAMETER pentax_param
=
1976 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
1977 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1978 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1979 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1980 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1981 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1982 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1983 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1984 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1985 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
1986 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
1987 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
1988 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
1989 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1990 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1991 PENTAX_LSB
, // lsb_first: flag: LSB first
1992 PENTAX_FLAGS
// flags: some flags
1997 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
1999 static const PROGMEM IRMP_PARAMETER acp24_param
=
2001 IRMP_ACP24_PROTOCOL
, // protocol: ir protocol
2002 ACP24_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2003 ACP24_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2004 ACP24_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2005 ACP24_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2006 ACP24_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2007 ACP24_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2008 ACP24_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2009 ACP24_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2010 ACP24_ADDRESS_OFFSET
, // address_offset: address offset
2011 ACP24_ADDRESS_OFFSET
+ ACP24_ADDRESS_LEN
, // address_end: end of address
2012 ACP24_COMMAND_OFFSET
, // command_offset: command offset
2013 ACP24_COMMAND_OFFSET
+ ACP24_COMMAND_LEN
, // command_end: end of command
2014 ACP24_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2015 ACP24_STOP_BIT
, // stop_bit: flag: frame has stop bit
2016 ACP24_LSB
, // lsb_first: flag: LSB first
2017 ACP24_FLAGS
// flags: some flags
2022 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2024 static const PROGMEM IRMP_PARAMETER radio1_param
=
2026 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
2028 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2029 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2030 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2031 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2032 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2033 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2034 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2035 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2036 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
2037 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
2038 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
2039 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
2040 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2041 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
2042 RADIO1_LSB
, // lsb_first: flag: LSB first
2043 RADIO1_FLAGS
// flags: some flags
2048 static uint_fast8_t irmp_bit
; // current bit position
2049 static IRMP_PARAMETER irmp_param
;
2051 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2052 static IRMP_PARAMETER irmp_param2
;
2055 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
2056 static volatile uint_fast8_t irmp_protocol
;
2057 static volatile uint_fast16_t irmp_address
;
2058 static volatile uint_fast16_t irmp_command
;
2059 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
2060 static volatile uint_fast8_t irmp_flags
;
2061 // static volatile uint_fast8_t irmp_busy_flag;
2063 #if defined(__MBED__)
2064 // DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp
2065 gpio_t gpioIRin
; // use low level c function instead
2070 #define input(x) (x)
2071 static uint_fast8_t IRMP_PIN
;
2072 static uint_fast8_t radio
;
2075 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2076 * Initialize IRMP decoder
2077 * @details Configures IRMP input pin
2078 *---------------------------------------------------------------------------------------------------------------------------------------------------
2084 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
2085 #elif defined (ARM_STM32) // STM32
2086 GPIO_InitTypeDef GPIO_InitStructure
;
2088 /* GPIOx clock enable */
2089 # if defined (ARM_STM32L1XX)
2090 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2091 # elif defined (ARM_STM32F10X)
2092 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2093 # elif defined (ARM_STM32F4XX)
2094 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2097 /* GPIO Configuration */
2098 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
2099 # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
2100 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
2101 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2102 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
2103 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
2104 # elif defined (ARM_STM32F10X)
2105 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2106 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
2108 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
2110 #elif defined(STELLARIS_ARM_CORTEX_M4)
2111 // Enable the GPIO port
2112 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
2115 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
2116 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_STRENGTH_2MA
, GPIO_PIN_TYPE_STD_WPU
);
2118 #elif defined(__SDCC_stm8) // STM8
2119 IRMP_GPIO_STRUCT
->DDR
&= ~(1<<IRMP_BIT
); // pin is input
2120 IRMP_GPIO_STRUCT
->CR1
|= (1<<IRMP_BIT
); // activate pullup
2122 #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
2123 pinMode(IRMP_PIN
, INPUT
);
2125 #elif defined(__xtensa__) // ESP8266
2126 // select pin function
2127 # if (IRMP_BIT_NUMBER == 12)
2128 PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U
, FUNC_GPIO12
);
2129 // doesn't work for me:
2130 // # elif (IRMP_BIT_NUMBER == 13)
2131 // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);
2133 # warning Please add PIN_FUNC_SELECT when necessary.
2135 GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER
);
2137 #elif defined(__MBED__)
2138 gpio_init_in_ex(&gpioIRin
, IRMP_PIN
, IRMP_PINMODE
); // initialize input for IR diode
2141 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
2142 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
2145 #if IRMP_LOGGING == 1
2150 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2152 * @details gets decoded IRMP data
2153 * @param pointer in order to store IRMP data
2154 * @return TRUE: successful, FALSE: failed
2155 *---------------------------------------------------------------------------------------------------------------------------------------------------
2158 irmp_get_data (IRMP_DATA
* irmp_data_p
)
2160 uint_fast8_t rtc
= FALSE
;
2162 if (irmp_ir_detected
)
2164 switch (irmp_protocol
)
2166 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2167 case IRMP_SAMSUNG_PROTOCOL
:
2168 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2170 irmp_command
&= 0xff;
2171 irmp_command
|= irmp_id
<< 8;
2176 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2177 case IRMP_SAMSUNG48_PROTOCOL
:
2178 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2184 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2185 case IRMP_NEC_PROTOCOL
:
2186 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2188 irmp_command
&= 0xff;
2191 else if (irmp_address
== 0x87EE)
2194 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2196 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2197 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2198 irmp_command
&= 0x00FF;
2203 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2204 case IRMP_BOSE_PROTOCOL
:
2205 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2207 irmp_command
&= 0xff;
2212 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2213 case IRMP_SIEMENS_PROTOCOL
:
2214 case IRMP_RUWIDO_PROTOCOL
:
2215 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2222 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2223 case IRMP_KATHREIN_PROTOCOL
:
2224 if (irmp_command
!= 0x0000)
2230 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2231 case IRMP_RC5_PROTOCOL
:
2232 irmp_address
&= ~0x20; // clear toggle bit
2236 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2237 case IRMP_S100_PROTOCOL
:
2238 irmp_address
&= ~0x20; // clear toggle bit
2242 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2243 case IRMP_IR60_PROTOCOL
:
2244 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2251 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2256 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2257 case IRMP_RCCAR_PROTOCOL
:
2258 // frame in irmp_data:
2259 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2260 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2261 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2262 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2263 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2264 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2265 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2269 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2270 case IRMP_NETBOX_PROTOCOL
:
2271 if (irmp_command
& 0x1000) // last bit set?
2273 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2276 irmp_command
&= 0x7F;
2279 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2282 irmp_command
|= 0x80;
2288 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2295 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2300 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2301 case IRMP_LEGO_PROTOCOL
:
2303 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2305 if ((irmp_command
& 0x000F) == crc
)
2313 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2315 // rtc = TRUE; // don't accept codes with CRC errors
2330 irmp_data_p
->protocol
= irmp_protocol
;
2331 irmp_data_p
->address
= irmp_address
;
2332 irmp_data_p
->command
= irmp_command
;
2333 irmp_data_p
->flags
= irmp_flags
;
2339 irmp_ir_detected
= FALSE
;
2345 #if IRMP_USE_CALLBACK == 1
2347 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2349 irmp_callback_ptr
= cb
;
2351 #endif // IRMP_USE_CALLBACK == 1
2353 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2354 static uint_fast16_t irmp_tmp_address
; // ir address
2355 static uint_fast16_t irmp_tmp_command
; // ir command
2357 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2358 static uint_fast16_t irmp_tmp_address2
; // ir address
2359 static uint_fast16_t irmp_tmp_command2
; // ir command
2362 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2363 static uint_fast16_t irmp_lgair_address
; // ir address
2364 static uint_fast16_t irmp_lgair_command
; // ir command
2367 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2368 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2370 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2371 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2372 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2375 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2376 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2379 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2380 static uint_fast8_t check
; // number of '1' of the first 14 bits, check if even.
2381 static uint_fast8_t mitsu_parity
; // number of '1' of the first 14 bits, check if even.
2384 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2386 * @details store bit in temp address or temp command
2387 * @param value to store: 0 or 1
2388 *---------------------------------------------------------------------------------------------------------------------------------------------------
2390 // verhindert, dass irmp_store_bit() inline compiliert wird:
2391 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2394 irmp_store_bit (uint_fast8_t value
)
2396 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2397 if (irmp_param
.protocol
== IRMP_ACP24_PROTOCOL
) // squeeze 64 bits into 16 bits:
2403 // 0123456789012345678901234567890123456789012345678901234567890123456789
2404 // N VVMMM ? ??? t vmA x y TTTT
2406 // irmp_data_p->command:
2413 case 0: irmp_tmp_command
|= (1<<15); break; // N
2414 case 2: irmp_tmp_command
|= (1<<13); break; // V
2415 case 3: irmp_tmp_command
|= (1<<12); break; // V
2416 case 4: irmp_tmp_command
|= (1<<10); break; // M
2417 case 5: irmp_tmp_command
|= (1<< 9); break; // M
2418 case 6: irmp_tmp_command
|= (1<< 8); break; // M
2419 case 20: irmp_tmp_command
|= (1<< 6); break; // t
2420 case 22: irmp_tmp_command
|= (1<<11); break; // v
2421 case 23: irmp_tmp_command
|= (1<< 7); break; // m
2422 case 24: irmp_tmp_command
|= (1<<14); break; // A
2423 case 26: irmp_tmp_command
|= (1<< 5); break; // x
2424 case 44: irmp_tmp_command
|= (1<< 4); break; // y
2425 case 66: irmp_tmp_command
|= (1<< 3); break; // T
2426 case 67: irmp_tmp_command
|= (1<< 2); break; // T
2427 case 68: irmp_tmp_command
|= (1<< 1); break; // T
2428 case 69: irmp_tmp_command
|= (1<< 0); break; // T
2433 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2435 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2436 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2445 else if (irmp_bit
== 14)
2447 if (value
) // value == 1: even parity
2451 parity
= PARITY_CHECK_FAILED
;
2455 parity
= PARITY_CHECK_OK
;
2460 if (parity
& 0x01) // value == 0: odd parity
2462 parity
= PARITY_CHECK_OK
;
2466 parity
= PARITY_CHECK_FAILED
;
2477 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2478 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2485 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2487 if (irmp_param
.lsb_first
)
2489 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2493 irmp_tmp_address
<<= 1;
2494 irmp_tmp_address
|= value
;
2497 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2499 if (irmp_param
.lsb_first
)
2501 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2502 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2504 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2509 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2514 irmp_tmp_command
<<= 1;
2515 irmp_tmp_command
|= value
;
2519 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2520 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2524 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2525 irmp_lgair_address
|= value
;
2527 else if (irmp_bit
< 24)
2529 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2530 irmp_lgair_command
|= value
;
2536 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2537 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2539 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2544 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2545 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2547 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2552 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2553 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2555 if (irmp_bit
>= 20 && irmp_bit
< 24)
2557 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2559 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2561 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2564 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2568 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2572 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2579 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2580 if (irmp_param
.protocol
== IRMP_MITSU_HEAVY_PROTOCOL
) // squeeze 64 bits into 16 bits:
2582 if (irmp_bit
== 72 )
2583 { // irmp_tmp_address, irmp_tmp_command received: check parity & compress
2584 mitsu_parity
= PARITY_CHECK_OK
;
2586 check
= irmp_tmp_address
>> 8; // inverted upper byte == lower byte?
2589 if (check
== (irmp_tmp_address
& 0xFF))
2591 irmp_tmp_address
<<= 8; // throw away upper byte
2595 mitsu_parity
= PARITY_CHECK_FAILED
;
2598 check
= irmp_tmp_command
>> 8; // inverted upper byte == lower byte?
2600 if (check
== (irmp_tmp_command
& 0xFF))
2601 { // ok: pack together
2602 irmp_tmp_address
|= irmp_tmp_command
& 0xFF; // byte 1, byte2 in irmp_tmp_address, irmp_tmp_command can be used for byte 3
2606 mitsu_parity
= PARITY_CHECK_FAILED
;
2608 irmp_tmp_command
= 0;
2611 if (irmp_bit
>= 72 )
2612 { // receive 3. word in irmp_tmp_command
2613 irmp_tmp_command
<<= 1;
2614 irmp_tmp_command
|= value
;
2618 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
2626 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2628 * @details store bit in temp address or temp command
2629 * @param value to store: 0 or 1
2630 *---------------------------------------------------------------------------------------------------------------------------------------------------
2632 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2634 irmp_store_bit2 (uint_fast8_t value
)
2636 uint_fast8_t irmp_bit2
;
2638 if (irmp_param
.protocol
)
2640 irmp_bit2
= irmp_bit
- 2;
2644 irmp_bit2
= irmp_bit
- 1;
2647 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2649 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2651 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2653 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2656 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2658 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2660 * @details ISR routine, called 10000 times per second
2661 *---------------------------------------------------------------------------------------------------------------------------------------------------
2666 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2667 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2668 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2669 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2670 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2671 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2672 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2673 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2674 static uint_fast8_t repetition_frame_number
;
2675 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2676 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2677 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2679 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2680 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2682 #if IRMP_SUPPORT_MANCHESTER == 1
2683 static PAUSE_LEN last_pause
; // last pause value
2685 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2686 static uint_fast8_t last_value
; // last bit value
2688 uint_fast8_t irmp_input
; // input value
2694 #if defined(__SDCC_stm8)
2695 irmp_input
= input(IRMP_GPIO_STRUCT
->IDR
)
2696 #elif defined(__MBED__)
2697 //irmp_input = inputPin;
2698 irmp_input
= gpio_read (&gpioIRin
);
2700 irmp_input
= input(IRMP_PIN
);
2703 #if IRMP_USE_CALLBACK == 1
2704 if (irmp_callback_ptr
)
2706 static uint_fast8_t last_inverted_input
;
2708 if (last_inverted_input
!= !irmp_input
)
2710 (*irmp_callback_ptr
) (! irmp_input
);
2711 last_inverted_input
= !irmp_input
;
2714 #endif // IRMP_USE_CALLBACK == 1
2716 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2718 if (! irmp_ir_detected
) // ir code already detected?
2720 if (! irmp_start_bit_detected
) // start bit detected?
2722 if (! irmp_input
) // receiving burst?
2724 // irmp_busy_flag = TRUE;
2726 if (! irmp_pulse_time
)
2728 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2731 irmp_pulse_time
++; // increment counter
2735 if (irmp_pulse_time
) // it's dark....
2736 { // set flags for counting the time of darkness...
2737 irmp_start_bit_detected
= 1;
2738 wait_for_start_space
= 1;
2740 irmp_tmp_command
= 0;
2741 irmp_tmp_address
= 0;
2742 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2745 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2749 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2750 irmp_tmp_command2
= 0;
2751 irmp_tmp_address2
= 0;
2753 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2754 irmp_lgair_command
= 0;
2755 irmp_lgair_address
= 0;
2758 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2759 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2760 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2765 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2767 key_repetition_len
++;
2769 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2770 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2772 denon_repetition_len
++;
2774 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2777 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2778 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2780 last_irmp_denon_command
= 0;
2781 denon_repetition_len
= 0xFFFF;
2784 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2791 if (wait_for_start_space
) // we have received start bit...
2792 { // ...and are counting the time of darkness
2793 if (irmp_input
) // still dark?
2795 irmp_pause_time
++; // increment counter
2797 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2798 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
) ||
2799 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2801 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2804 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2805 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2810 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2813 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
);
2814 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2818 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2819 irmp_pulse_time
= 0;
2820 irmp_pause_time
= 0;
2824 { // receiving first data pulse!
2825 IRMP_PARAMETER
* irmp_param_p
;
2826 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2828 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2829 irmp_param2
.protocol
= 0;
2833 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2836 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2837 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2838 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2841 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2842 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2843 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2845 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2848 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2850 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2851 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2852 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2853 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2856 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2857 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2858 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2860 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2863 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2865 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2866 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2867 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2869 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2871 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2872 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2873 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2875 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2878 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2879 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2880 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2882 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2885 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2886 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2888 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2889 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2890 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2892 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2893 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2894 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2896 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2899 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2902 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2903 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2904 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2907 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2912 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2913 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2914 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2915 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2916 { // it's JVC repetition type 3
2918 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2919 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2920 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2922 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2925 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2927 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2929 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2930 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2931 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2934 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2935 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2936 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2938 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2941 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2943 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2944 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2945 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2948 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2949 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2950 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2952 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2955 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2957 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2958 if (irmp_pulse_time
>= ACP24_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ACP24_START_BIT_PULSE_LEN_MAX
&&
2959 irmp_pause_time
>= ACP24_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ACP24_START_BIT_PAUSE_LEN_MAX
)
2962 ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2963 ACP24_START_BIT_PULSE_LEN_MIN
, ACP24_START_BIT_PULSE_LEN_MAX
,
2964 ACP24_START_BIT_PAUSE_LEN_MIN
, ACP24_START_BIT_PAUSE_LEN_MAX
);
2966 irmp_param_p
= (IRMP_PARAMETER
*) &acp24_param
;
2969 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2971 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2972 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
2973 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
2976 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2977 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
2978 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
2980 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
2983 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2985 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2986 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2987 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2990 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2991 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2992 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2994 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2997 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2999 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3000 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
3001 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3004 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3005 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
3006 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
3008 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
3011 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3013 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3014 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
3015 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
3016 { // it's MATSUSHITA
3018 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3019 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
3020 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
3022 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
3025 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3027 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3028 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
3029 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
3032 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3033 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
3034 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
3036 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
3039 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3041 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3042 if (irmp_pulse_time
>= PANASONIC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PANASONIC_START_BIT_PULSE_LEN_MAX
&&
3043 irmp_pause_time
>= PANASONIC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PANASONIC_START_BIT_PAUSE_LEN_MAX
)
3046 ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3047 PANASONIC_START_BIT_PULSE_LEN_MIN
, PANASONIC_START_BIT_PULSE_LEN_MAX
,
3048 PANASONIC_START_BIT_PAUSE_LEN_MIN
, PANASONIC_START_BIT_PAUSE_LEN_MAX
);
3050 irmp_param_p
= (IRMP_PARAMETER
*) &panasonic_param
;
3053 #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3055 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3056 if (irmp_pulse_time
>= MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
&&
3057 irmp_pause_time
>= MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
)
3058 { // it's MITSU_HEAVY
3060 ANALYZE_PRINTF ("protocol = MITSU_HEAVY, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3061 MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
, MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
,
3062 MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
, MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
);
3064 irmp_param_p
= (IRMP_PARAMETER
*) &mitsu_heavy_param
;
3067 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3069 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
3070 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
3071 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
3074 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3075 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
3076 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
3078 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
3081 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
3083 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
3084 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
3085 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
3088 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3089 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
3090 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
3092 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
3095 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
3097 #if IRMP_SUPPORT_S100_PROTOCOL == 1
3098 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
3099 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
3100 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
3101 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
3104 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3105 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3106 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
3107 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3108 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
3111 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
3112 last_pause
= irmp_pause_time
;
3114 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
3115 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
3118 rc5_cmd_bit6
= 1<<6;
3126 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
3128 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3129 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
3130 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
3131 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
3132 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
3134 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3135 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3136 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3139 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
3140 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3141 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3142 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3143 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3144 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3145 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3147 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
3150 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3152 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3153 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3154 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3157 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
3158 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3159 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3160 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3161 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3162 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3163 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3165 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
3168 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3171 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3172 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3173 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
3174 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3175 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
3179 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
3180 last_pause
= irmp_pause_time
;
3182 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
3183 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
3186 rc5_cmd_bit6
= 1<<6;
3194 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
3196 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3197 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
3198 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
3199 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
3202 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3203 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
3204 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
3205 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
3207 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
3210 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3212 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3213 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
3214 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
3215 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
3218 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3219 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3220 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
3221 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
3223 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
3226 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3228 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3229 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
3230 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
3233 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3234 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
3235 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
3237 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
3240 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3242 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3243 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
3244 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
3247 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3248 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
3249 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
3251 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
3256 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3258 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3259 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
3260 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
3263 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3264 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
3265 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
3267 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
3270 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3272 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3273 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
3274 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
3277 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3278 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
3279 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
3281 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
3284 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3286 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3287 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
3288 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
3291 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3292 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
3293 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
3295 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
3298 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3300 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3301 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3302 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3305 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3306 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3307 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3309 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3312 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3314 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3315 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3316 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3317 { // it's BANG_OLUFSEN
3319 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3320 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3321 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3322 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3323 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3324 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3325 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3326 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3327 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3328 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3329 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3330 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3331 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3333 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3337 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3339 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3340 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3341 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3344 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3345 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3346 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3348 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3349 last_pause
= irmp_pause_time
;
3353 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3355 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3356 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3357 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3360 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3361 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3362 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3364 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3369 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3371 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3372 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3373 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3374 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3375 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3376 { // it's RUWIDO or SIEMENS
3378 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3379 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3380 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3381 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3382 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3384 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3385 last_pause
= irmp_pause_time
;
3389 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3391 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3392 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3393 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3396 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3397 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3398 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3400 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3403 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3405 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3406 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3407 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3410 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3411 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3412 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3414 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3417 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3419 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3420 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3421 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3424 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3425 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3426 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3428 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3431 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3433 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3434 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3435 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3438 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3439 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3440 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3442 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3445 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3447 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3448 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3449 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3452 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3453 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3454 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3456 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3459 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3461 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3462 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3463 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3466 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3467 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3468 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3470 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3475 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3477 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3478 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3479 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3480 { // it's ORTEK (Hama)
3482 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3483 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3484 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3486 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3492 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3494 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3495 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3496 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3499 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3500 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3501 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3503 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3506 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3509 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3511 irmp_start_bit_detected
= 0; // wait for another start bit...
3514 if (irmp_start_bit_detected
)
3516 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3518 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3521 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3522 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3528 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3529 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3530 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3531 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3535 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3536 if (irmp_param2
.protocol
)
3539 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3540 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3541 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3542 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3548 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3549 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3552 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3557 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3560 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3561 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3567 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3568 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3569 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3570 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3575 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3576 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3578 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3579 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3583 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3584 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3585 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3586 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3592 #if IRMP_SUPPORT_MANCHESTER == 1
3593 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3594 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3595 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3597 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3600 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3601 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3604 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3606 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3609 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3610 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3613 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3617 #endif // IRMP_SUPPORT_MANCHESTER == 1
3619 #if IRMP_SUPPORT_SERIAL == 1
3620 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3625 #endif // IRMP_SUPPORT_SERIAL == 1
3628 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3629 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3632 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3635 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3636 { // pause timings correct for "1"?
3638 ANALYZE_PUTCHAR ('1'); // yes, store 1
3643 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3644 { // pause timings correct for "0"?
3646 ANALYZE_PUTCHAR ('0'); // yes, store 0
3653 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3654 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3655 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3658 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3661 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3662 { // pause timings correct for "1"?
3664 ANALYZE_PUTCHAR ('1'); // yes, store 1
3669 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3670 { // pause timings correct for "0"?
3672 ANALYZE_PUTCHAR ('0'); // yes, store 0
3679 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3681 ; // else do nothing
3684 irmp_pulse_time
= 1; // set counter to 1, not 0
3685 irmp_pause_time
= 0;
3686 wait_for_start_space
= 0;
3689 else if (wait_for_space
) // the data section....
3690 { // counting the time of darkness....
3691 uint_fast8_t got_light
= FALSE
;
3693 if (irmp_input
) // still dark?
3695 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3698 #if IRMP_SUPPORT_MANCHESTER == 1
3699 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3701 #if IRMP_SUPPORT_SERIAL == 1
3702 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3704 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3707 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3709 ANALYZE_PRINTF ("stop bit detected\n");
3712 irmp_param
.stop_bit
= 0;
3717 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",
3718 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3720 irmp_start_bit_detected
= 0; // wait for another start bit...
3721 irmp_pulse_time
= 0;
3722 irmp_pause_time
= 0;
3727 irmp_pause_time
++; // increment counter
3729 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3730 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3731 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3732 irmp_bit
>= 12 - 1) // pause too long?
3733 { // yes, break and close this frame
3734 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3735 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3736 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3737 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3738 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3742 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3743 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3744 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3745 { // yes, break and close this frame
3746 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3749 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3751 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3753 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3756 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3758 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3763 #if IRMP_SUPPORT_SERIAL == 1
3764 // NETBOX generates no stop bit, here is the timeout condition:
3765 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3766 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3768 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3772 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3773 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3775 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3778 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3780 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3781 irmp_param
.stop_bit
= TRUE
; // set flag
3783 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3784 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3785 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3786 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3787 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3788 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3790 irmp_tmp_command
<<= 1;
3791 irmp_tmp_command
|= first_bit
;
3793 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3794 { // special manchester decoder
3795 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3796 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3797 irmp_param
.stop_bit
= TRUE
; // set flag
3799 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3802 ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit
);
3804 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3805 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3806 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3807 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3808 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3810 if (irmp_tmp_command
& 0x300)
3812 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3813 irmp_tmp_command
&= 0xFF;
3819 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3820 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3822 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3823 { // special manchester decoder
3824 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3825 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3826 irmp_param
.stop_bit
= TRUE
; // set flag
3828 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3831 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3833 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3834 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3835 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3836 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3837 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3840 // RUWIDO: AAAAAAAAACCCCCCCp
3841 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3842 irmp_tmp_address
<<= 2;
3843 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3844 irmp_tmp_command
&= 0x003F;
3845 // irmp_tmp_command <<= 4;
3846 irmp_tmp_command
|= last_value
;
3851 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3852 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3853 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3854 { // break and close this frame
3855 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3857 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3859 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3861 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3864 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3868 #if IRMP_SUPPORT_MANCHESTER == 1
3869 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3870 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3871 { // special manchester decoder
3872 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3873 irmp_param
.stop_bit
= TRUE
; // set flag
3876 #endif // IRMP_SUPPORT_MANCHESTER == 1
3877 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3879 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3883 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3884 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3887 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3889 irmp_param
.stop_bit
= TRUE
; // set flag
3890 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3891 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3892 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3893 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3894 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3896 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3897 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3898 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3901 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3903 irmp_param
.stop_bit
= TRUE
; // set flag
3904 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3905 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3906 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3907 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3908 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3910 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3912 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3913 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3914 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3917 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3919 irmp_param
.stop_bit
= TRUE
; // set flag
3920 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3921 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3923 // 0123456789ABC0123456789ABC0123456701234567
3924 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3925 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3926 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3927 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3929 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3930 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3931 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3934 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3936 irmp_param
.stop_bit
= TRUE
; // set flag
3937 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3938 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3939 irmp_tmp_address
= irmp_lgair_address
;
3940 irmp_tmp_command
= irmp_lgair_command
;
3942 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3943 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3944 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3947 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3949 irmp_param
.stop_bit
= TRUE
; // set flag
3950 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3951 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3953 // 0123456789ABC0123456789ABC0123456701234567
3954 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3955 // JVC: AAAACCCCCCCCCCCC
3956 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3957 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3959 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3960 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3962 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3963 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3966 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3968 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3969 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3970 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3971 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3973 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3975 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3976 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3980 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3981 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3984 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3986 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3988 else // if ((irmp_bit == 24)
3991 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3993 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3995 irmp_param
.stop_bit
= TRUE
; // set flag
3996 irmp_param
.complete_len
= irmp_bit
; // patch length
3998 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
4000 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4001 else if (irmp_param
.protocol
== IRMP_MATSUSHITA_PROTOCOL
&& irmp_bit
== 22) // it was a TECHNICS stop bit
4004 ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit
);
4007 // The first 12 bits have been stored in irmp_tmp_command (LSB first)
4008 // The following 10 bits have been stored in irmp_tmp_address (LSB first)
4009 // The code of TECHNICS is:
4010 // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)
4011 // ccccccccccccaaaaaaaaaa
4012 // where C is inverted value of c
4014 irmp_tmp_address
<<= 1;
4015 if (irmp_tmp_command
& (1<<11))
4017 irmp_tmp_address
|= 1;
4018 irmp_tmp_command
&= ~(1<<11);
4021 if (irmp_tmp_command
== ((~irmp_tmp_address
) & 0x07FF))
4023 irmp_tmp_address
= 0;
4025 irmp_param
.protocol
= IRMP_TECHNICS_PROTOCOL
; // switch protocol
4026 irmp_param
.complete_len
= irmp_bit
; // patch length
4031 ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");
4032 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4034 irmp_start_bit_detected
= 0; // wait for another start bit...
4035 irmp_pulse_time
= 0;
4036 irmp_pause_time
= 0;
4039 #endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4043 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
4044 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4046 irmp_start_bit_detected
= 0; // wait for another start bit...
4047 irmp_pulse_time
= 0;
4048 irmp_pause_time
= 0;
4061 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4064 #if IRMP_SUPPORT_MANCHESTER == 1
4065 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
4068 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
4069 #else // better, but some IR-RCs use asymmetric timings :-/
4070 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
4071 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
4074 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4075 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4078 ANALYZE_PUTCHAR ('T');
4080 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
4095 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4098 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
4100 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
4102 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4103 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4106 ANALYZE_PUTCHAR ('T');
4110 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
4123 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4126 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
4128 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
4129 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4130 if (! irmp_param2
.protocol
)
4137 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
4141 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
4142 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
4144 uint_fast8_t manchester_value
;
4146 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
4148 manchester_value
= last_value
? 0 : 1;
4149 last_value
= manchester_value
;
4153 manchester_value
= last_value
;
4157 ANALYZE_PUTCHAR (manchester_value
+ '0');
4160 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4161 if (! irmp_param2
.protocol
)
4169 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4170 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
4173 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
4175 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
4176 irmp_param
.address_offset
= 5;
4177 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
4178 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
4179 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
4180 irmp_tmp_address
= 0;
4182 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4184 irmp_store_bit (manchester_value
);
4188 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4189 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
4190 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
4191 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
4192 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
4195 ANALYZE_PUTCHAR ('?');
4197 irmp_param
.protocol
= 0; // switch to FDC, see below
4200 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4201 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4202 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
4203 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
4204 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
4205 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
4208 ANALYZE_PUTCHAR ('?');
4210 irmp_param
.protocol
= 0; // switch to RCCAR, see below
4213 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4216 ANALYZE_PUTCHAR ('?');
4218 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4219 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4221 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4222 irmp_pause_time
= 0;
4226 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4227 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
4229 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
4232 ANALYZE_PRINTF (" 1 (FDC)\n");
4234 irmp_store_bit2 (1);
4236 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
4239 ANALYZE_PRINTF (" 0 (FDC)\n");
4241 irmp_store_bit2 (0);
4244 if (! irmp_param
.protocol
)
4247 ANALYZE_PRINTF ("Switching to FDC protocol\n");
4249 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4250 irmp_param2
.protocol
= 0;
4251 irmp_tmp_address
= irmp_tmp_address2
;
4252 irmp_tmp_command
= irmp_tmp_command2
;
4255 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4256 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4257 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
4259 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
4262 ANALYZE_PRINTF (" 1 (RCCAR)\n");
4264 irmp_store_bit2 (1);
4266 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
4269 ANALYZE_PRINTF (" 0 (RCCAR)\n");
4271 irmp_store_bit2 (0);
4274 if (! irmp_param
.protocol
)
4277 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4279 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4280 irmp_param2
.protocol
= 0;
4281 irmp_tmp_address
= irmp_tmp_address2
;
4282 irmp_tmp_command
= irmp_tmp_command2
;
4285 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4287 last_pause
= irmp_pause_time
;
4291 #endif // IRMP_SUPPORT_MANCHESTER == 1
4293 #if IRMP_SUPPORT_SERIAL == 1
4294 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
4296 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
4299 ANALYZE_PUTCHAR ('1');
4303 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
4305 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
4309 irmp_pulse_time
= 0;
4313 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
4316 ANALYZE_PUTCHAR ('0');
4320 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
4322 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
4326 irmp_pause_time
= 0;
4335 #endif // IRMP_SUPPORT_SERIAL == 1
4337 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4338 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
4340 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
4341 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4344 ANALYZE_PRINTF ("SYNC\n");
4349 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4351 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4353 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4355 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4356 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4357 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4358 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4361 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4363 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4364 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4365 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4366 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4368 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4371 ANALYZE_PUTCHAR ('1');
4380 ANALYZE_PUTCHAR ('0');
4388 { // timing incorrect!
4390 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4391 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4393 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4394 irmp_pause_time
= 0;
4398 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4400 #if IRMP_SUPPORT_NEC16_PROTOCOL
4401 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4402 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4403 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4404 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4405 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4406 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4409 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4411 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4412 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4413 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4414 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4415 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4416 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4420 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4422 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4423 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4425 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4427 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4429 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4432 ANALYZE_PRINTF ("3rd start bit\n");
4438 { // timing incorrect!
4440 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
);
4441 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4443 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4444 irmp_pause_time
= 0;
4447 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4449 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4452 ANALYZE_PRINTF ("trailer bit\n");
4458 { // timing incorrect!
4460 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
);
4461 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4463 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4464 irmp_pause_time
= 0;
4469 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4470 { // pulse & pause timings correct for "1"?
4472 ANALYZE_PUTCHAR ('1');
4479 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4480 { // pulse & pause timings correct for "0"?
4482 ANALYZE_PUTCHAR ('0');
4489 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4492 ANALYZE_PUTCHAR (last_value
+ '0');
4495 irmp_store_bit (last_value
);
4499 { // timing incorrect!
4501 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
);
4502 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4504 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4505 irmp_pause_time
= 0;
4510 { // timing incorrect!
4512 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
);
4513 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4515 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4516 irmp_pause_time
= 0;
4520 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4522 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4523 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4525 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4528 ANALYZE_PUTCHAR ('0');
4529 ANALYZE_PUTCHAR ('0');
4534 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4537 ANALYZE_PUTCHAR ('0');
4538 ANALYZE_PUTCHAR ('1');
4543 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4546 ANALYZE_PUTCHAR ('1');
4547 ANALYZE_PUTCHAR ('0');
4552 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4555 ANALYZE_PUTCHAR ('1');
4556 ANALYZE_PUTCHAR ('1');
4562 ANALYZE_PRINTF ("\n");
4569 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4570 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4571 { // pulse & pause timings correct for "1"?
4573 ANALYZE_PUTCHAR ('1');
4579 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4580 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4581 { // pulse & pause timings correct for "0"?
4583 ANALYZE_PUTCHAR ('0');
4590 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4592 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4593 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4594 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4595 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4597 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4604 ANALYZE_PUTCHAR ('S');
4607 irmp_tmp_command
<<= 1;
4612 ANALYZE_PUTCHAR ('S');
4620 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4621 { // timing incorrect!
4623 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4624 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4626 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4627 irmp_pause_time
= 0;
4630 irmp_pulse_time
= 1; // set counter to 1, not 0
4634 { // counting the pulse length ...
4635 if (! irmp_input
) // still light?
4637 irmp_pulse_time
++; // increment counter
4641 wait_for_space
= 1; // let's count the time (see above)
4642 irmp_pause_time
= 1; // set pause counter to 1, not 0
4646 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4648 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4650 repetition_frame_number
++;
4654 repetition_frame_number
= 0;
4657 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4658 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4659 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4662 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4663 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4665 key_repetition_len
= 0;
4670 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4671 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4672 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4675 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4676 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4678 key_repetition_len
= 0;
4683 #if 0 && IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4684 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4685 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4688 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4689 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4691 key_repetition_len
= 0;
4696 #if 0 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4697 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4698 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4701 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4702 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4704 key_repetition_len
= 0;
4709 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4710 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4711 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4714 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4715 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4717 key_repetition_len
= 0;
4722 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4723 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4724 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4727 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4728 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4730 key_repetition_len
= 0;
4737 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4739 irmp_ir_detected
= TRUE
;
4741 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4742 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4743 { // check for repetition frame
4744 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4746 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4747 last_irmp_denon_command
= 0;
4749 irmp_protocol
= irmp_param
.protocol
; // store protocol
4750 irmp_address
= irmp_tmp_address
; // store address
4751 irmp_command
= irmp_tmp_command
; // store command
4755 if ((irmp_tmp_command
& 0x01) == 0x00)
4758 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4760 last_irmp_denon_command
= irmp_tmp_command
;
4761 denon_repetition_len
= 0;
4762 irmp_ir_detected
= FALSE
;
4767 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4769 last_irmp_denon_command
= 0;
4770 irmp_ir_detected
= FALSE
;
4775 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4777 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4778 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4779 { // Grundig start frame?
4781 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4783 irmp_ir_detected
= FALSE
;
4786 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4788 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4789 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4790 { // Nokia start frame?
4792 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4794 irmp_ir_detected
= FALSE
;
4797 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4799 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4800 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4802 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4805 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4806 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4808 irmp_tmp_address
= last_irmp_address
; // address is last address
4809 irmp_tmp_command
= last_irmp_command
; // command is last command
4810 irmp_flags
|= IRMP_FLAG_REPETITION
;
4811 key_repetition_len
= 0;
4816 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4817 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4819 irmp_ir_detected
= FALSE
;
4822 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4824 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4825 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4827 uint_fast8_t xor_value
;
4829 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4831 if (xor_value
!= (xor_check
[2] & 0x0F))
4834 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4836 irmp_ir_detected
= FALSE
;
4839 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4841 if (xor_value
!= xor_check
[5])
4844 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4846 irmp_ir_detected
= FALSE
;
4849 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4851 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4853 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4854 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4856 if (parity
== PARITY_CHECK_FAILED
)
4859 ANALYZE_PRINTF ("error 6: parity check failed\n");
4861 irmp_ir_detected
= FALSE
;
4864 if ((irmp_tmp_address
& 0x03) == 0x02)
4867 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4869 irmp_ir_detected
= FALSE
;
4871 irmp_tmp_address
>>= 2;
4873 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4875 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
4876 if (irmp_param
.protocol
== IRMP_MITSU_HEAVY_PROTOCOL
)
4878 check
= irmp_tmp_command
>> 8; // inverted upper byte == lower byte?
4880 if (check
== (irmp_tmp_command
& 0xFF)) { //ok:
4881 irmp_tmp_command
&= 0xFF;
4883 else mitsu_parity
= PARITY_CHECK_FAILED
;
4884 if (mitsu_parity
== PARITY_CHECK_FAILED
)
4887 ANALYZE_PRINTF ("error 7: parity check failed\n");
4889 irmp_ir_detected
= FALSE
;
4892 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
4894 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4895 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4897 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4900 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4902 irmp_protocol
= irmp_param
.protocol
;
4905 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4906 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4908 if (irmp_tmp_command
& 0x000F) // released key?
4910 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4914 irmp_tmp_command
>>= 4; // no, it's a pressed key
4916 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4917 irmp_tmp_address
&= 0x003F;
4921 irmp_address
= irmp_tmp_address
; // store address
4922 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4923 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4925 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4929 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4930 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4932 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4935 #if IRMP_SUPPORT_S100_PROTOCOL == 1
4936 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
4938 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4941 irmp_command
= irmp_tmp_command
; // store command
4943 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4944 irmp_id
= irmp_tmp_id
;
4949 if (irmp_ir_detected
)
4951 if (last_irmp_command
== irmp_tmp_command
&&
4952 last_irmp_address
== irmp_tmp_address
&&
4953 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4955 irmp_flags
|= IRMP_FLAG_REPETITION
;
4958 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4959 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4961 key_repetition_len
= 0;
4966 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4970 irmp_start_bit_detected
= 0; // and wait for next start bit
4971 irmp_tmp_command
= 0;
4972 irmp_pulse_time
= 0;
4973 irmp_pause_time
= 0;
4975 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4976 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4977 { // set pulse time here!
4978 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4980 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4985 #if defined(STELLARIS_ARM_CORTEX_M4)
4986 // Clear the timer interrupt
4987 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4990 return (irmp_ir_detected
);
4995 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4996 * main functions - for Unix/Linux + Windows only!
5000 * Compile it under linux with:
5003 * usage: ./irmp [-v|-s|-a|-l] < file
5009 * -l list pulse/pauses
5010 *---------------------------------------------------------------------------------------------------------------------------------------------------
5014 print_spectrum (char * text
, int * buf
, int is_pulse
)
5027 puts ("-----------------------------------------------------------------------------");
5028 printf ("%s:\n", text
);
5030 for (i
= 0; i
< 256; i
++)
5032 if (buf
[i
] > max_value
)
5038 for (i
= 1; i
< 200; i
++)
5043 value
= (buf
[i
] * 60) / max_value
;
5045 for (j
= 0; j
< value
; j
++)
5049 printf (" %d\n", buf
[i
]);
5060 average
= (float) sum
/ (float) counter
;
5071 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
5072 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
5073 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
5075 tolerance
= (max
- average
);
5077 if (average
- min
> tolerance
)
5079 tolerance
= average
- min
;
5082 tolerance
= tolerance
* 100 / average
;
5083 printf ("tol: %4.1f%%\n", tolerance
);
5093 #define STATE_LEFT_SHIFT 0x01
5094 #define STATE_RIGHT_SHIFT 0x02
5095 #define STATE_LEFT_CTRL 0x04
5096 #define STATE_LEFT_ALT 0x08
5097 #define STATE_RIGHT_ALT 0x10
5099 #define KEY_ESCAPE 0x1B // keycode = 0x006e
5100 #define KEY_MENUE 0x80 // keycode = 0x0070
5101 #define KEY_BACK 0x81 // keycode = 0x0071
5102 #define KEY_FORWARD 0x82 // keycode = 0x0072
5103 #define KEY_ADDRESS 0x83 // keycode = 0x0073
5104 #define KEY_WINDOW 0x84 // keycode = 0x0074
5105 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
5106 #define KEY_STOP 0x86 // keycode = 0x0076
5107 #define KEY_MAIL 0x87 // keycode = 0x0077
5108 #define KEY_FAVORITES 0x88 // keycode = 0x0078
5109 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
5110 #define KEY_SETUP 0x8A // keycode = 0x007a
5111 #define KEY_FONT 0x8B // keycode = 0x007b
5112 #define KEY_PRINT 0x8C // keycode = 0x007c
5113 #define KEY_ON_OFF 0x8E // keycode = 0x007c
5115 #define KEY_INSERT 0x90 // keycode = 0x004b
5116 #define KEY_DELETE 0x91 // keycode = 0x004c
5117 #define KEY_LEFT 0x92 // keycode = 0x004f
5118 #define KEY_HOME 0x93 // keycode = 0x0050
5119 #define KEY_END 0x94 // keycode = 0x0051
5120 #define KEY_UP 0x95 // keycode = 0x0053
5121 #define KEY_DOWN 0x96 // keycode = 0x0054
5122 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
5123 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
5124 #define KEY_RIGHT 0x99 // keycode = 0x0059
5125 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
5126 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
5129 get_fdc_key (uint_fast16_t cmd
)
5131 static uint8_t key_table
[128] =
5133 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
5134 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0xDF, '´', 0, '\b',
5135 '\t', 'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 0xFC, '+', 0, 0, 'a',
5136 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0xF6, 0xE4, '#', '\r', 0, '<', 'y', 'x',
5137 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
5139 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
5140 '\t', 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 0xDC, '*', 0, 0, 'A',
5141 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 0xD6, 0xC4, '\'', '\r', 0, '>', 'Y', 'X',
5142 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5144 static uint_fast8_t state
;
5146 uint_fast8_t key
= 0;
5150 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
5151 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
5152 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
5153 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
5154 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
5155 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
5156 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
5157 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
5158 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
5159 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
5161 case 0x006e: key
= KEY_ESCAPE
; break;
5162 case 0x004b: key
= KEY_INSERT
; break;
5163 case 0x004c: key
= KEY_DELETE
; break;
5164 case 0x004f: key
= KEY_LEFT
; break;
5165 case 0x0050: key
= KEY_HOME
; break;
5166 case 0x0051: key
= KEY_END
; break;
5167 case 0x0053: key
= KEY_UP
; break;
5168 case 0x0054: key
= KEY_DOWN
; break;
5169 case 0x0055: key
= KEY_PAGE_UP
; break;
5170 case 0x0056: key
= KEY_PAGE_DOWN
; break;
5171 case 0x0059: key
= KEY_RIGHT
; break;
5172 case 0x0400: key
= KEY_MOUSE_1
; break;
5173 case 0x0800: key
= KEY_MOUSE_2
; break;
5177 if (!(cmd
& 0x80)) // pressed key
5179 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
5181 key
= cmd
+ 0x10; // 7x -> 8x
5183 else if (cmd
< 64) // key listed in key_table
5185 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
5189 case 0x0003: key
= 0xB2; break; // upper 2
5190 case 0x0008: key
= '{'; break;
5191 case 0x0009: key
= '['; break;
5192 case 0x000A: key
= ']'; break;
5193 case 0x000B: key
= '}'; break;
5194 case 0x000C: key
= '\\'; break;
5195 case 0x001C: key
= '~'; break;
5196 case 0x002D: key
= '|'; break;
5197 case 0x0034: key
= 0xB5; break; // Mu
5200 else if (state
& (STATE_LEFT_CTRL
))
5202 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
5204 key
= key_table
[cmd
] - 'a' + 1;
5208 key
= key_table
[cmd
];
5213 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5217 key
= key_table
[idx
];
5229 static int analyze
= FALSE
;
5230 static int list
= FALSE
;
5231 static IRMP_DATA irmp_data
;
5232 static int expected_protocol
;
5233 static int expected_address
;
5234 static int expected_command
;
5235 static int do_check_expected_values
;
5240 if (! analyze
&& ! list
)
5244 if (irmp_get_data (&irmp_data
))
5248 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5252 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5255 if (irmp_data
.protocol
== IRMP_ACP24_PROTOCOL
)
5257 uint16_t temp
= (irmp_data
.command
& 0x000F) + 15;
5259 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5260 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, temp
);
5262 else if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5264 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5266 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5267 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5269 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5271 char * p
= (char *) NULL
;
5275 case '\t' : p
= "TAB"; break;
5276 case '\r' : p
= "CR"; break;
5277 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5278 case KEY_MENUE
: p
= "MENUE"; break;
5279 case KEY_BACK
: p
= "BACK"; break;
5280 case KEY_FORWARD
: p
= "FORWARD"; break;
5281 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5282 case KEY_WINDOW
: p
= "WINDOW"; break;
5283 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5284 case KEY_STOP
: p
= "STOP"; break;
5285 case KEY_MAIL
: p
= "MAIL"; break;
5286 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5287 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5288 case KEY_SETUP
: p
= "SETUP"; break;
5289 case KEY_FONT
: p
= "FONT"; break;
5290 case KEY_PRINT
: p
= "PRINT"; break;
5291 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5293 case KEY_INSERT
: p
= "INSERT"; break;
5294 case KEY_DELETE
: p
= "DELETE"; break;
5295 case KEY_LEFT
: p
= "LEFT"; break;
5296 case KEY_HOME
: p
= "HOME"; break;
5297 case KEY_END
: p
= "END"; break;
5298 case KEY_UP
: p
= "UP"; break;
5299 case KEY_DOWN
: p
= "DOWN"; break;
5300 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5301 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5302 case KEY_RIGHT
: p
= "RIGHT"; break;
5303 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5304 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5305 default : p
= "<UNKNWON>"; break;
5308 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5309 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5313 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5314 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5319 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5320 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5323 if (do_check_expected_values
)
5325 if (irmp_data
.protocol
!= expected_protocol
||
5326 irmp_data
.address
!= expected_address
||
5327 irmp_data
.command
!= expected_command
)
5329 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5330 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5334 printf (" checked!\n");
5336 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5347 main (int argc
, char ** argv
)
5355 int start_pulses
[256];
5356 int start_pauses
[256];
5360 int first_pulse
= TRUE
;
5361 int first_pause
= TRUE
;
5365 if (! strcmp (argv
[1], "-v"))
5369 else if (! strcmp (argv
[1], "-l"))
5373 else if (! strcmp (argv
[1], "-a"))
5377 else if (! strcmp (argv
[1], "-s"))
5381 else if (! strcmp (argv
[1], "-r"))
5387 for (i
= 0; i
< 256; i
++)
5389 start_pulses
[i
] = 0;
5390 start_pauses
[i
] = 0;
5397 while ((ch
= getchar ()) != EOF
)
5399 if (ch
== '_' || ch
== '0')
5407 printf ("pause: %d\n", pause
);
5416 start_pauses
[pause
]++;
5418 first_pause
= FALSE
;
5434 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5440 printf ("pulse: %d ", pulse
);
5449 start_pulses
[pulse
]++;
5451 first_pulse
= FALSE
;
5467 else if (ch
== '\n')
5472 if (list
&& pause
> 0)
5474 printf ("pause: %d\n", pause
);
5480 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5494 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5505 puts ("----------------------------------------------------------------------");
5509 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5511 if (ch
!= '\r') // ignore CR in DOS/Windows files
5513 if (ch
== '[' && idx
== -1)
5521 do_check_expected_values
= FALSE
;
5525 expected_protocol
= atoi (buf
);
5527 if (expected_protocol
> 0)
5536 if (sscanf (p
, "%x", &expected_address
) == 1)
5538 do_check_expected_values
= TRUE
;
5545 if (do_check_expected_values
)
5547 do_check_expected_values
= FALSE
;
5555 if (sscanf (p
, "%x", &expected_command
) == 1)
5557 do_check_expected_values
= TRUE
;
5564 if (do_check_expected_values
)
5566 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5571 else if (idx
< 1024 - 2)
5591 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5592 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5593 print_spectrum ("PULSES", pulses
, TRUE
);
5594 print_spectrum ("PAUSES", pauses
, FALSE
);
5595 puts ("-----------------------------------------------------------------------------");