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.192 2017/02/17 09:13:06 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 SAMSUNGAH_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
144 #define SAMSUNGAH_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
145 #define SAMSUNGAH_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
146 #define SAMSUNGAH_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
147 #define SAMSUNGAH_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
148 #define SAMSUNGAH_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
149 #define SAMSUNGAH_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
150 #define SAMSUNGAH_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
151 #define SAMSUNGAH_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
152 #define SAMSUNGAH_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
154 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
155 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
156 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
157 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
158 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
159 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
160 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
161 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
162 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
163 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
165 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
166 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
167 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
168 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
169 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
170 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
171 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
172 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
173 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
174 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
176 #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)
177 #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)
178 #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)
179 #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)
180 #define MITSU_HEAVY_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
181 #define MITSU_HEAVY_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
182 #define MITSU_HEAVY_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
183 #define MITSU_HEAVY_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
184 #define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
185 #define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
187 #define VINCENT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
188 #define VINCENT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
189 #define VINCENT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
190 #define VINCENT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define VINCENT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
192 #define VINCENT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
193 #define VINCENT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
194 #define VINCENT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
195 #define VINCENT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
196 #define VINCENT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
198 #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
201 #define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
203 #define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
204 #define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
205 #define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
206 #define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
207 #define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
209 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
210 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
211 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
212 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
213 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
214 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
215 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
217 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
218 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
221 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
222 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
223 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
225 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
226 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
229 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
230 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
232 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
233 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
234 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
236 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
237 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
240 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
241 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
243 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
244 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
245 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
246 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
247 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
248 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
249 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
250 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
252 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
253 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
254 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
255 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
256 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
257 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
259 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
260 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
261 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
262 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
263 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
264 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
265 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
266 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
267 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
268 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
270 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
271 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
272 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
275 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
276 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
277 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
278 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
279 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
281 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
282 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
283 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
284 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
285 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
286 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
287 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
288 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
289 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
290 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
291 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
292 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
294 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
295 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
296 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
297 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
298 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
299 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
300 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
301 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
302 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
303 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
304 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
305 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
307 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
308 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
309 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
310 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
311 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
312 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
313 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
314 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
315 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
316 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
317 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
318 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
320 #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)
321 #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)
322 #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)
323 #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)
324 #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)
325 #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)
326 #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)
327 #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)
328 #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)
329 #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)
330 #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)
331 #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
332 #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)
333 #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)
334 #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)
335 #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)
336 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
337 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
338 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
339 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
340 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
341 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
342 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
343 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
344 #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)
345 #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)
347 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
348 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
349 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
350 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
351 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
352 #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)
353 #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)
355 #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)
356 #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)
357 #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)
358 #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)
359 #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)
360 #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)
361 #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)
362 #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)
364 #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
365 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
366 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
367 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
368 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
369 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
370 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
371 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
373 #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
375 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
377 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
379 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
380 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
381 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
382 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
383 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
384 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
385 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
386 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
387 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
388 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
390 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
391 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
392 #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!
393 #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!
394 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
395 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
396 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
397 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
398 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
399 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
400 // autodetect JVC repetition frame within 50 msec:
401 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
403 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
404 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
405 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
406 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
407 #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)
408 #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)
409 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
410 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
411 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
412 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
413 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
414 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
415 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
417 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
418 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
419 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
420 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
421 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
422 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
423 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
424 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
425 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
426 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
427 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
428 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
429 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
430 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
432 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
433 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
434 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
435 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
436 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
437 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
438 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
439 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
441 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
442 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
443 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
444 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
445 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
446 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
447 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
448 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
449 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
450 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
452 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
453 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
454 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
455 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
456 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
457 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
458 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
459 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
460 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
461 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
462 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
464 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
465 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
466 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
467 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
468 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
469 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
470 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
471 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
473 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
474 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
475 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
476 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
477 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
478 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
479 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
480 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
482 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
483 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
484 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
485 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
486 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
487 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
488 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
489 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
491 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
492 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
493 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
494 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
495 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
496 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
497 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
498 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
499 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
500 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
501 // autodetect TELEFUNKEN repetition frame within 50 msec:
502 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
504 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
505 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
506 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
507 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
508 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
509 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
510 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
511 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
512 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
513 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
514 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
515 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
516 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
517 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
519 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
520 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
521 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
522 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
523 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
524 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
525 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
526 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
527 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
528 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
529 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
530 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
531 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
532 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
534 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
535 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
536 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
537 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
538 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
539 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
540 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
541 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
542 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
543 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
544 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
545 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
546 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
547 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
549 #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
550 #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
551 #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
552 #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
553 #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
554 #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
555 #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
556 #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
557 #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
558 #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
560 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
561 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
562 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
563 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
564 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
565 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
566 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
567 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
568 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
569 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
570 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
571 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
572 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
573 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
575 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
578 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
579 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
580 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
581 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
582 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
584 static int time_counter
;
587 /******************************* not every PIC compiler knows variadic macros :-(
589 # define ANALYZE_PUTCHAR(a)
590 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
591 # define ANALYZE_PRINTF(...)
592 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
594 # define ANALYZE_NEWLINE()
595 *********************************/
598 #if IRMP_USE_CALLBACK == 1
599 static void (*irmp_callback_ptr
) (uint_fast8_t);
600 #endif // IRMP_USE_CALLBACK == 1
602 #define PARITY_CHECK_OK 1
603 #define PARITY_CHECK_FAILED 0
605 /*---------------------------------------------------------------------------------------------------------------------------------------------------
607 *---------------------------------------------------------------------------------------------------------------------------------------------------
609 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
610 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
611 static const char proto_sircs
[] PROGMEM
= "SIRCS";
612 static const char proto_nec
[] PROGMEM
= "NEC";
613 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
614 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
615 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
616 static const char proto_recs80
[] PROGMEM
= "RECS80";
617 static const char proto_rc5
[] PROGMEM
= "RC5";
618 static const char proto_denon
[] PROGMEM
= "DENON";
619 static const char proto_rc6
[] PROGMEM
= "RC6";
620 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
621 static const char proto_apple
[] PROGMEM
= "APPLE";
622 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
623 static const char proto_nubert
[] PROGMEM
= "NUBERT";
624 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
625 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
626 static const char proto_nokia
[] PROGMEM
= "NOKIA";
627 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
628 static const char proto_fdc
[] PROGMEM
= "FDC";
629 static const char proto_rccar
[] PROGMEM
= "RCCAR";
630 static const char proto_jvc
[] PROGMEM
= "JVC";
631 static const char proto_rc6a
[] PROGMEM
= "RC6A";
632 static const char proto_nikon
[] PROGMEM
= "NIKON";
633 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
634 static const char proto_ir60
[] PROGMEM
= "IR60";
635 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
636 static const char proto_netbox
[] PROGMEM
= "NETBOX";
637 static const char proto_nec16
[] PROGMEM
= "NEC16";
638 static const char proto_nec42
[] PROGMEM
= "NEC42";
639 static const char proto_lego
[] PROGMEM
= "LEGO";
640 static const char proto_thomson
[] PROGMEM
= "THOMSON";
641 static const char proto_bose
[] PROGMEM
= "BOSE";
642 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
643 static const char proto_ortek
[] PROGMEM
= "ORTEK";
644 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
645 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
646 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
647 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
648 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
649 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
650 static const char proto_lgair
[] PROGMEM
= "LGAIR";
651 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
652 static const char proto_merlin
[] PROGMEM
= "MERLIN";
653 static const char proto_pentax
[] PROGMEM
= "PENTAX";
654 static const char proto_fan
[] PROGMEM
= "FAN";
655 static const char proto_s100
[] PROGMEM
= "S100";
656 static const char proto_acp24
[] PROGMEM
= "ACP24";
657 static const char proto_technics
[] PROGMEM
= "TECHNICS";
658 static const char proto_panasonic
[] PROGMEM
= "PANASONIC";
659 static const char proto_mitsu_heavy
[] PROGMEM
= "MITSU_HEAVY";
660 static const char proto_vincent
[] PROGMEM
= "VINCENT";
661 static const char proto_samsungah
[] PROGMEM
= "SAMSUNGAH";
663 static const char proto_radio1
[] PROGMEM
= "RADIO1";
666 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
725 /*---------------------------------------------------------------------------------------------------------------------------------------------------
727 *---------------------------------------------------------------------------------------------------------------------------------------------------
729 #if IRMP_LOGGING == 1 // logging via UART
731 #if defined(ARM_STM32F4XX)
732 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
733 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
734 # define STM32_GPIO_PORT GPIOA
735 # define STM32_GPIO_PIN GPIO_Pin_2
736 # define STM32_GPIO_SOURCE GPIO_PinSource2
737 # define STM32_UART_AF GPIO_AF_USART2
738 # define STM32_UART_COM USART2
739 # define STM32_UART_BAUD 115200 // 115200 Baud
740 # include "stm32f4xx_usart.h"
741 #elif defined(ARM_STM32F10X)
742 # define STM32_UART_COM USART3 // UART3 on PB10
743 #elif defined(LIBOPENCM3) //
744 # include <libopencm3/stm32/usart.h>
745 # define STM32_UART_COM USART2 // UART2 on PA2
746 # define STM32_UART_GPIO_PORT GPIOA
747 # define STM32_UART_GPIO_PIN GPIO2
748 # define STM32_UART_COM_RCC RCC_USART2
749 # define STM32_UART_GPIO_RCC RCC_GPIOA
750 # define STM32_UART_BAUD 115200 // 115200 Baud
751 #elif defined(ARDUINO) // Arduino Serial implementation
752 # if defined(USB_SERIAL)
753 # include "usb_serial.h"
755 # error USB_SERIAL not defined in ARDUINO Environment
758 # if IRMP_EXT_LOGGING == 1 // use external logging
759 # include "irmpextlog.h"
760 # else // normal UART log (IRMP_EXT_LOGGING == 0)
762 # ifndef UNIX_OR_WINDOWS
763 # include <util/setbaud.h>
768 #define UART0_UBRRH UBRR0H
769 #define UART0_UBRRL UBRR0L
770 #define UART0_UCSRA UCSR0A
771 #define UART0_UCSRB UCSR0B
772 #define UART0_UCSRC UCSR0C
773 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
774 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
775 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
777 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
779 #define UART0_URSEL_BIT_VALUE (0)
781 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
782 #define UART0_UDR UDR0
783 #define UART0_U2X U2X0
787 #define UART0_UBRRH UBRRH
788 #define UART0_UBRRL UBRRL
789 #define UART0_UCSRA UCSRA
790 #define UART0_UCSRB UCSRB
791 #define UART0_UCSRC UCSRC
792 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
793 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
794 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
796 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
798 #define UART0_URSEL_BIT_VALUE (0)
800 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
801 #define UART0_UDR UDR
802 #define UART0_U2X U2X
805 #endif //IRMP_EXT_LOGGING
806 #endif //ARM_STM32F4XX
808 /*---------------------------------------------------------------------------------------------------------------------------------------------------
810 * @details Initializes UART
811 *---------------------------------------------------------------------------------------------------------------------------------------------------
814 irmp_uart_init (void)
816 #ifndef UNIX_OR_WINDOWS
817 #if defined(ARM_STM32F4XX)
818 GPIO_InitTypeDef GPIO_InitStructure
;
819 USART_InitTypeDef USART_InitStructure
;
821 // Clock enable vom TX Pin
822 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
824 // Clock enable der UART
825 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
827 // UART Alternative-Funktion mit dem IO-Pin verbinden
828 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
830 // UART als Alternative-Funktion mit PushPull
831 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
832 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
833 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
834 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
837 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
838 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
841 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
843 // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
844 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
845 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
846 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
847 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
848 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
849 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
850 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
853 USART_Cmd(STM32_UART_COM
, ENABLE
);
855 #elif defined(ARM_STM32F10X)
856 GPIO_InitTypeDef GPIO_InitStructure
;
857 USART_InitTypeDef USART_InitStructure
;
859 // Clock enable vom TX Pin
860 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
862 // Clock enable der UART
863 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
865 // UART als Alternative-Funktion mit PushPull
866 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
867 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
870 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
871 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
874 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
876 // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
877 USART_InitStructure
.USART_BaudRate
= 115200;
878 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
879 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
880 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
881 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
882 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
883 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
886 USART_Cmd(STM32_UART_COM
, ENABLE
);
888 #elif defined(LIBOPENCM3)
889 rcc_periph_clock_enable(STM32_UART_COM_RCC
);
890 /* Setup GPIO pin for USART TX */
891 rcc_periph_clock_enable(STM32_UART_GPIO_RCC
);
892 gpio_set_mode(STM32_UART_GPIO_PORT
, GPIO_MODE_OUTPUT_2_MHZ
,
893 GPIO_CNF_OUTPUT_ALTFN_PUSHPULL
, STM32_UART_GPIO_PIN
);
895 /* Setup UART parameters. */
896 usart_set_baudrate(STM32_UART_COM
, STM32_UART_BAUD
);
897 usart_set_databits(STM32_UART_COM
, 8);
898 usart_set_stopbits(STM32_UART_COM
, USART_STOPBITS_1
);
899 usart_set_parity(STM32_UART_COM
, USART_PARITY_NONE
);
900 usart_set_flow_control(STM32_UART_COM
, USART_FLOWCONTROL_NONE
);
901 usart_set_mode(STM32_UART_COM
, USART_MODE_TX_RX
);
902 /* Finally enable the USART. */
903 usart_enable(STM32_UART_COM
);
905 #elif defined(ARDUINO)
906 // we use the Arduino Serial Imlementation
907 // you have to call Serial.begin(SER_BAUD); in Arduino setup() function
909 #elif defined (__AVR_XMEGA__)
911 PMIC
.CTRL
|= PMIC_HILVLEN_bm
;
913 USARTC1
.BAUDCTRLB
= 0;
914 USARTC1
.BAUDCTRLA
= F_CPU
/ 153600 - 1;
915 USARTC1
.CTRLA
= USART_RXCINTLVL_HI_gc
; // high INT level (receive)
916 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; // activated RX and TX
917 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; // 8 Bit
918 PORTC
.DIR |= (1<<7); // TXD is output
919 PORTC
.DIR &= ~(1<<6);
923 #if (IRMP_EXT_LOGGING == 0) // use UART
924 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
925 UART0_UBRRL
= UBRRL_VALUE
;
928 UART0_UCSRA
|= (1<<UART0_U2X
);
930 UART0_UCSRA
&= ~(1<<UART0_U2X
);
933 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
934 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
935 #else // other log method
937 #endif //IRMP_EXT_LOGGING
938 #endif //ARM_STM32F4XX
939 #endif // UNIX_OR_WINDOWS
942 /*---------------------------------------------------------------------------------------------------------------------------------------------------
944 * @details Sends character
945 * @param ch character to be transmitted
946 *---------------------------------------------------------------------------------------------------------------------------------------------------
949 irmp_uart_putc (unsigned char ch
)
951 #ifndef UNIX_OR_WINDOWS
952 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
953 // warten bis altes Byte gesendet wurde
954 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
959 USART_SendData(STM32_UART_COM
, ch
);
963 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
964 USART_SendData(STM32_UART_COM
, '\r');
967 #elif defined(LIBOPENCM3)
969 usart_send_blocking(STM32_UART_COM
, '\r');
971 usart_send_blocking(STM32_UART_COM
, ch
);
973 #elif defined(ARDUINO)
974 // we use the Arduino Serial Imlementation
975 usb_serial_putchar(ch
);
978 #if (IRMP_EXT_LOGGING == 0)
980 # if defined (__AVR_XMEGA__)
981 while (!(USARTC1
.STATUS
& USART_DREIF_bm
))
989 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
996 # endif // __AVR_XMEGA__
1000 sendextlog(ch
); // use external log
1002 #endif // IRMP_EXT_LOGGING
1003 #endif // ARM_STM32F4XX
1006 #endif // UNIX_OR_WINDOWS
1009 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1011 *---------------------------------------------------------------------------------------------------------------------------------------------------
1014 #define STARTCYCLES 2 // min count of zeros before start of logging
1015 #define ENDBITS 1000 // number of sequenced highbits to detect end
1016 #define DATALEN 700 // log buffer size
1019 irmp_log (uint_fast8_t val
)
1021 static uint8_t buf
[DATALEN
]; // logging buffer
1022 static uint_fast16_t buf_idx
; // index
1023 static uint_fast8_t startcycles
; // current number of start-zeros
1024 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
1025 static uint_fast8_t last_val
= 1;
1027 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
1035 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
1037 if (last_val
== val
)
1041 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
1042 { // if stop condition is true, output on uart
1046 uint_fast8_t v
= '1';
1049 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
1051 irmp_uart_putc ('0'); // the ignored starting zeros
1054 for (i
= 0; i
< buf_idx
; i
++)
1063 d
|= ((uint_fast16_t) buf
[i
] << 8);
1066 for (j
= 0; j
< d
; j
++)
1071 v
= (v
== '1') ? '0' : '1';
1074 for (i8
= 0; i8
< 20; i8
++)
1076 irmp_uart_putc ('1');
1079 irmp_uart_putc ('\n');
1085 else if (buf_idx
< DATALEN
- 3)
1089 buf
[buf_idx
++] = 0xff;
1090 buf
[buf_idx
++] = (cnt
& 0xff);
1091 buf
[buf_idx
] = (cnt
>> 8);
1107 #define irmp_log(val)
1108 #endif //IRMP_LOGGING
1112 uint_fast8_t protocol
; // ir protocol
1113 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
1114 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
1115 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
1116 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
1117 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
1118 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
1119 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
1120 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
1121 uint_fast8_t address_offset
; // address offset
1122 uint_fast8_t address_end
; // end of address
1123 uint_fast8_t command_offset
; // command offset
1124 uint_fast8_t command_end
; // end of command
1125 uint_fast8_t complete_len
; // complete length of frame
1126 uint_fast8_t stop_bit
; // flag: frame has stop bit
1127 uint_fast8_t lsb_first
; // flag: LSB first
1128 uint_fast8_t flags
; // some flags
1131 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1133 static const PROGMEM IRMP_PARAMETER sircs_param
=
1135 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
1136 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1137 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1138 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1139 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1140 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1141 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1142 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1143 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1144 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
1145 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
1146 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
1147 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
1148 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1149 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
1150 SIRCS_LSB
, // lsb_first: flag: LSB first
1151 SIRCS_FLAGS
// flags: some flags
1156 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1158 static const PROGMEM IRMP_PARAMETER nec_param
=
1160 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1161 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1162 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1163 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1164 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1165 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1166 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1167 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1168 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1169 NEC_ADDRESS_OFFSET
, // address_offset: address offset
1170 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
1171 NEC_COMMAND_OFFSET
, // command_offset: command offset
1172 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
1173 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1174 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1175 NEC_LSB
, // lsb_first: flag: LSB first
1176 NEC_FLAGS
// flags: some flags
1179 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1181 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1182 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1183 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1184 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1185 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1186 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1187 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1188 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1189 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1190 0, // address_offset: address offset
1191 0, // address_end: end of address
1192 0, // command_offset: command offset
1193 0, // command_end: end of command
1194 0, // complete_len: complete length of frame
1195 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1196 NEC_LSB
, // lsb_first: flag: LSB first
1197 NEC_FLAGS
// flags: some flags
1202 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1204 static const PROGMEM IRMP_PARAMETER nec42_param
=
1206 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1207 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1208 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1209 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1210 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1211 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1212 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1213 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1214 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1215 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1216 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1217 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1218 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1219 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1220 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1221 NEC_LSB
, // lsb_first: flag: LSB first
1222 NEC_FLAGS
// flags: some flags
1227 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1229 static const PROGMEM IRMP_PARAMETER lgair_param
=
1231 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1232 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1233 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1234 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1235 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1236 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1237 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1238 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1239 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1240 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1241 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1242 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1243 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1244 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1245 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1246 NEC_LSB
, // lsb_first: flag: LSB first
1247 NEC_FLAGS
// flags: some flags
1252 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1254 static const PROGMEM IRMP_PARAMETER samsung_param
=
1256 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1257 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1258 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1259 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1260 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1261 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1262 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1263 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1264 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1265 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1266 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1267 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1268 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1269 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1270 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1271 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1272 SAMSUNG_FLAGS
// flags: some flags
1277 #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
1279 static const PROGMEM IRMP_PARAMETER samsungah_param
=
1281 IRMP_SAMSUNGAH_PROTOCOL
, // protocol: ir protocol
1282 SAMSUNGAH_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1283 SAMSUNGAH_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1284 SAMSUNGAH_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1285 SAMSUNGAH_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1286 SAMSUNGAH_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1287 SAMSUNGAH_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1288 SAMSUNGAH_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1289 SAMSUNGAH_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1290 SAMSUNGAH_ADDRESS_OFFSET
, // address_offset: address offset
1291 SAMSUNGAH_ADDRESS_OFFSET
+ SAMSUNGAH_ADDRESS_LEN
, // address_end: end of address
1292 SAMSUNGAH_COMMAND_OFFSET
, // command_offset: command offset
1293 SAMSUNGAH_COMMAND_OFFSET
+ SAMSUNGAH_COMMAND_LEN
, // command_end: end of command
1294 SAMSUNGAH_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1295 SAMSUNGAH_STOP_BIT
, // stop_bit: flag: frame has stop bit
1296 SAMSUNGAH_LSB
, // lsb_first: flag: LSB first
1297 SAMSUNGAH_FLAGS
// flags: some flags
1302 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1304 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1306 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1307 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1308 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1309 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1310 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1311 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1312 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1313 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1314 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1315 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1316 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1317 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1318 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1319 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1320 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1321 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1322 TELEFUNKEN_FLAGS
// flags: some flags
1327 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1329 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1331 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1332 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1333 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1334 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1335 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1336 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1337 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1338 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1339 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1340 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1341 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1342 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1343 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1344 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1345 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1346 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1347 MATSUSHITA_FLAGS
// flags: some flags
1352 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1354 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1356 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1357 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1358 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1359 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1360 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1361 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1362 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1363 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1364 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1365 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1366 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1367 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1368 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1369 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1370 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1371 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1372 KASEIKYO_FLAGS
// flags: some flags
1377 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
1379 static const PROGMEM IRMP_PARAMETER panasonic_param
=
1381 IRMP_PANASONIC_PROTOCOL
, // protocol: ir protocol
1382 PANASONIC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1383 PANASONIC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1384 PANASONIC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1385 PANASONIC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1386 PANASONIC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1387 PANASONIC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1388 PANASONIC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1389 PANASONIC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1390 PANASONIC_ADDRESS_OFFSET
, // address_offset: address offset
1391 PANASONIC_ADDRESS_OFFSET
+ PANASONIC_ADDRESS_LEN
, // address_end: end of address
1392 PANASONIC_COMMAND_OFFSET
, // command_offset: command offset
1393 PANASONIC_COMMAND_OFFSET
+ PANASONIC_COMMAND_LEN
, // command_end: end of command
1394 PANASONIC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1395 PANASONIC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1396 PANASONIC_LSB
, // lsb_first: flag: LSB first
1397 PANASONIC_FLAGS
// flags: some flags
1402 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
1404 static const PROGMEM IRMP_PARAMETER mitsu_heavy_param
=
1406 IRMP_MITSU_HEAVY_PROTOCOL
, // protocol: ir protocol
1407 MITSU_HEAVY_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1408 MITSU_HEAVY_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1409 MITSU_HEAVY_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1410 MITSU_HEAVY_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1411 MITSU_HEAVY_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1412 MITSU_HEAVY_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1413 MITSU_HEAVY_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1414 MITSU_HEAVY_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1415 MITSU_HEAVY_ADDRESS_OFFSET
, // address_offset: address offset
1416 MITSU_HEAVY_ADDRESS_OFFSET
+ MITSU_HEAVY_ADDRESS_LEN
, // address_end: end of address
1417 MITSU_HEAVY_COMMAND_OFFSET
, // command_offset: command offset
1418 MITSU_HEAVY_COMMAND_OFFSET
+ MITSU_HEAVY_COMMAND_LEN
, // command_end: end of command
1419 MITSU_HEAVY_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1420 MITSU_HEAVY_STOP_BIT
, // stop_bit: flag: frame has stop bit
1421 MITSU_HEAVY_LSB
, // lsb_first: flag: LSB first
1422 MITSU_HEAVY_FLAGS
// flags: some flags
1427 #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1
1429 static const PROGMEM IRMP_PARAMETER vincent_param
=
1431 IRMP_VINCENT_PROTOCOL
, // protocol: ir protocol
1432 VINCENT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1433 VINCENT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1434 VINCENT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1435 VINCENT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1436 VINCENT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1437 VINCENT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1438 VINCENT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1439 VINCENT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1440 VINCENT_ADDRESS_OFFSET
, // address_offset: address offset
1441 VINCENT_ADDRESS_OFFSET
+ VINCENT_ADDRESS_LEN
, // address_end: end of address
1442 VINCENT_COMMAND_OFFSET
, // command_offset: command offset
1443 VINCENT_COMMAND_OFFSET
+ VINCENT_COMMAND_LEN
, // command_end: end of command
1444 VINCENT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1445 VINCENT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1446 VINCENT_LSB
, // lsb_first: flag: LSB first
1447 VINCENT_FLAGS
// flags: some flags
1452 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1454 static const PROGMEM IRMP_PARAMETER recs80_param
=
1456 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1457 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1458 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1459 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1460 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1461 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1462 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1463 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1464 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1465 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1466 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1467 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1468 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1469 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1470 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1471 RECS80_LSB
, // lsb_first: flag: LSB first
1472 RECS80_FLAGS
// flags: some flags
1477 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1479 static const PROGMEM IRMP_PARAMETER rc5_param
=
1481 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1482 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1483 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1484 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1485 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1486 0, // pulse_0_len_min: here: not used
1487 0, // pulse_0_len_max: here: not used
1488 0, // pause_0_len_min: here: not used
1489 0, // pause_0_len_max: here: not used
1490 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1491 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1492 RC5_COMMAND_OFFSET
, // command_offset: command offset
1493 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1494 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1495 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1496 RC5_LSB
, // lsb_first: flag: LSB first
1497 RC5_FLAGS
// flags: some flags
1502 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1504 static const PROGMEM IRMP_PARAMETER s100_param
=
1506 IRMP_S100_PROTOCOL
, // protocol: ir protocol
1507 S100_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1508 S100_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1509 S100_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1510 S100_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1511 0, // pulse_0_len_min: here: not used
1512 0, // pulse_0_len_max: here: not used
1513 0, // pause_0_len_min: here: not used
1514 0, // pause_0_len_max: here: not used
1515 S100_ADDRESS_OFFSET
, // address_offset: address offset
1516 S100_ADDRESS_OFFSET
+ S100_ADDRESS_LEN
, // address_end: end of address
1517 S100_COMMAND_OFFSET
, // command_offset: command offset
1518 S100_COMMAND_OFFSET
+ S100_COMMAND_LEN
, // command_end: end of command
1519 S100_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1520 S100_STOP_BIT
, // stop_bit: flag: frame has stop bit
1521 S100_LSB
, // lsb_first: flag: LSB first
1522 S100_FLAGS
// flags: some flags
1527 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1529 static const PROGMEM IRMP_PARAMETER denon_param
=
1531 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1532 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1533 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1534 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1535 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1536 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1537 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1538 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1539 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1540 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1541 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1542 DENON_COMMAND_OFFSET
, // command_offset: command offset
1543 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1544 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1545 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1546 DENON_LSB
, // lsb_first: flag: LSB first
1547 DENON_FLAGS
// flags: some flags
1552 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1554 static const PROGMEM IRMP_PARAMETER rc6_param
=
1556 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1558 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1559 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1560 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1561 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1562 0, // pulse_0_len_min: here: not used
1563 0, // pulse_0_len_max: here: not used
1564 0, // pause_0_len_min: here: not used
1565 0, // pause_0_len_max: here: not used
1566 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1567 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1568 RC6_COMMAND_OFFSET
, // command_offset: command offset
1569 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1570 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1571 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1572 RC6_LSB
, // lsb_first: flag: LSB first
1573 RC6_FLAGS
// flags: some flags
1578 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1580 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1582 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1583 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1584 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1585 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1586 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1587 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1588 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1589 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1590 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1591 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1592 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1593 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1594 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1595 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1596 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1597 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1598 RECS80EXT_FLAGS
// flags: some flags
1603 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1605 static const PROGMEM IRMP_PARAMETER nubert_param
=
1607 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1608 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1609 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1610 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1611 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1612 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1613 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1614 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1615 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1616 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1617 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1618 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1619 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1620 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1621 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1622 NUBERT_LSB
, // lsb_first: flag: LSB first
1623 NUBERT_FLAGS
// flags: some flags
1628 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1630 static const PROGMEM IRMP_PARAMETER fan_param
=
1632 IRMP_FAN_PROTOCOL
, // protocol: ir protocol
1633 FAN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1634 FAN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1635 FAN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1636 FAN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1637 FAN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1638 FAN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1639 FAN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1640 FAN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1641 FAN_ADDRESS_OFFSET
, // address_offset: address offset
1642 FAN_ADDRESS_OFFSET
+ FAN_ADDRESS_LEN
, // address_end: end of address
1643 FAN_COMMAND_OFFSET
, // command_offset: command offset
1644 FAN_COMMAND_OFFSET
+ FAN_COMMAND_LEN
, // command_end: end of command
1645 FAN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1646 FAN_STOP_BIT
, // stop_bit: flag: frame has NO stop bit
1647 FAN_LSB
, // lsb_first: flag: LSB first
1648 FAN_FLAGS
// flags: some flags
1653 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1655 static const PROGMEM IRMP_PARAMETER speaker_param
=
1657 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1658 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1659 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1660 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1661 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1662 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1663 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1664 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1665 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1666 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1667 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1668 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1669 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1670 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1671 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1672 SPEAKER_LSB
, // lsb_first: flag: LSB first
1673 SPEAKER_FLAGS
// flags: some flags
1678 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1680 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1682 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1683 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1684 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1685 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1686 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1687 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1688 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1689 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1690 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1691 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1692 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1693 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1694 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1695 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1696 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1697 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1698 BANG_OLUFSEN_FLAGS
// flags: some flags
1703 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1705 static uint_fast8_t first_bit
;
1707 static const PROGMEM IRMP_PARAMETER grundig_param
=
1709 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1711 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1712 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1713 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1714 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1715 0, // pulse_0_len_min: here: not used
1716 0, // pulse_0_len_max: here: not used
1717 0, // pause_0_len_min: here: not used
1718 0, // pause_0_len_max: here: not used
1719 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1720 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1721 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1722 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1723 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1724 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1725 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1726 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1731 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1733 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1735 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1736 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1737 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1738 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1739 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1740 0, // pulse_0_len_min: here: not used
1741 0, // pulse_0_len_max: here: not used
1742 0, // pause_0_len_min: here: not used
1743 0, // pause_0_len_max: here: not used
1744 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1745 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1746 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1747 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1748 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1749 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1750 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1751 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1756 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1758 static const PROGMEM IRMP_PARAMETER fdc_param
=
1760 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1761 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1762 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1763 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1764 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1765 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1766 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1767 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1768 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1769 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1770 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1771 FDC_COMMAND_OFFSET
, // command_offset: command offset
1772 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1773 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1774 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1775 FDC_LSB
, // lsb_first: flag: LSB first
1776 FDC_FLAGS
// flags: some flags
1781 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1783 static const PROGMEM IRMP_PARAMETER rccar_param
=
1785 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1786 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1787 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1788 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1789 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1790 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1791 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1792 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1793 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1794 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1795 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1796 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1797 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1798 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1799 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1800 RCCAR_LSB
, // lsb_first: flag: LSB first
1801 RCCAR_FLAGS
// flags: some flags
1806 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1808 static const PROGMEM IRMP_PARAMETER nikon_param
=
1810 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1811 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1812 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1813 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1814 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1815 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1816 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1817 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1818 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1819 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1820 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1821 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1822 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1823 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1824 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1825 NIKON_LSB
, // lsb_first: flag: LSB first
1826 NIKON_FLAGS
// flags: some flags
1831 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1833 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1835 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1836 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1837 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1838 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1839 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1840 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1841 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1842 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1843 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1844 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1845 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1846 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1847 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1848 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1849 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1850 KATHREIN_LSB
, // lsb_first: flag: LSB first
1851 KATHREIN_FLAGS
// flags: some flags
1856 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1858 static const PROGMEM IRMP_PARAMETER netbox_param
=
1860 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1861 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1862 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1863 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1864 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1865 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1866 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1867 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1868 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1869 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1870 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1871 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1872 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1873 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1874 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1875 NETBOX_LSB
, // lsb_first: flag: LSB first
1876 NETBOX_FLAGS
// flags: some flags
1881 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1883 static const PROGMEM IRMP_PARAMETER lego_param
=
1885 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1886 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1887 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1888 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1889 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1890 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1891 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1892 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1893 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1894 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1895 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1896 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1897 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1898 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1899 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1900 LEGO_LSB
, // lsb_first: flag: LSB first
1901 LEGO_FLAGS
// flags: some flags
1906 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1908 static const PROGMEM IRMP_PARAMETER thomson_param
=
1910 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1911 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1912 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1913 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1914 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1915 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1916 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1917 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1918 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1919 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1920 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1921 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1922 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1923 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1924 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1925 THOMSON_LSB
, // lsb_first: flag: LSB first
1926 THOMSON_FLAGS
// flags: some flags
1931 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1933 static const PROGMEM IRMP_PARAMETER bose_param
=
1935 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1936 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1937 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1938 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1939 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1940 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1941 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1942 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1943 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1944 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1945 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1946 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1947 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1948 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1949 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1950 BOSE_LSB
, // lsb_first: flag: LSB first
1951 BOSE_FLAGS
// flags: some flags
1956 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1958 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1960 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1962 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1963 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1964 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1965 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1966 0, // pulse_0_len_min: here: not used
1967 0, // pulse_0_len_max: here: not used
1968 0, // pause_0_len_min: here: not used
1969 0, // pause_0_len_max: here: not used
1970 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1971 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1972 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1973 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1974 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1975 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1976 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1977 A1TVBOX_FLAGS
// flags: some flags
1982 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
1984 static const PROGMEM IRMP_PARAMETER merlin_param
=
1986 IRMP_MERLIN_PROTOCOL
, // protocol: ir protocol
1988 MERLIN_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1989 MERLIN_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1990 MERLIN_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1991 MERLIN_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1992 0, // pulse_0_len_min: here: not used
1993 0, // pulse_0_len_max: here: not used
1994 0, // pause_0_len_min: here: not used
1995 0, // pause_0_len_max: here: not used
1996 MERLIN_ADDRESS_OFFSET
, // address_offset: address offset
1997 MERLIN_ADDRESS_OFFSET
+ MERLIN_ADDRESS_LEN
, // address_end: end of address
1998 MERLIN_COMMAND_OFFSET
, // command_offset: command offset
1999 MERLIN_COMMAND_OFFSET
+ MERLIN_COMMAND_LEN
, // command_end: end of command
2000 MERLIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2001 MERLIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
2002 MERLIN_LSB
, // lsb_first: flag: LSB first
2003 MERLIN_FLAGS
// flags: some flags
2008 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2010 static const PROGMEM IRMP_PARAMETER ortek_param
=
2012 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
2014 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
2015 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
2016 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
2017 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
2018 0, // pulse_0_len_min: here: not used
2019 0, // pulse_0_len_max: here: not used
2020 0, // pause_0_len_min: here: not used
2021 0, // pause_0_len_max: here: not used
2022 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
2023 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
2024 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
2025 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
2026 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2027 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
2028 ORTEK_LSB
, // lsb_first: flag: LSB first
2029 ORTEK_FLAGS
// flags: some flags
2034 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2036 static const PROGMEM IRMP_PARAMETER roomba_param
=
2038 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
2039 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2040 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2041 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2042 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2043 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2044 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2045 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2046 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2047 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
2048 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
2049 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
2050 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
2051 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2052 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
2053 ROOMBA_LSB
, // lsb_first: flag: LSB first
2054 ROOMBA_FLAGS
// flags: some flags
2059 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
2061 static const PROGMEM IRMP_PARAMETER rcmm_param
=
2063 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
2065 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
2066 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
2067 0, // pause_1_len_min: here: minimum length of short pause
2068 0, // pause_1_len_max: here: maximum length of short pause
2069 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
2070 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
2071 0, // pause_0_len_min: here: not used
2072 0, // pause_0_len_max: here: not used
2073 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
2074 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
2075 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
2076 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
2077 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2078 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
2079 RCMM32_LSB
, // lsb_first: flag: LSB first
2080 RCMM32_FLAGS
// flags: some flags
2085 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2087 static const PROGMEM IRMP_PARAMETER pentax_param
=
2089 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
2090 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2091 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2092 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2093 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2094 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2095 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2096 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2097 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2098 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
2099 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
2100 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
2101 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
2102 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2103 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
2104 PENTAX_LSB
, // lsb_first: flag: LSB first
2105 PENTAX_FLAGS
// flags: some flags
2110 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2112 static const PROGMEM IRMP_PARAMETER acp24_param
=
2114 IRMP_ACP24_PROTOCOL
, // protocol: ir protocol
2115 ACP24_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2116 ACP24_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2117 ACP24_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2118 ACP24_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2119 ACP24_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2120 ACP24_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2121 ACP24_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2122 ACP24_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2123 ACP24_ADDRESS_OFFSET
, // address_offset: address offset
2124 ACP24_ADDRESS_OFFSET
+ ACP24_ADDRESS_LEN
, // address_end: end of address
2125 ACP24_COMMAND_OFFSET
, // command_offset: command offset
2126 ACP24_COMMAND_OFFSET
+ ACP24_COMMAND_LEN
, // command_end: end of command
2127 ACP24_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2128 ACP24_STOP_BIT
, // stop_bit: flag: frame has stop bit
2129 ACP24_LSB
, // lsb_first: flag: LSB first
2130 ACP24_FLAGS
// flags: some flags
2135 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2137 static const PROGMEM IRMP_PARAMETER radio1_param
=
2139 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
2141 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2142 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2143 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2144 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2145 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2146 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2147 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2148 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2149 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
2150 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
2151 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
2152 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
2153 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2154 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
2155 RADIO1_LSB
, // lsb_first: flag: LSB first
2156 RADIO1_FLAGS
// flags: some flags
2161 static uint_fast8_t irmp_bit
; // current bit position
2162 static IRMP_PARAMETER irmp_param
;
2164 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2165 static IRMP_PARAMETER irmp_param2
;
2168 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
2169 static volatile uint_fast8_t irmp_protocol
;
2170 static volatile uint_fast16_t irmp_address
;
2171 static volatile uint_fast16_t irmp_command
;
2172 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
2173 static volatile uint_fast8_t irmp_flags
;
2174 // static volatile uint_fast8_t irmp_busy_flag;
2176 #if defined(__MBED__)
2177 // DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp
2178 gpio_t gpioIRin
; // use low level c function instead
2183 #define input(x) (x)
2184 static uint_fast8_t IRMP_PIN
;
2185 static uint_fast8_t radio
;
2188 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2189 * Initialize IRMP decoder
2190 * @details Configures IRMP input pin
2191 *---------------------------------------------------------------------------------------------------------------------------------------------------
2197 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
2198 #elif defined (ARM_STM32) // STM32
2199 GPIO_InitTypeDef GPIO_InitStructure
;
2201 /* GPIOx clock enable */
2202 # if defined (ARM_STM32L1XX)
2203 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2204 # elif defined (ARM_STM32F10X)
2205 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2206 # elif defined (ARM_STM32F4XX)
2207 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2210 /* GPIO Configuration */
2211 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
2212 # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
2213 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
2214 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2215 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
2216 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
2217 # elif defined (ARM_STM32F10X)
2218 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2219 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
2221 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
2223 #elif defined (LIBOPENCM3) // STM32 with libopencm3
2225 /* GPIOx clock enable */
2226 rcc_periph_clock_enable(IRMP_PORT_RCC
);
2227 /* GPIO Configuration */
2228 gpio_set_mode(IRMP_PORT
, GPIO_MODE_INPUT
, GPIO_CNF_INPUT_FLOAT
, IRMP_BIT
);
2230 #elif defined(STELLARIS_ARM_CORTEX_M4)
2231 // Enable the GPIO port
2232 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
2235 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
2236 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_STRENGTH_2MA
, GPIO_PIN_TYPE_STD_WPU
);
2238 #elif defined(__SDCC_stm8) // STM8
2239 IRMP_GPIO_STRUCT
->DDR
&= ~(1<<IRMP_BIT
); // pin is input
2240 IRMP_GPIO_STRUCT
->CR1
|= (1<<IRMP_BIT
); // activate pullup
2242 #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
2243 pinMode(IRMP_PIN
, INPUT
);
2245 #elif defined(__xtensa__) // ESP8266
2246 pinMode(IRMP_BIT_NUMBER
, INPUT
);
2247 // select pin function
2248 # if (IRMP_BIT_NUMBER == 12)
2249 PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U
, FUNC_GPIO12
);
2250 // doesn't work for me:
2251 // # elif (IRMP_BIT_NUMBER == 13)
2252 // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);
2254 # warning Please add PIN_FUNC_SELECT when necessary.
2256 GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER
);
2258 #elif defined(__MBED__)
2259 gpio_init_in_ex(&gpioIRin
, IRMP_PIN
, IRMP_PINMODE
); // initialize input for IR diode
2262 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
2263 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
2266 #if IRMP_LOGGING == 1
2271 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2273 * @details gets decoded IRMP data
2274 * @param pointer in order to store IRMP data
2275 * @return TRUE: successful, FALSE: failed
2276 *---------------------------------------------------------------------------------------------------------------------------------------------------
2279 irmp_get_data (IRMP_DATA
* irmp_data_p
)
2281 uint_fast8_t rtc
= FALSE
;
2283 if (irmp_ir_detected
)
2285 switch (irmp_protocol
)
2287 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2288 case IRMP_SAMSUNG_PROTOCOL
:
2289 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2291 irmp_command
&= 0xff;
2292 irmp_command
|= irmp_id
<< 8;
2297 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2298 case IRMP_SAMSUNG48_PROTOCOL
:
2299 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2305 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2306 case IRMP_NEC_PROTOCOL
:
2307 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2309 irmp_command
&= 0xff;
2312 else if (irmp_address
== 0x87EE)
2315 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2317 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2318 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2319 irmp_command
&= 0x00FF;
2326 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2327 case IRMP_VINCENT_PROTOCOL
:
2328 if ((irmp_command
>> 8) == (irmp_command
& 0x00FF))
2330 irmp_command
&= 0xff;
2336 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2337 case IRMP_BOSE_PROTOCOL
:
2338 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2340 irmp_command
&= 0xff;
2345 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2346 case IRMP_SIEMENS_PROTOCOL
:
2347 case IRMP_RUWIDO_PROTOCOL
:
2348 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2355 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2356 case IRMP_KATHREIN_PROTOCOL
:
2357 if (irmp_command
!= 0x0000)
2363 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2364 case IRMP_RC5_PROTOCOL
:
2365 irmp_address
&= ~0x20; // clear toggle bit
2369 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2370 case IRMP_S100_PROTOCOL
:
2371 irmp_address
&= ~0x20; // clear toggle bit
2375 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2376 case IRMP_IR60_PROTOCOL
:
2377 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2384 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2389 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2390 case IRMP_RCCAR_PROTOCOL
:
2391 // frame in irmp_data:
2392 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2393 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2394 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2395 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2396 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2397 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2398 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2402 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2403 case IRMP_NETBOX_PROTOCOL
:
2404 if (irmp_command
& 0x1000) // last bit set?
2406 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2409 irmp_command
&= 0x7F;
2412 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2415 irmp_command
|= 0x80;
2421 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2428 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2433 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2434 case IRMP_LEGO_PROTOCOL
:
2436 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2438 if ((irmp_command
& 0x000F) == crc
)
2446 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2448 // rtc = TRUE; // don't accept codes with CRC errors
2463 irmp_data_p
->protocol
= irmp_protocol
;
2464 irmp_data_p
->address
= irmp_address
;
2465 irmp_data_p
->command
= irmp_command
;
2466 irmp_data_p
->flags
= irmp_flags
;
2472 irmp_ir_detected
= FALSE
;
2478 #if IRMP_USE_CALLBACK == 1
2480 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2482 irmp_callback_ptr
= cb
;
2484 #endif // IRMP_USE_CALLBACK == 1
2486 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2487 static uint_fast16_t irmp_tmp_address
; // ir address
2488 static uint_fast16_t irmp_tmp_command
; // ir command
2490 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2491 static uint_fast16_t irmp_tmp_address2
; // ir address
2492 static uint_fast16_t irmp_tmp_command2
; // ir command
2495 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2496 static uint_fast16_t irmp_lgair_address
; // ir address
2497 static uint_fast16_t irmp_lgair_command
; // ir command
2500 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2501 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2503 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2504 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2505 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2508 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2509 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2512 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2513 static uint_fast8_t check
; // number of '1' of the first 14 bits, check if even.
2514 static uint_fast8_t mitsu_parity
; // number of '1' of the first 14 bits, check if even.
2517 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2519 * @details store bit in temp address or temp command
2520 * @param value to store: 0 or 1
2521 *---------------------------------------------------------------------------------------------------------------------------------------------------
2523 // verhindert, dass irmp_store_bit() inline compiliert wird:
2524 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2527 irmp_store_bit (uint_fast8_t value
)
2529 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2530 if (irmp_param
.protocol
== IRMP_ACP24_PROTOCOL
) // squeeze 64 bits into 16 bits:
2536 // 0123456789012345678901234567890123456789012345678901234567890123456789
2537 // N VVMMM ? ??? t vmA x y TTTT
2539 // irmp_data_p->command:
2546 case 0: irmp_tmp_command
|= (1<<15); break; // N
2547 case 2: irmp_tmp_command
|= (1<<13); break; // V
2548 case 3: irmp_tmp_command
|= (1<<12); break; // V
2549 case 4: irmp_tmp_command
|= (1<<10); break; // M
2550 case 5: irmp_tmp_command
|= (1<< 9); break; // M
2551 case 6: irmp_tmp_command
|= (1<< 8); break; // M
2552 case 20: irmp_tmp_command
|= (1<< 6); break; // t
2553 case 22: irmp_tmp_command
|= (1<<11); break; // v
2554 case 23: irmp_tmp_command
|= (1<< 7); break; // m
2555 case 24: irmp_tmp_command
|= (1<<14); break; // A
2556 case 26: irmp_tmp_command
|= (1<< 5); break; // x
2557 case 44: irmp_tmp_command
|= (1<< 4); break; // y
2558 case 66: irmp_tmp_command
|= (1<< 3); break; // T
2559 case 67: irmp_tmp_command
|= (1<< 2); break; // T
2560 case 68: irmp_tmp_command
|= (1<< 1); break; // T
2561 case 69: irmp_tmp_command
|= (1<< 0); break; // T
2566 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2568 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2569 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2578 else if (irmp_bit
== 14)
2580 if (value
) // value == 1: even parity
2584 parity
= PARITY_CHECK_FAILED
;
2588 parity
= PARITY_CHECK_OK
;
2593 if (parity
& 0x01) // value == 0: odd parity
2595 parity
= PARITY_CHECK_OK
;
2599 parity
= PARITY_CHECK_FAILED
;
2610 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2611 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2618 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2620 if (irmp_param
.lsb_first
)
2622 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2626 irmp_tmp_address
<<= 1;
2627 irmp_tmp_address
|= value
;
2630 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2632 if (irmp_param
.lsb_first
)
2634 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2635 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2637 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2642 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2647 irmp_tmp_command
<<= 1;
2648 irmp_tmp_command
|= value
;
2652 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2653 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2657 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2658 irmp_lgair_address
|= value
;
2660 else if (irmp_bit
< 24)
2662 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2663 irmp_lgair_command
|= value
;
2669 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2670 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2672 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2677 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2678 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2680 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2685 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2686 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2688 if (irmp_bit
>= 20 && irmp_bit
< 24)
2690 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2692 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2694 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2697 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2701 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2705 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2712 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2713 if (irmp_param
.protocol
== IRMP_MITSU_HEAVY_PROTOCOL
) // squeeze 64 bits into 16 bits:
2715 if (irmp_bit
== 72 )
2716 { // irmp_tmp_address, irmp_tmp_command received: check parity & compress
2717 mitsu_parity
= PARITY_CHECK_OK
;
2719 check
= irmp_tmp_address
>> 8; // inverted upper byte == lower byte?
2722 if (check
== (irmp_tmp_address
& 0xFF))
2724 irmp_tmp_address
<<= 8; // throw away upper byte
2728 mitsu_parity
= PARITY_CHECK_FAILED
;
2731 check
= irmp_tmp_command
>> 8; // inverted upper byte == lower byte?
2733 if (check
== (irmp_tmp_command
& 0xFF))
2734 { // ok: pack together
2735 irmp_tmp_address
|= irmp_tmp_command
& 0xFF; // byte 1, byte2 in irmp_tmp_address, irmp_tmp_command can be used for byte 3
2739 mitsu_parity
= PARITY_CHECK_FAILED
;
2741 irmp_tmp_command
= 0;
2744 if (irmp_bit
>= 72 )
2745 { // receive 3. word in irmp_tmp_command
2746 irmp_tmp_command
<<= 1;
2747 irmp_tmp_command
|= value
;
2751 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
2759 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2761 * @details store bit in temp address or temp command
2762 * @param value to store: 0 or 1
2763 *---------------------------------------------------------------------------------------------------------------------------------------------------
2765 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2767 irmp_store_bit2 (uint_fast8_t value
)
2769 uint_fast8_t irmp_bit2
;
2771 if (irmp_param
.protocol
)
2773 irmp_bit2
= irmp_bit
- 2;
2777 irmp_bit2
= irmp_bit
- 1;
2780 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2782 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2784 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2786 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2789 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2791 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2793 * @details ISR routine, called 10000 times per second
2794 *---------------------------------------------------------------------------------------------------------------------------------------------------
2799 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2800 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2801 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2802 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2803 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2804 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2805 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2806 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2807 static uint_fast8_t repetition_frame_number
;
2808 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2809 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2810 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2812 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2813 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2815 #if IRMP_SUPPORT_MANCHESTER == 1
2816 static PAUSE_LEN last_pause
; // last pause value
2818 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2819 static uint_fast8_t last_value
; // last bit value
2821 uint_fast8_t irmp_input
; // input value
2827 #if defined(__SDCC_stm8)
2828 irmp_input
= input(IRMP_GPIO_STRUCT
->IDR
)
2829 #elif defined(__MBED__)
2830 //irmp_input = inputPin;
2831 irmp_input
= gpio_read (&gpioIRin
);
2833 irmp_input
= input(IRMP_PIN
);
2836 #if IRMP_USE_CALLBACK == 1
2837 if (irmp_callback_ptr
)
2839 static uint_fast8_t last_inverted_input
;
2841 if (last_inverted_input
!= !irmp_input
)
2843 (*irmp_callback_ptr
) (! irmp_input
);
2844 last_inverted_input
= !irmp_input
;
2847 #endif // IRMP_USE_CALLBACK == 1
2849 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2851 if (! irmp_ir_detected
) // ir code already detected?
2853 if (! irmp_start_bit_detected
) // start bit detected?
2855 if (! irmp_input
) // receiving burst?
2857 // irmp_busy_flag = TRUE;
2859 if (! irmp_pulse_time
)
2861 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2864 irmp_pulse_time
++; // increment counter
2868 if (irmp_pulse_time
) // it's dark....
2869 { // set flags for counting the time of darkness...
2870 irmp_start_bit_detected
= 1;
2871 wait_for_start_space
= 1;
2873 irmp_tmp_command
= 0;
2874 irmp_tmp_address
= 0;
2875 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2878 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2882 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2883 irmp_tmp_command2
= 0;
2884 irmp_tmp_address2
= 0;
2886 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2887 irmp_lgair_command
= 0;
2888 irmp_lgair_address
= 0;
2891 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2892 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2893 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2898 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2900 key_repetition_len
++;
2902 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2903 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2905 denon_repetition_len
++;
2907 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2910 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2911 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2913 last_irmp_denon_command
= 0;
2914 denon_repetition_len
= 0xFFFF;
2917 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2924 if (wait_for_start_space
) // we have received start bit...
2925 { // ...and are counting the time of darkness
2926 if (irmp_input
) // still dark?
2928 irmp_pause_time
++; // increment counter
2930 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2931 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
) ||
2932 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2934 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2937 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2938 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2943 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2946 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
);
2947 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2951 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2952 irmp_pulse_time
= 0;
2953 irmp_pause_time
= 0;
2957 { // receiving first data pulse!
2958 IRMP_PARAMETER
* irmp_param_p
;
2959 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2961 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2962 irmp_param2
.protocol
= 0;
2966 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2969 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2970 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2971 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2974 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2975 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2976 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2978 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2981 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2983 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2984 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2985 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2986 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2989 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2990 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2991 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2993 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2996 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2998 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2999 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
3000 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
3002 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3004 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3005 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3006 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
3008 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
3011 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3012 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3013 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
3015 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
3018 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
3019 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
3021 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3022 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
3023 { // some jvc remote controls use nec repetition frame for jvc repetition frame
3025 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3026 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3027 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
3029 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
3032 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3035 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3036 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3037 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
3040 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
3045 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3046 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
3047 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
3048 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
3049 { // it's JVC repetition type 3
3051 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3052 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3053 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
3055 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
3058 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3060 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3062 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
3063 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
3064 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
3067 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3068 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
3069 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
3071 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
3074 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
3076 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3077 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
3078 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
3081 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3082 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
3083 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
3085 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
3088 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3090 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
3091 if (irmp_pulse_time
>= ACP24_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ACP24_START_BIT_PULSE_LEN_MAX
&&
3092 irmp_pause_time
>= ACP24_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ACP24_START_BIT_PAUSE_LEN_MAX
)
3095 ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3096 ACP24_START_BIT_PULSE_LEN_MIN
, ACP24_START_BIT_PULSE_LEN_MAX
,
3097 ACP24_START_BIT_PAUSE_LEN_MIN
, ACP24_START_BIT_PAUSE_LEN_MAX
);
3099 irmp_param_p
= (IRMP_PARAMETER
*) &acp24_param
;
3102 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3104 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
3105 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
3106 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
3109 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3110 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
3111 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
3113 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
3116 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
3118 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
3119 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
3120 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
3123 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3124 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
3125 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
3127 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
3130 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
3132 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3133 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
3134 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3137 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3138 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
3139 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
3141 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
3144 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3146 #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
3147 if (irmp_pulse_time
>= SAMSUNGAH_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNGAH_START_BIT_PULSE_LEN_MAX
&&
3148 irmp_pause_time
>= SAMSUNGAH_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNGAH_START_BIT_PAUSE_LEN_MAX
)
3151 ANALYZE_PRINTF ("protocol = SAMSUNGAH, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3152 SAMSUNGAH_START_BIT_PULSE_LEN_MIN
, SAMSUNGAH_START_BIT_PULSE_LEN_MAX
,
3153 SAMSUNGAH_START_BIT_PAUSE_LEN_MIN
, SAMSUNGAH_START_BIT_PAUSE_LEN_MAX
);
3155 irmp_param_p
= (IRMP_PARAMETER
*) &samsungah_param
;
3158 #endif // IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
3160 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3161 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
3162 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
3163 { // it's MATSUSHITA
3165 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3166 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
3167 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
3169 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
3172 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3174 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3175 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
3176 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
3179 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3180 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
3181 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
3183 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
3186 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3188 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3189 if (irmp_pulse_time
>= PANASONIC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PANASONIC_START_BIT_PULSE_LEN_MAX
&&
3190 irmp_pause_time
>= PANASONIC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PANASONIC_START_BIT_PAUSE_LEN_MAX
)
3193 ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3194 PANASONIC_START_BIT_PULSE_LEN_MIN
, PANASONIC_START_BIT_PULSE_LEN_MAX
,
3195 PANASONIC_START_BIT_PAUSE_LEN_MIN
, PANASONIC_START_BIT_PAUSE_LEN_MAX
);
3197 irmp_param_p
= (IRMP_PARAMETER
*) &panasonic_param
;
3200 #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3202 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3203 if (irmp_pulse_time
>= MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
&&
3204 irmp_pause_time
>= MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
)
3205 { // it's MITSU_HEAVY
3207 ANALYZE_PRINTF ("protocol = MITSU_HEAVY, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3208 MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
, MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
,
3209 MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
, MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
);
3211 irmp_param_p
= (IRMP_PARAMETER
*) &mitsu_heavy_param
;
3214 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3216 #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1
3217 if (irmp_pulse_time
>= VINCENT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= VINCENT_START_BIT_PULSE_LEN_MAX
&&
3218 irmp_pause_time
>= VINCENT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= VINCENT_START_BIT_PAUSE_LEN_MAX
)
3221 ANALYZE_PRINTF ("protocol = VINCENT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3222 VINCENT_START_BIT_PULSE_LEN_MIN
, VINCENT_START_BIT_PULSE_LEN_MAX
,
3223 VINCENT_START_BIT_PAUSE_LEN_MIN
, VINCENT_START_BIT_PAUSE_LEN_MAX
);
3225 irmp_param_p
= (IRMP_PARAMETER
*) &vincent_param
;
3228 #endif // IRMP_SUPPORT_VINCENT_PROTOCOL == 1
3230 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
3231 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
3232 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
3235 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3236 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
3237 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
3239 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
3242 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
3244 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
3245 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
3246 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
3249 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3250 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
3251 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
3253 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
3256 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
3258 #if IRMP_SUPPORT_S100_PROTOCOL == 1
3259 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
3260 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
3261 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
3262 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
3265 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3266 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3267 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
3268 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3269 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
3272 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
3273 last_pause
= irmp_pause_time
;
3275 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
3276 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
3279 rc5_cmd_bit6
= 1<<6;
3287 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
3289 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3290 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
3291 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
3292 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
3293 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
3295 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3296 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3297 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3300 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
3301 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3302 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3303 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3304 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3305 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3306 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3308 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
3311 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3313 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3314 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3315 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3318 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
3319 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3320 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3321 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3322 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3323 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3324 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3326 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
3329 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3332 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3333 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3334 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
3335 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3336 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
3340 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
3341 last_pause
= irmp_pause_time
;
3343 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
3344 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
3347 rc5_cmd_bit6
= 1<<6;
3355 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
3357 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3358 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
3359 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
3360 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
3363 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3364 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
3365 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
3366 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
3368 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
3371 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3373 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3374 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
3375 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
3376 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
3379 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3380 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3381 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
3382 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
3384 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
3387 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3389 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3390 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
3391 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
3394 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3395 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
3396 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
3398 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
3401 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3403 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3404 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
3405 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
3408 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3409 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
3410 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
3412 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
3417 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3419 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3420 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
3421 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
3424 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3425 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
3426 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
3428 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
3431 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3433 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3434 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
3435 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
3438 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3439 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
3440 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
3442 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
3445 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3447 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3448 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
3449 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
3452 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3453 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
3454 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
3456 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
3459 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3461 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3462 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3463 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3466 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3467 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3468 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3470 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3473 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3475 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3476 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3477 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3478 { // it's BANG_OLUFSEN
3480 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3481 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3482 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3483 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3484 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3485 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3486 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3487 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3488 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3489 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3490 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3491 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3492 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3494 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3498 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3500 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3501 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3502 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3505 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3506 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3507 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3509 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3510 last_pause
= irmp_pause_time
;
3514 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3516 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3517 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3518 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3521 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3522 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3523 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3525 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3530 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3532 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3533 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3534 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3535 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3536 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3537 { // it's RUWIDO or SIEMENS
3539 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3540 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3541 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3542 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3543 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3545 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3546 last_pause
= irmp_pause_time
;
3550 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3552 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3553 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3554 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3557 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3558 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3559 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3561 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3564 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3566 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3567 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3568 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3571 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3572 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3573 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3575 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3578 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3580 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3581 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3582 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3585 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3586 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3587 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3589 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3592 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3594 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3595 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3596 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3599 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3600 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3601 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3603 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3606 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3608 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3609 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3610 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3613 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3614 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3615 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3617 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3620 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3622 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3623 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3624 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3627 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3628 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3629 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3631 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3636 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3638 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3639 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3640 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3641 { // it's ORTEK (Hama)
3643 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3644 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3645 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3647 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3653 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3655 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3656 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3657 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3660 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3661 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3662 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3664 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3667 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3670 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3672 irmp_start_bit_detected
= 0; // wait for another start bit...
3675 if (irmp_start_bit_detected
)
3677 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3679 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3682 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3683 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3689 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3690 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3691 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3692 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3696 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3697 if (irmp_param2
.protocol
)
3700 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3701 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3702 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3703 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3709 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3710 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3713 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3718 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3721 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3722 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3728 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3729 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3730 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3731 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3736 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3737 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3739 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3740 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3744 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3745 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3746 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3747 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3753 #if IRMP_SUPPORT_MANCHESTER == 1
3754 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3755 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3756 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3758 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3761 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3762 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3765 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3767 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3770 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3771 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3774 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3778 #endif // IRMP_SUPPORT_MANCHESTER == 1
3780 #if IRMP_SUPPORT_SERIAL == 1
3781 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3786 #endif // IRMP_SUPPORT_SERIAL == 1
3789 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3790 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3793 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3796 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3797 { // pause timings correct for "1"?
3799 ANALYZE_PUTCHAR ('1'); // yes, store 1
3804 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3805 { // pause timings correct for "0"?
3807 ANALYZE_PUTCHAR ('0'); // yes, store 0
3814 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3815 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3816 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3819 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3822 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3823 { // pause timings correct for "1"?
3825 ANALYZE_PUTCHAR ('1'); // yes, store 1
3830 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3831 { // pause timings correct for "0"?
3833 ANALYZE_PUTCHAR ('0'); // yes, store 0
3840 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3842 ; // else do nothing
3845 irmp_pulse_time
= 1; // set counter to 1, not 0
3846 irmp_pause_time
= 0;
3847 wait_for_start_space
= 0;
3850 else if (wait_for_space
) // the data section....
3851 { // counting the time of darkness....
3852 uint_fast8_t got_light
= FALSE
;
3854 if (irmp_input
) // still dark?
3856 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3859 #if IRMP_SUPPORT_MANCHESTER == 1
3860 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3862 #if IRMP_SUPPORT_SERIAL == 1
3863 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3865 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3868 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3870 ANALYZE_PRINTF ("stop bit detected\n");
3873 irmp_param
.stop_bit
= 0;
3878 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",
3879 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3881 irmp_start_bit_detected
= 0; // wait for another start bit...
3882 irmp_pulse_time
= 0;
3883 irmp_pause_time
= 0;
3888 irmp_pause_time
++; // increment counter
3890 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3891 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3892 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3893 irmp_bit
>= 12 - 1) // pause too long?
3894 { // yes, break and close this frame
3895 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3896 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3897 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3898 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3899 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3903 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3904 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3905 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3906 { // yes, break and close this frame
3907 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3910 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3912 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3914 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3917 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3919 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3924 #if IRMP_SUPPORT_SERIAL == 1
3925 // NETBOX generates no stop bit, here is the timeout condition:
3926 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3927 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3929 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3933 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3934 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3936 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3939 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3941 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3942 irmp_param
.stop_bit
= TRUE
; // set flag
3944 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3945 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3946 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3947 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3948 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3949 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3951 irmp_tmp_command
<<= 1;
3952 irmp_tmp_command
|= first_bit
;
3954 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3955 { // special manchester decoder
3956 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3957 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3958 irmp_param
.stop_bit
= TRUE
; // set flag
3960 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3963 ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit
);
3965 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3966 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3967 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3968 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3969 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3971 if (irmp_tmp_command
& 0x300)
3973 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3974 irmp_tmp_command
&= 0xFF;
3980 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3981 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3983 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3984 { // special manchester decoder
3985 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3986 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3987 irmp_param
.stop_bit
= TRUE
; // set flag
3989 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3992 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3994 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3995 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3996 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3997 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3998 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
4001 // RUWIDO: AAAAAAAAACCCCCCCp
4002 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
4003 irmp_tmp_address
<<= 2;
4004 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
4005 irmp_tmp_command
&= 0x003F;
4006 // irmp_tmp_command <<= 4;
4007 irmp_tmp_command
|= last_value
;
4012 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
4013 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
4014 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
4015 { // break and close this frame
4016 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
4018 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
4020 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
4022 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
4025 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
4029 #if IRMP_SUPPORT_MANCHESTER == 1
4030 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
4031 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
4032 { // special manchester decoder
4033 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
4034 irmp_param
.stop_bit
= TRUE
; // set flag
4037 #endif // IRMP_SUPPORT_MANCHESTER == 1
4038 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
4040 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
4044 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4045 else if ((irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
) && irmp_bit
== 0)
4046 { // it was a non-standard repetition frame
4047 #ifdef ANALYZE // with 4500µs pause instead of 2250µs
4048 ANALYZE_PRINTF ("Detected non-standard repetition frame, switching to NEC repetition\n");
4050 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4052 irmp_param
.stop_bit
= TRUE
; // set flag
4053 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
4054 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4055 irmp_tmp_address
= last_irmp_address
; // address is last address
4056 irmp_tmp_command
= last_irmp_command
; // command is last command
4057 irmp_flags
|= IRMP_FLAG_REPETITION
;
4058 key_repetition_len
= 0;
4063 ANALYZE_PRINTF ("ignoring NEC repetition frame: timeout occured, key_repetition_len = %d > %d\n",
4064 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4066 irmp_ir_detected
= FALSE
;
4069 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
4070 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4071 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
4074 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
4076 irmp_param
.stop_bit
= TRUE
; // set flag
4077 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
4078 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4079 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
4080 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
4081 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
4083 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4084 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4085 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
4088 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
4090 irmp_param
.stop_bit
= TRUE
; // set flag
4091 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
4092 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4093 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
4094 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
4095 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
4097 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4099 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4100 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4101 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
4104 ANALYZE_PRINTF ("Switching to NEC protocol\n");
4106 irmp_param
.stop_bit
= TRUE
; // set flag
4107 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
4108 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4110 // 0123456789ABC0123456789ABC0123456701234567
4111 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
4112 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
4113 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
4114 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
4116 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
4117 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4118 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
4121 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
4123 irmp_param
.stop_bit
= TRUE
; // set flag
4124 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
4125 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4126 irmp_tmp_address
= irmp_lgair_address
;
4127 irmp_tmp_command
= irmp_lgair_command
;
4129 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4130 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4131 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
4134 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
4136 irmp_param
.stop_bit
= TRUE
; // set flag
4137 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
4138 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4140 // 0123456789ABC0123456789ABC0123456701234567
4141 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
4142 // JVC: AAAACCCCCCCCCCCC
4143 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
4144 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
4146 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4147 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4149 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4150 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
4153 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
4155 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4156 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4157 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4158 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4160 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4162 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4163 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
4167 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
4168 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
4171 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
4173 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
4175 else // if ((irmp_bit == 24)
4178 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
4180 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
4182 irmp_param
.stop_bit
= TRUE
; // set flag
4183 irmp_param
.complete_len
= irmp_bit
; // patch length
4185 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
4187 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4188 else if (irmp_param
.protocol
== IRMP_MATSUSHITA_PROTOCOL
&& irmp_bit
== 22) // it was a TECHNICS stop bit
4191 ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit
);
4194 // The first 12 bits have been stored in irmp_tmp_command (LSB first)
4195 // The following 10 bits have been stored in irmp_tmp_address (LSB first)
4196 // The code of TECHNICS is:
4197 // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)
4198 // ccccccccccccaaaaaaaaaa
4199 // where C is inverted value of c
4201 irmp_tmp_address
<<= 1;
4202 if (irmp_tmp_command
& (1<<11))
4204 irmp_tmp_address
|= 1;
4205 irmp_tmp_command
&= ~(1<<11);
4208 if (irmp_tmp_command
== ((~irmp_tmp_address
) & 0x07FF))
4210 irmp_tmp_address
= 0;
4212 irmp_param
.protocol
= IRMP_TECHNICS_PROTOCOL
; // switch protocol
4213 irmp_param
.complete_len
= irmp_bit
; // patch length
4218 ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");
4219 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4221 irmp_start_bit_detected
= 0; // wait for another start bit...
4222 irmp_pulse_time
= 0;
4223 irmp_pause_time
= 0;
4226 #endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4230 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
4231 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4233 irmp_start_bit_detected
= 0; // wait for another start bit...
4234 irmp_pulse_time
= 0;
4235 irmp_pause_time
= 0;
4248 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4251 #if IRMP_SUPPORT_MANCHESTER == 1
4252 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
4255 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
4256 #else // better, but some IR-RCs use asymmetric timings :-/
4257 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
4258 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
4261 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4262 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4265 ANALYZE_PUTCHAR ('T');
4267 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
4282 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4285 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
4287 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
4289 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4290 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4293 ANALYZE_PUTCHAR ('T');
4297 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
4310 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4313 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
4315 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
4316 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4317 if (! irmp_param2
.protocol
)
4324 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
4328 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
4329 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
4331 uint_fast8_t manchester_value
;
4333 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
4335 manchester_value
= last_value
? 0 : 1;
4336 last_value
= manchester_value
;
4340 manchester_value
= last_value
;
4344 ANALYZE_PUTCHAR (manchester_value
+ '0');
4347 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4348 if (! irmp_param2
.protocol
)
4356 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4357 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
4360 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
4362 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
4363 irmp_param
.address_offset
= 5;
4364 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
4365 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
4366 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
4367 irmp_tmp_address
= 0;
4369 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4371 irmp_store_bit (manchester_value
);
4375 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4376 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
4377 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
4378 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
4379 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
4382 ANALYZE_PUTCHAR ('?');
4384 irmp_param
.protocol
= 0; // switch to FDC, see below
4387 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4388 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4389 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
4390 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
4391 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
4392 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
4395 ANALYZE_PUTCHAR ('?');
4397 irmp_param
.protocol
= 0; // switch to RCCAR, see below
4400 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4403 ANALYZE_PUTCHAR ('?');
4405 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4406 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4408 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4409 irmp_pause_time
= 0;
4413 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4414 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
4416 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
4419 ANALYZE_PRINTF (" 1 (FDC)\n");
4421 irmp_store_bit2 (1);
4423 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
4426 ANALYZE_PRINTF (" 0 (FDC)\n");
4428 irmp_store_bit2 (0);
4431 if (! irmp_param
.protocol
)
4434 ANALYZE_PRINTF ("Switching to FDC protocol\n");
4436 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4437 irmp_param2
.protocol
= 0;
4438 irmp_tmp_address
= irmp_tmp_address2
;
4439 irmp_tmp_command
= irmp_tmp_command2
;
4442 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4443 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4444 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
4446 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
4449 ANALYZE_PRINTF (" 1 (RCCAR)\n");
4451 irmp_store_bit2 (1);
4453 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
4456 ANALYZE_PRINTF (" 0 (RCCAR)\n");
4458 irmp_store_bit2 (0);
4461 if (! irmp_param
.protocol
)
4464 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4466 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4467 irmp_param2
.protocol
= 0;
4468 irmp_tmp_address
= irmp_tmp_address2
;
4469 irmp_tmp_command
= irmp_tmp_command2
;
4472 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4474 last_pause
= irmp_pause_time
;
4478 #endif // IRMP_SUPPORT_MANCHESTER == 1
4480 #if IRMP_SUPPORT_SERIAL == 1
4481 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
4483 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
4486 ANALYZE_PUTCHAR ('1');
4490 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
4492 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
4496 irmp_pulse_time
= 0;
4500 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
4503 ANALYZE_PUTCHAR ('0');
4507 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
4509 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
4513 irmp_pause_time
= 0;
4522 #endif // IRMP_SUPPORT_SERIAL == 1
4524 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4525 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
4527 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
4528 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4531 ANALYZE_PRINTF ("SYNC\n");
4536 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4538 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4540 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4542 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4543 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4544 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4545 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4548 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4550 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4551 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4552 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4553 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4555 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4558 ANALYZE_PUTCHAR ('1');
4567 ANALYZE_PUTCHAR ('0');
4575 { // timing incorrect!
4577 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4578 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4580 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4581 irmp_pause_time
= 0;
4585 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4587 #if IRMP_SUPPORT_NEC16_PROTOCOL
4588 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4589 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4590 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4591 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4592 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4593 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4596 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4598 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4599 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4600 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4601 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4602 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4603 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4607 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4609 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4610 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4612 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4614 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4616 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4619 ANALYZE_PRINTF ("3rd start bit\n");
4625 { // timing incorrect!
4627 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
);
4628 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4630 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4631 irmp_pause_time
= 0;
4634 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4636 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4639 ANALYZE_PRINTF ("trailer bit\n");
4645 { // timing incorrect!
4647 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
);
4648 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4650 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4651 irmp_pause_time
= 0;
4656 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4657 { // pulse & pause timings correct for "1"?
4659 ANALYZE_PUTCHAR ('1');
4666 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4667 { // pulse & pause timings correct for "0"?
4669 ANALYZE_PUTCHAR ('0');
4676 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4679 ANALYZE_PUTCHAR (last_value
+ '0');
4682 irmp_store_bit (last_value
);
4686 { // timing incorrect!
4688 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
);
4689 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4691 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4692 irmp_pause_time
= 0;
4697 { // timing incorrect!
4699 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
);
4700 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4702 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4703 irmp_pause_time
= 0;
4707 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4709 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4710 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4712 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4715 ANALYZE_PUTCHAR ('0');
4716 ANALYZE_PUTCHAR ('0');
4721 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4724 ANALYZE_PUTCHAR ('0');
4725 ANALYZE_PUTCHAR ('1');
4730 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4733 ANALYZE_PUTCHAR ('1');
4734 ANALYZE_PUTCHAR ('0');
4739 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4742 ANALYZE_PUTCHAR ('1');
4743 ANALYZE_PUTCHAR ('1');
4749 ANALYZE_PRINTF ("\n");
4756 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4757 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4758 { // pulse & pause timings correct for "1"?
4760 ANALYZE_PUTCHAR ('1');
4766 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4767 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4768 { // pulse & pause timings correct for "0"?
4770 ANALYZE_PUTCHAR ('0');
4777 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4779 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4780 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4781 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4782 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4784 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4791 ANALYZE_PUTCHAR ('S');
4794 irmp_tmp_command
<<= 1;
4799 ANALYZE_PUTCHAR ('S');
4807 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4808 { // timing incorrect!
4810 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4811 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4813 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4814 irmp_pause_time
= 0;
4817 irmp_pulse_time
= 1; // set counter to 1, not 0
4821 { // counting the pulse length ...
4822 if (! irmp_input
) // still light?
4824 irmp_pulse_time
++; // increment counter
4828 wait_for_space
= 1; // let's count the time (see above)
4829 irmp_pause_time
= 1; // set pause counter to 1, not 0
4833 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4835 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4837 repetition_frame_number
++;
4841 repetition_frame_number
= 0;
4844 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4845 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4846 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4849 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4850 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4852 key_repetition_len
= 0;
4857 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4858 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4859 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4862 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4863 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4865 key_repetition_len
= 0;
4870 #if 0 && IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4871 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4872 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4875 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4876 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4878 key_repetition_len
= 0;
4883 #if 0 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4884 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4885 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4888 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4889 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4891 key_repetition_len
= 0;
4896 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4897 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4898 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4901 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4902 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4904 key_repetition_len
= 0;
4909 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4910 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4911 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4914 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4915 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4917 key_repetition_len
= 0;
4924 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4926 irmp_ir_detected
= TRUE
;
4928 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4929 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4930 { // check for repetition frame
4931 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4933 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4934 last_irmp_denon_command
= 0;
4936 irmp_protocol
= irmp_param
.protocol
; // store protocol
4937 irmp_address
= irmp_tmp_address
; // store address
4938 irmp_command
= irmp_tmp_command
; // store command
4942 if ((irmp_tmp_command
& 0x01) == 0x00)
4945 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4947 last_irmp_denon_command
= irmp_tmp_command
;
4948 denon_repetition_len
= 0;
4949 irmp_ir_detected
= FALSE
;
4954 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4956 last_irmp_denon_command
= 0;
4957 irmp_ir_detected
= FALSE
;
4962 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4964 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4965 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4966 { // Grundig start frame?
4968 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4970 irmp_ir_detected
= FALSE
;
4973 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4975 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4976 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4977 { // Nokia start frame?
4979 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4981 irmp_ir_detected
= FALSE
;
4984 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4986 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4987 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4989 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4992 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4993 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4995 irmp_tmp_address
= last_irmp_address
; // address is last address
4996 irmp_tmp_command
= last_irmp_command
; // command is last command
4997 irmp_flags
|= IRMP_FLAG_REPETITION
;
4998 key_repetition_len
= 0;
5003 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
5004 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
5006 irmp_ir_detected
= FALSE
;
5009 #endif // IRMP_SUPPORT_NEC_PROTOCOL
5011 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
5012 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
5014 uint_fast8_t xor_value
;
5016 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
5018 if (xor_value
!= (xor_check
[2] & 0x0F))
5021 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
5023 irmp_ir_detected
= FALSE
;
5026 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
5028 if (xor_value
!= xor_check
[5])
5031 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
5033 irmp_ir_detected
= FALSE
;
5036 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
5038 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
5040 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5041 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
5043 if (parity
== PARITY_CHECK_FAILED
)
5046 ANALYZE_PRINTF ("error 6: parity check failed\n");
5048 irmp_ir_detected
= FALSE
;
5051 if ((irmp_tmp_address
& 0x03) == 0x02)
5054 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
5056 irmp_ir_detected
= FALSE
;
5058 irmp_tmp_address
>>= 2;
5060 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5062 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
5063 if (irmp_param
.protocol
== IRMP_MITSU_HEAVY_PROTOCOL
)
5065 check
= irmp_tmp_command
>> 8; // inverted upper byte == lower byte?
5067 if (check
== (irmp_tmp_command
& 0xFF)) { //ok:
5068 irmp_tmp_command
&= 0xFF;
5070 else mitsu_parity
= PARITY_CHECK_FAILED
;
5071 if (mitsu_parity
== PARITY_CHECK_FAILED
)
5074 ANALYZE_PRINTF ("error 7: parity check failed\n");
5076 irmp_ir_detected
= FALSE
;
5079 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
5081 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
5082 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
5084 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
5087 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
5089 irmp_protocol
= irmp_param
.protocol
;
5092 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
5093 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
5095 if (irmp_tmp_command
& 0x000F) // released key?
5097 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
5101 irmp_tmp_command
>>= 4; // no, it's a pressed key
5103 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
5104 irmp_tmp_address
&= 0x003F;
5108 irmp_address
= irmp_tmp_address
; // store address
5109 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
5110 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
5112 last_irmp_address
= irmp_tmp_address
; // store as last address, too
5116 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
5117 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
5119 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
5122 #if IRMP_SUPPORT_S100_PROTOCOL == 1
5123 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
5125 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
5128 irmp_command
= irmp_tmp_command
; // store command
5130 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
5131 irmp_id
= irmp_tmp_id
;
5136 if (irmp_ir_detected
)
5138 if (last_irmp_command
== irmp_tmp_command
&&
5139 last_irmp_address
== irmp_tmp_address
&&
5140 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
5142 irmp_flags
|= IRMP_FLAG_REPETITION
;
5145 last_irmp_address
= irmp_tmp_address
; // store as last address, too
5146 last_irmp_command
= irmp_tmp_command
; // store as last command, too
5148 key_repetition_len
= 0;
5153 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
5157 irmp_start_bit_detected
= 0; // and wait for next start bit
5158 irmp_tmp_command
= 0;
5159 irmp_pulse_time
= 0;
5160 irmp_pause_time
= 0;
5162 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
5163 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
5164 { // set pulse time here!
5165 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
5167 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
5172 #if defined(STELLARIS_ARM_CORTEX_M4)
5173 // Clear the timer interrupt
5174 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
5177 return (irmp_ir_detected
);
5182 /*---------------------------------------------------------------------------------------------------------------------------------------------------
5183 * main functions - for Unix/Linux + Windows only!
5187 * Compile it under linux with:
5190 * usage: ./irmp [-v|-s|-a|-l] < file
5196 * -l list pulse/pauses
5197 *---------------------------------------------------------------------------------------------------------------------------------------------------
5201 print_spectrum (char * text
, int * buf
, int is_pulse
)
5214 puts ("-----------------------------------------------------------------------------");
5215 printf ("%s:\n", text
);
5217 for (i
= 0; i
< 256; i
++)
5219 if (buf
[i
] > max_value
)
5225 for (i
= 1; i
< 200; i
++)
5230 value
= (buf
[i
] * 60) / max_value
;
5232 for (j
= 0; j
< value
; j
++)
5236 printf (" %d\n", buf
[i
]);
5247 average
= (float) sum
/ (float) counter
;
5258 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
5259 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
5260 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
5262 tolerance
= (max
- average
);
5264 if (average
- min
> tolerance
)
5266 tolerance
= average
- min
;
5269 tolerance
= tolerance
* 100 / average
;
5270 printf ("tol: %4.1f%%\n", tolerance
);
5280 #define STATE_LEFT_SHIFT 0x01
5281 #define STATE_RIGHT_SHIFT 0x02
5282 #define STATE_LEFT_CTRL 0x04
5283 #define STATE_LEFT_ALT 0x08
5284 #define STATE_RIGHT_ALT 0x10
5286 #define KEY_ESCAPE 0x1B // keycode = 0x006e
5287 #define KEY_MENUE 0x80 // keycode = 0x0070
5288 #define KEY_BACK 0x81 // keycode = 0x0071
5289 #define KEY_FORWARD 0x82 // keycode = 0x0072
5290 #define KEY_ADDRESS 0x83 // keycode = 0x0073
5291 #define KEY_WINDOW 0x84 // keycode = 0x0074
5292 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
5293 #define KEY_STOP 0x86 // keycode = 0x0076
5294 #define KEY_MAIL 0x87 // keycode = 0x0077
5295 #define KEY_FAVORITES 0x88 // keycode = 0x0078
5296 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
5297 #define KEY_SETUP 0x8A // keycode = 0x007a
5298 #define KEY_FONT 0x8B // keycode = 0x007b
5299 #define KEY_PRINT 0x8C // keycode = 0x007c
5300 #define KEY_ON_OFF 0x8E // keycode = 0x007c
5302 #define KEY_INSERT 0x90 // keycode = 0x004b
5303 #define KEY_DELETE 0x91 // keycode = 0x004c
5304 #define KEY_LEFT 0x92 // keycode = 0x004f
5305 #define KEY_HOME 0x93 // keycode = 0x0050
5306 #define KEY_END 0x94 // keycode = 0x0051
5307 #define KEY_UP 0x95 // keycode = 0x0053
5308 #define KEY_DOWN 0x96 // keycode = 0x0054
5309 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
5310 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
5311 #define KEY_RIGHT 0x99 // keycode = 0x0059
5312 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
5313 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
5316 get_fdc_key (uint_fast16_t cmd
)
5318 static uint8_t key_table
[128] =
5320 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
5321 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0xDF, '´', 0, '\b',
5322 '\t', 'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 0xFC, '+', 0, 0, 'a',
5323 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0xF6, 0xE4, '#', '\r', 0, '<', 'y', 'x',
5324 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
5326 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
5327 '\t', 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 0xDC, '*', 0, 0, 'A',
5328 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 0xD6, 0xC4, '\'', '\r', 0, '>', 'Y', 'X',
5329 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5331 static uint_fast8_t state
;
5333 uint_fast8_t key
= 0;
5337 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
5338 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
5339 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
5340 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
5341 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
5342 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
5343 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
5344 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
5345 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
5346 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
5348 case 0x006e: key
= KEY_ESCAPE
; break;
5349 case 0x004b: key
= KEY_INSERT
; break;
5350 case 0x004c: key
= KEY_DELETE
; break;
5351 case 0x004f: key
= KEY_LEFT
; break;
5352 case 0x0050: key
= KEY_HOME
; break;
5353 case 0x0051: key
= KEY_END
; break;
5354 case 0x0053: key
= KEY_UP
; break;
5355 case 0x0054: key
= KEY_DOWN
; break;
5356 case 0x0055: key
= KEY_PAGE_UP
; break;
5357 case 0x0056: key
= KEY_PAGE_DOWN
; break;
5358 case 0x0059: key
= KEY_RIGHT
; break;
5359 case 0x0400: key
= KEY_MOUSE_1
; break;
5360 case 0x0800: key
= KEY_MOUSE_2
; break;
5364 if (!(cmd
& 0x80)) // pressed key
5366 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
5368 key
= cmd
+ 0x10; // 7x -> 8x
5370 else if (cmd
< 64) // key listed in key_table
5372 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
5376 case 0x0003: key
= 0xB2; break; // upper 2
5377 case 0x0008: key
= '{'; break;
5378 case 0x0009: key
= '['; break;
5379 case 0x000A: key
= ']'; break;
5380 case 0x000B: key
= '}'; break;
5381 case 0x000C: key
= '\\'; break;
5382 case 0x001C: key
= '~'; break;
5383 case 0x002D: key
= '|'; break;
5384 case 0x0034: key
= 0xB5; break; // Mu
5387 else if (state
& (STATE_LEFT_CTRL
))
5389 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
5391 key
= key_table
[cmd
] - 'a' + 1;
5395 key
= key_table
[cmd
];
5400 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5404 key
= key_table
[idx
];
5416 static int analyze
= FALSE
;
5417 static int list
= FALSE
;
5418 static IRMP_DATA irmp_data
;
5419 static int expected_protocol
;
5420 static int expected_address
;
5421 static int expected_command
;
5422 static int do_check_expected_values
;
5427 if (! analyze
&& ! list
)
5431 if (irmp_get_data (&irmp_data
))
5435 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5439 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5442 if (irmp_data
.protocol
== IRMP_ACP24_PROTOCOL
)
5444 uint16_t temp
= (irmp_data
.command
& 0x000F) + 15;
5446 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5447 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, temp
);
5449 else if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5451 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5453 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5454 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5456 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5458 char * p
= (char *) NULL
;
5462 case '\t' : p
= "TAB"; break;
5463 case '\r' : p
= "CR"; break;
5464 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5465 case KEY_MENUE
: p
= "MENUE"; break;
5466 case KEY_BACK
: p
= "BACK"; break;
5467 case KEY_FORWARD
: p
= "FORWARD"; break;
5468 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5469 case KEY_WINDOW
: p
= "WINDOW"; break;
5470 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5471 case KEY_STOP
: p
= "STOP"; break;
5472 case KEY_MAIL
: p
= "MAIL"; break;
5473 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5474 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5475 case KEY_SETUP
: p
= "SETUP"; break;
5476 case KEY_FONT
: p
= "FONT"; break;
5477 case KEY_PRINT
: p
= "PRINT"; break;
5478 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5480 case KEY_INSERT
: p
= "INSERT"; break;
5481 case KEY_DELETE
: p
= "DELETE"; break;
5482 case KEY_LEFT
: p
= "LEFT"; break;
5483 case KEY_HOME
: p
= "HOME"; break;
5484 case KEY_END
: p
= "END"; break;
5485 case KEY_UP
: p
= "UP"; break;
5486 case KEY_DOWN
: p
= "DOWN"; break;
5487 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5488 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5489 case KEY_RIGHT
: p
= "RIGHT"; break;
5490 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5491 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5492 default : p
= "<UNKNWON>"; break;
5495 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5496 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5500 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5501 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5506 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5507 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5510 if (do_check_expected_values
)
5512 if (irmp_data
.protocol
!= expected_protocol
||
5513 irmp_data
.address
!= expected_address
||
5514 irmp_data
.command
!= expected_command
)
5516 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5517 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5521 printf (" checked!\n");
5523 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5534 main (int argc
, char ** argv
)
5542 int start_pulses
[256];
5543 int start_pauses
[256];
5547 int first_pulse
= TRUE
;
5548 int first_pause
= TRUE
;
5552 if (! strcmp (argv
[1], "-v"))
5556 else if (! strcmp (argv
[1], "-l"))
5560 else if (! strcmp (argv
[1], "-a"))
5564 else if (! strcmp (argv
[1], "-s"))
5568 else if (! strcmp (argv
[1], "-r"))
5574 for (i
= 0; i
< 256; i
++)
5576 start_pulses
[i
] = 0;
5577 start_pauses
[i
] = 0;
5584 while ((ch
= getchar ()) != EOF
)
5586 if (ch
== '_' || ch
== '0')
5594 printf ("pause: %d\n", pause
);
5603 start_pauses
[pause
]++;
5605 first_pause
= FALSE
;
5621 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5627 printf ("pulse: %d ", pulse
);
5636 start_pulses
[pulse
]++;
5638 first_pulse
= FALSE
;
5654 else if (ch
== '\n')
5659 if (list
&& pause
> 0)
5661 printf ("pause: %d\n", pause
);
5667 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5681 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5692 puts ("----------------------------------------------------------------------");
5696 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5698 if (ch
!= '\r') // ignore CR in DOS/Windows files
5700 if (ch
== '[' && idx
== -1)
5708 do_check_expected_values
= FALSE
;
5712 expected_protocol
= atoi (buf
);
5714 if (expected_protocol
> 0)
5723 if (sscanf (p
, "%x", &expected_address
) == 1)
5725 do_check_expected_values
= TRUE
;
5732 if (do_check_expected_values
)
5734 do_check_expected_values
= FALSE
;
5742 if (sscanf (p
, "%x", &expected_command
) == 1)
5744 do_check_expected_values
= TRUE
;
5751 if (do_check_expected_values
)
5753 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5758 else if (idx
< 1024 - 2)
5778 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5779 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5780 print_spectrum ("PULSES", pulses
, TRUE
);
5781 print_spectrum ("PAUSES", pauses
, FALSE
);
5782 puts ("-----------------------------------------------------------------------------");