1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.171 2015/04/23 12:46:13 fm Exp $
8 * Supported AVR mikrocontrollers:
13 * ATmega8, ATmega16, ATmega32
15 * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
16 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *---------------------------------------------------------------------------------------------------------------------------------------------------
27 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
28 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
30 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
33 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
34 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
36 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
39 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
40 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
41 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
42 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
43 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
44 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
45 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
46 # define IRMP_SUPPORT_MANCHESTER 1
48 # define IRMP_SUPPORT_MANCHESTER 0
51 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
52 # define IRMP_SUPPORT_SERIAL 1
54 # define IRMP_SUPPORT_SERIAL 0
57 #define IRMP_KEY_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
59 #define MIN_TOLERANCE_00 1.0 // -0%
60 #define MAX_TOLERANCE_00 1.0 // +0%
62 #define MIN_TOLERANCE_05 0.95 // -5%
63 #define MAX_TOLERANCE_05 1.05 // +5%
65 #define MIN_TOLERANCE_10 0.9 // -10%
66 #define MAX_TOLERANCE_10 1.1 // +10%
68 #define MIN_TOLERANCE_15 0.85 // -15%
69 #define MAX_TOLERANCE_15 1.15 // +15%
71 #define MIN_TOLERANCE_20 0.8 // -20%
72 #define MAX_TOLERANCE_20 1.2 // +20%
74 #define MIN_TOLERANCE_30 0.7 // -30%
75 #define MAX_TOLERANCE_30 1.3 // +30%
77 #define MIN_TOLERANCE_40 0.6 // -40%
78 #define MAX_TOLERANCE_40 1.4 // +40%
80 #define MIN_TOLERANCE_50 0.5 // -50%
81 #define MAX_TOLERANCE_50 1.5 // +50%
83 #define MIN_TOLERANCE_60 0.4 // -60%
84 #define MAX_TOLERANCE_60 1.6 // +60%
86 #define MIN_TOLERANCE_70 0.3 // -70%
87 #define MAX_TOLERANCE_70 1.7 // +70%
89 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
90 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
91 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
92 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
93 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
94 #else // only 5% + 1 to avoid conflict with RC6:
95 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
97 #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
98 #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
99 #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
100 #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
101 #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
102 #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
104 #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
105 #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
106 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
107 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
108 #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)
109 #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)
110 #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
111 #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
112 #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 // autodetect nec repetition frame within 50 msec:
117 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
119 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
121 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
124 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
125 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
126 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
127 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
128 #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
129 #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
130 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
131 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
132 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
133 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
135 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
136 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
137 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
138 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
139 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
140 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
141 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
142 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
143 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
144 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
146 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
147 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
148 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
149 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
150 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
151 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
152 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
153 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
154 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
155 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
157 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
158 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
159 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
160 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
161 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
162 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
163 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
164 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
165 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
169 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
170 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
171 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
173 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
174 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
177 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
178 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
180 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
181 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
182 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
183 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
184 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
185 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
186 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
187 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
189 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
190 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
192 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
193 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
196 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
197 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
198 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
201 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
203 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
204 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
205 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
207 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
208 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
209 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
210 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
211 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
212 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
213 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
214 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
215 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
218 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
219 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
220 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
221 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
222 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
223 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
224 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
225 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
226 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
227 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
228 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
229 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
231 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
232 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
233 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
234 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
235 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
236 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
237 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
238 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
239 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
240 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
241 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
242 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
244 #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)
245 #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)
246 #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)
247 #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)
248 #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)
249 #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)
250 #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)
251 #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)
252 #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)
253 #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)
254 #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)
255 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX ((PAUSE_LEN)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) // value must be below IRMP_TIMEOUT
256 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
257 #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)
258 #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)
259 #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)
260 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
261 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
262 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
263 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
264 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
265 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
266 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
267 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
268 #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)
269 #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)
271 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
272 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
275 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
276 #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)
277 #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)
279 #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)
280 #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)
281 #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)
282 #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)
283 #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)
284 #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)
285 #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)
286 #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)
288 #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
289 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
290 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
291 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
292 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
293 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
294 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
295 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
297 #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
299 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
301 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
303 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
304 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
305 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
306 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
307 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
308 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
309 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
310 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
311 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
312 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
314 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
315 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
316 #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!
317 #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!
318 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
319 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
320 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
321 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
322 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
323 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
324 // autodetect JVC repetition frame within 50 msec:
325 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
327 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
328 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
329 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
330 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
331 #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)
332 #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)
333 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
334 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
335 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
336 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
337 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
338 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
339 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
341 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
342 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
343 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
344 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
345 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
346 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
347 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
348 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
349 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
350 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
351 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
352 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
353 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
354 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
356 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
357 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
358 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
359 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
360 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
361 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
362 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
363 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
365 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
366 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
367 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
368 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
369 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
370 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
371 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
372 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
373 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
374 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
376 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
377 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
378 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
379 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
380 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
381 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
382 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
383 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
384 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
385 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
386 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
388 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
389 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
390 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
391 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
392 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
393 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
394 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
395 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
397 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
398 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
399 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
400 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
401 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
402 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
403 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
404 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
406 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
407 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
408 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
409 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
410 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
411 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
412 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
413 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
414 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
415 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
416 // autodetect TELEFUNKEN repetition frame within 50 msec:
417 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
419 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
420 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
421 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
422 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
423 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
424 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
425 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
426 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
427 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
428 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
429 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
430 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
431 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
432 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
434 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
435 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
436 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
437 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
438 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
439 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
440 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
441 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
442 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
443 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
444 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
445 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
446 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
447 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
449 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
450 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
451 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
452 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
453 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
454 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
455 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
456 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
457 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
458 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
459 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
460 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
461 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
462 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
464 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
465 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
466 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
467 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
468 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
469 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
470 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
471 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
472 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
473 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
474 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
475 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
476 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
477 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
479 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
482 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
483 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
484 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
485 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
486 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
488 static int time_counter
;
491 /******************************* not every PIC compiler knows variadic macros :-(
493 # define ANALYZE_PUTCHAR(a)
494 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
495 # define ANALYZE_PRINTF(...)
496 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
498 # define ANALYZE_NEWLINE()
499 *********************************/
502 #if IRMP_USE_CALLBACK == 1
503 static void (*irmp_callback_ptr
) (uint_fast8_t);
504 #endif // IRMP_USE_CALLBACK == 1
506 #define PARITY_CHECK_OK 1
507 #define PARITY_CHECK_FAILED 0
509 /*---------------------------------------------------------------------------------------------------------------------------------------------------
511 *---------------------------------------------------------------------------------------------------------------------------------------------------
513 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
514 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
515 static const char proto_sircs
[] PROGMEM
= "SIRCS";
516 static const char proto_nec
[] PROGMEM
= "NEC";
517 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
518 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
519 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
520 static const char proto_recs80
[] PROGMEM
= "RECS80";
521 static const char proto_rc5
[] PROGMEM
= "RC5";
522 static const char proto_denon
[] PROGMEM
= "DENON";
523 static const char proto_rc6
[] PROGMEM
= "RC6";
524 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
525 static const char proto_apple
[] PROGMEM
= "APPLE";
526 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
527 static const char proto_nubert
[] PROGMEM
= "NUBERT";
528 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
529 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
530 static const char proto_nokia
[] PROGMEM
= "NOKIA";
531 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
532 static const char proto_fdc
[] PROGMEM
= "FDC";
533 static const char proto_rccar
[] PROGMEM
= "RCCAR";
534 static const char proto_jvc
[] PROGMEM
= "JVC";
535 static const char proto_rc6a
[] PROGMEM
= "RC6A";
536 static const char proto_nikon
[] PROGMEM
= "NIKON";
537 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
538 static const char proto_ir60
[] PROGMEM
= "IR60";
539 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
540 static const char proto_netbox
[] PROGMEM
= "NETBOX";
541 static const char proto_nec16
[] PROGMEM
= "NEC16";
542 static const char proto_nec42
[] PROGMEM
= "NEC42";
543 static const char proto_lego
[] PROGMEM
= "LEGO";
544 static const char proto_thomson
[] PROGMEM
= "THOMSON";
545 static const char proto_bose
[] PROGMEM
= "BOSE";
546 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
547 static const char proto_ortek
[] PROGMEM
= "ORTEK";
548 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
549 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
550 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
551 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
552 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
553 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
554 static const char proto_lgair
[] PROGMEM
= "LGAIR";
555 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
556 static const char proto_merlin
[] PROGMEM
= "MERLIN";
557 static const char proto_pentax
[] PROGMEM
= "PENTAX";
559 static const char proto_radio1
[] PROGMEM
= "RADIO1";
562 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
613 /*---------------------------------------------------------------------------------------------------------------------------------------------------
615 *---------------------------------------------------------------------------------------------------------------------------------------------------
617 #if IRMP_LOGGING == 1 // logging via UART
619 #if defined(ARM_STM32F4XX)
620 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
621 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
622 # define STM32_GPIO_PORT GPIOA
623 # define STM32_GPIO_PIN GPIO_Pin_2
624 # define STM32_GPIO_SOURCE GPIO_PinSource2
625 # define STM32_UART_AF GPIO_AF_USART2
626 # define STM32_UART_COM USART2
627 # define STM32_UART_BAUD 115200 // 115200 Baud
628 # include "stm32f4xx_usart.h"
629 #elif defined(ARM_STM32F10X)
630 # define STM32_UART_COM USART3 // UART3 on PB10
632 # if IRMP_EXT_LOGGING == 1 // use external logging
633 # include "irmpextlog.h"
634 # else // normal UART log (IRMP_EXT_LOGGING == 0)
636 # ifndef UNIX_OR_WINDOWS
637 # include <util/setbaud.h>
642 #define UART0_UBRRH UBRR0H
643 #define UART0_UBRRL UBRR0L
644 #define UART0_UCSRA UCSR0A
645 #define UART0_UCSRB UCSR0B
646 #define UART0_UCSRC UCSR0C
647 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
648 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
649 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
651 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
653 #define UART0_URSEL_BIT_VALUE (0)
655 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
656 #define UART0_UDR UDR0
657 #define UART0_U2X U2X0
661 #define UART0_UBRRH UBRRH
662 #define UART0_UBRRL UBRRL
663 #define UART0_UCSRA UCSRA
664 #define UART0_UCSRB UCSRB
665 #define UART0_UCSRC UCSRC
666 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
667 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
668 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
670 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
672 #define UART0_URSEL_BIT_VALUE (0)
674 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
675 #define UART0_UDR UDR
676 #define UART0_U2X U2X
679 #endif //IRMP_EXT_LOGGING
680 #endif //ARM_STM32F4XX
682 /*---------------------------------------------------------------------------------------------------------------------------------------------------
684 * @details Initializes UART
685 *---------------------------------------------------------------------------------------------------------------------------------------------------
688 irmp_uart_init (void)
690 #ifndef UNIX_OR_WINDOWS
691 #if defined(ARM_STM32F4XX)
692 GPIO_InitTypeDef GPIO_InitStructure
;
693 USART_InitTypeDef USART_InitStructure
;
695 // Clock enable vom TX Pin
696 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
698 // Clock enable der UART
699 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
701 // UART Alternative-Funktion mit dem IO-Pin verbinden
702 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
704 // UART als Alternative-Funktion mit PushPull
705 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
706 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
707 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
708 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
711 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
712 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
715 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
717 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
718 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
719 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
720 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
721 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
722 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
723 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
724 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
727 USART_Cmd(STM32_UART_COM
, ENABLE
);
729 #elif defined(ARM_STM32F10X)
730 GPIO_InitTypeDef GPIO_InitStructure
;
731 USART_InitTypeDef USART_InitStructure
;
733 // Clock enable vom TX Pin
734 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
736 // Clock enable der UART
737 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
739 // UART als Alternative-Funktion mit PushPull
740 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
741 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
744 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
745 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
748 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
750 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
751 USART_InitStructure
.USART_BaudRate
= 115200;
752 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
753 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
754 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
755 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
756 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
757 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
760 USART_Cmd(STM32_UART_COM
, ENABLE
);
763 #if (IRMP_EXT_LOGGING == 0) // use UART
764 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
765 UART0_UBRRL
= UBRRL_VALUE
;
768 UART0_UCSRA
|= (1<<UART0_U2X
);
770 UART0_UCSRA
&= ~(1<<UART0_U2X
);
773 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
774 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
775 #else // other log method
777 #endif //IRMP_EXT_LOGGING
778 #endif //ARM_STM32F4XX
779 #endif // UNIX_OR_WINDOWS
782 /*---------------------------------------------------------------------------------------------------------------------------------------------------
784 * @details Sends character
785 * @param ch character to be transmitted
786 *---------------------------------------------------------------------------------------------------------------------------------------------------
789 irmp_uart_putc (unsigned char ch
)
791 #ifndef UNIX_OR_WINDOWS
792 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
793 // warten bis altes Byte gesendet wurde
794 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
799 USART_SendData(STM32_UART_COM
, ch
);
803 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
804 USART_SendData(STM32_UART_COM
, '\r');
808 #if (IRMP_EXT_LOGGING == 0)
810 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
819 sendextlog(ch
); // use external log
821 #endif //IRMP_EXT_LOGGING
822 #endif //ARM_STM32F4XX
825 #endif // UNIX_OR_WINDOWS
828 /*---------------------------------------------------------------------------------------------------------------------------------------------------
830 *---------------------------------------------------------------------------------------------------------------------------------------------------
833 #define STARTCYCLES 2 // min count of zeros before start of logging
834 #define ENDBITS 1000 // number of sequenced highbits to detect end
835 #define DATALEN 700 // log buffer size
838 irmp_log (uint_fast8_t val
)
840 static uint8_t buf
[DATALEN
]; // logging buffer
841 static uint_fast16_t buf_idx
; // index
842 static uint_fast8_t startcycles
; // current number of start-zeros
843 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
844 static uint_fast8_t last_val
= 1;
846 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
854 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
860 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
861 { // if stop condition is true, output on uart
865 uint_fast8_t v
= '1';
868 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
870 irmp_uart_putc ('0'); // the ignored starting zeros
873 for (i
= 0; i
< buf_idx
; i
++)
882 d
|= ((uint_fast16_t) buf
[i
] << 8);
885 for (j
= 0; j
< d
; j
++)
890 v
= (v
== '1') ? '0' : '1';
893 for (i8
= 0; i8
< 20; i8
++)
895 irmp_uart_putc ('1');
898 irmp_uart_putc ('\n');
904 else if (buf_idx
< DATALEN
- 3)
908 buf
[buf_idx
++] = 0xff;
909 buf
[buf_idx
++] = (cnt
& 0xff);
910 buf
[buf_idx
] = (cnt
>> 8);
926 #define irmp_log(val)
927 #endif //IRMP_LOGGING
931 uint_fast8_t protocol
; // ir protocol
932 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
933 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
934 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
935 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
936 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
937 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
938 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
939 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
940 uint_fast8_t address_offset
; // address offset
941 uint_fast8_t address_end
; // end of address
942 uint_fast8_t command_offset
; // command offset
943 uint_fast8_t command_end
; // end of command
944 uint_fast8_t complete_len
; // complete length of frame
945 uint_fast8_t stop_bit
; // flag: frame has stop bit
946 uint_fast8_t lsb_first
; // flag: LSB first
947 uint_fast8_t flags
; // some flags
950 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
952 static const PROGMEM IRMP_PARAMETER sircs_param
=
954 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
955 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
956 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
957 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
958 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
959 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
960 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
961 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
962 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
963 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
964 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
965 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
966 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
967 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
968 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
969 SIRCS_LSB
, // lsb_first: flag: LSB first
970 SIRCS_FLAGS
// flags: some flags
975 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
977 static const PROGMEM IRMP_PARAMETER nec_param
=
979 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
980 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
981 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
982 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
983 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
984 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
985 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
986 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
987 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
988 NEC_ADDRESS_OFFSET
, // address_offset: address offset
989 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
990 NEC_COMMAND_OFFSET
, // command_offset: command offset
991 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
992 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
993 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
994 NEC_LSB
, // lsb_first: flag: LSB first
995 NEC_FLAGS
// flags: some flags
998 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1000 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1001 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1002 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1003 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1004 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1005 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1006 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1007 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1008 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1009 0, // address_offset: address offset
1010 0, // address_end: end of address
1011 0, // command_offset: command offset
1012 0, // command_end: end of command
1013 0, // complete_len: complete length of frame
1014 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1015 NEC_LSB
, // lsb_first: flag: LSB first
1016 NEC_FLAGS
// flags: some flags
1021 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1023 static const PROGMEM IRMP_PARAMETER nec42_param
=
1025 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1026 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1027 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1028 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1029 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1030 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1031 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1032 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1033 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1034 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1035 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1036 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1037 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1038 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1039 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1040 NEC_LSB
, // lsb_first: flag: LSB first
1041 NEC_FLAGS
// flags: some flags
1046 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1048 static const PROGMEM IRMP_PARAMETER lgair_param
=
1050 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1051 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1052 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1053 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1054 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1055 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1056 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1057 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1058 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1059 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1060 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1061 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1062 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1063 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1064 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1065 NEC_LSB
, // lsb_first: flag: LSB first
1066 NEC_FLAGS
// flags: some flags
1071 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1073 static const PROGMEM IRMP_PARAMETER samsung_param
=
1075 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1076 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1077 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1078 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1079 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1080 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1081 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1082 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1083 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1084 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1085 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1086 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1087 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1088 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1089 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1090 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1091 SAMSUNG_FLAGS
// flags: some flags
1096 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1098 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1100 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1101 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1102 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1103 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1104 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1105 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1106 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1107 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1108 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1109 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1110 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1111 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1112 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1113 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1114 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1115 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1116 TELEFUNKEN_FLAGS
// flags: some flags
1121 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1123 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1125 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1126 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1127 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1128 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1129 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1130 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1131 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1132 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1133 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1134 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1135 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1136 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1137 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1138 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1139 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1140 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1141 MATSUSHITA_FLAGS
// flags: some flags
1146 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1148 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1150 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1151 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1152 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1153 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1154 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1155 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1156 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1157 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1158 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1159 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1160 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1161 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1162 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1163 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1164 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1165 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1166 KASEIKYO_FLAGS
// flags: some flags
1171 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1173 static const PROGMEM IRMP_PARAMETER recs80_param
=
1175 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1176 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1177 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1178 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1179 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1180 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1181 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1182 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1183 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1184 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1185 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1186 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1187 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1188 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1189 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1190 RECS80_LSB
, // lsb_first: flag: LSB first
1191 RECS80_FLAGS
// flags: some flags
1196 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1198 static const PROGMEM IRMP_PARAMETER rc5_param
=
1200 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1201 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1202 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1203 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1204 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1205 0, // pulse_0_len_min: here: not used
1206 0, // pulse_0_len_max: here: not used
1207 0, // pause_0_len_min: here: not used
1208 0, // pause_0_len_max: here: not used
1209 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1210 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1211 RC5_COMMAND_OFFSET
, // command_offset: command offset
1212 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1213 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1214 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1215 RC5_LSB
, // lsb_first: flag: LSB first
1216 RC5_FLAGS
// flags: some flags
1221 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1223 static const PROGMEM IRMP_PARAMETER denon_param
=
1225 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1226 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1227 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1228 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1229 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1230 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1231 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1232 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1233 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1234 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1235 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1236 DENON_COMMAND_OFFSET
, // command_offset: command offset
1237 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1238 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1239 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1240 DENON_LSB
, // lsb_first: flag: LSB first
1241 DENON_FLAGS
// flags: some flags
1246 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1248 static const PROGMEM IRMP_PARAMETER rc6_param
=
1250 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1252 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1253 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1254 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1255 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1256 0, // pulse_0_len_min: here: not used
1257 0, // pulse_0_len_max: here: not used
1258 0, // pause_0_len_min: here: not used
1259 0, // pause_0_len_max: here: not used
1260 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1261 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1262 RC6_COMMAND_OFFSET
, // command_offset: command offset
1263 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1264 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1265 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1266 RC6_LSB
, // lsb_first: flag: LSB first
1267 RC6_FLAGS
// flags: some flags
1272 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1274 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1276 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1277 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1278 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1279 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1280 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1281 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1282 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1283 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1284 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1285 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1286 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1287 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1288 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1289 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1290 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1291 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1292 RECS80EXT_FLAGS
// flags: some flags
1297 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1299 static const PROGMEM IRMP_PARAMETER nubert_param
=
1301 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1302 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1303 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1304 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1305 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1306 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1307 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1308 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1309 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1310 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1311 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1312 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1313 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1314 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1315 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1316 NUBERT_LSB
, // lsb_first: flag: LSB first
1317 NUBERT_FLAGS
// flags: some flags
1322 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1324 static const PROGMEM IRMP_PARAMETER speaker_param
=
1326 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1327 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1328 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1329 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1330 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1331 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1332 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1333 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1334 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1335 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1336 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1337 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1338 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1339 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1340 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1341 SPEAKER_LSB
, // lsb_first: flag: LSB first
1342 SPEAKER_FLAGS
// flags: some flags
1347 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1349 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1351 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1352 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1353 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1354 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1355 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1356 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1357 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1358 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1359 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1360 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1361 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1362 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1363 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1364 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1365 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1366 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1367 BANG_OLUFSEN_FLAGS
// flags: some flags
1372 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1374 static uint_fast8_t first_bit
;
1376 static const PROGMEM IRMP_PARAMETER grundig_param
=
1378 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1380 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1381 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1382 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1383 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1384 0, // pulse_0_len_min: here: not used
1385 0, // pulse_0_len_max: here: not used
1386 0, // pause_0_len_min: here: not used
1387 0, // pause_0_len_max: here: not used
1388 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1389 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1390 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1391 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1392 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1393 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1394 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1395 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1400 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1402 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1404 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1405 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1406 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1407 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1408 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1409 0, // pulse_0_len_min: here: not used
1410 0, // pulse_0_len_max: here: not used
1411 0, // pause_0_len_min: here: not used
1412 0, // pause_0_len_max: here: not used
1413 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1414 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1415 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1416 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1417 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1418 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1419 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1420 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1425 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1427 static const PROGMEM IRMP_PARAMETER fdc_param
=
1429 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1430 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1431 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1432 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1433 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1434 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1435 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1436 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1437 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1438 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1439 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1440 FDC_COMMAND_OFFSET
, // command_offset: command offset
1441 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1442 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1443 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1444 FDC_LSB
, // lsb_first: flag: LSB first
1445 FDC_FLAGS
// flags: some flags
1450 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1452 static const PROGMEM IRMP_PARAMETER rccar_param
=
1454 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1455 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1456 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1457 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1458 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1459 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1460 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1461 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1462 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1463 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1464 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1465 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1466 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1467 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1468 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1469 RCCAR_LSB
, // lsb_first: flag: LSB first
1470 RCCAR_FLAGS
// flags: some flags
1475 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1477 static const PROGMEM IRMP_PARAMETER nikon_param
=
1479 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1480 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1481 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1482 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1483 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1484 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1485 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1486 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1487 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1488 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1489 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1490 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1491 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1492 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1493 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1494 NIKON_LSB
, // lsb_first: flag: LSB first
1495 NIKON_FLAGS
// flags: some flags
1500 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1502 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1504 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1505 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1506 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1507 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1508 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1509 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1510 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1511 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1512 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1513 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1514 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1515 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1516 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1517 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1518 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1519 KATHREIN_LSB
, // lsb_first: flag: LSB first
1520 KATHREIN_FLAGS
// flags: some flags
1525 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1527 static const PROGMEM IRMP_PARAMETER netbox_param
=
1529 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1530 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1531 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1532 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1533 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1534 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1535 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1536 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1537 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1538 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1539 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1540 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1541 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1542 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1543 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1544 NETBOX_LSB
, // lsb_first: flag: LSB first
1545 NETBOX_FLAGS
// flags: some flags
1550 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1552 static const PROGMEM IRMP_PARAMETER lego_param
=
1554 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1555 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1556 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1557 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1558 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1559 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1560 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1561 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1562 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1563 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1564 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1565 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1566 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1567 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1568 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1569 LEGO_LSB
, // lsb_first: flag: LSB first
1570 LEGO_FLAGS
// flags: some flags
1575 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1577 static const PROGMEM IRMP_PARAMETER thomson_param
=
1579 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1580 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1581 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1582 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1583 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1584 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1585 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1586 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1587 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1588 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1589 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1590 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1591 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1592 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1593 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1594 THOMSON_LSB
, // lsb_first: flag: LSB first
1595 THOMSON_FLAGS
// flags: some flags
1600 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1602 static const PROGMEM IRMP_PARAMETER bose_param
=
1604 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1605 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1606 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1607 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1608 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1609 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1610 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1611 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1612 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1613 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1614 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1615 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1616 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1617 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1618 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1619 BOSE_LSB
, // lsb_first: flag: LSB first
1620 BOSE_FLAGS
// flags: some flags
1625 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1627 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1629 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1631 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1632 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1633 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1634 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1635 0, // pulse_0_len_min: here: not used
1636 0, // pulse_0_len_max: here: not used
1637 0, // pause_0_len_min: here: not used
1638 0, // pause_0_len_max: here: not used
1639 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1640 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1641 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1642 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1643 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1644 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1645 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1646 A1TVBOX_FLAGS
// flags: some flags
1651 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1653 static const PROGMEM IRMP_PARAMETER ortek_param
=
1655 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1657 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1658 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1659 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1660 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1661 0, // pulse_0_len_min: here: not used
1662 0, // pulse_0_len_max: here: not used
1663 0, // pause_0_len_min: here: not used
1664 0, // pause_0_len_max: here: not used
1665 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1666 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1667 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1668 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1669 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1670 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1671 ORTEK_LSB
, // lsb_first: flag: LSB first
1672 ORTEK_FLAGS
// flags: some flags
1677 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1679 static const PROGMEM IRMP_PARAMETER roomba_param
=
1681 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1682 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1683 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1684 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1685 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1686 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1687 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1688 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1689 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1690 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1691 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1692 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1693 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1694 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1695 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1696 ROOMBA_LSB
, // lsb_first: flag: LSB first
1697 ROOMBA_FLAGS
// flags: some flags
1702 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1704 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1706 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1708 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1709 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1710 0, // pause_1_len_min: here: minimum length of short pause
1711 0, // pause_1_len_max: here: maximum length of short pause
1712 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1713 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1714 0, // pause_0_len_min: here: not used
1715 0, // pause_0_len_max: here: not used
1716 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1717 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1718 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1719 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1720 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1721 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1722 RCMM32_LSB
, // lsb_first: flag: LSB first
1723 RCMM32_FLAGS
// flags: some flags
1728 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
1730 static const PROGMEM IRMP_PARAMETER pentax_param
=
1732 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
1733 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1734 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1735 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1736 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1737 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1738 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1739 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1740 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1741 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
1742 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
1743 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
1744 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
1745 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1746 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1747 PENTAX_LSB
, // lsb_first: flag: LSB first
1748 PENTAX_FLAGS
// flags: some flags
1753 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
1755 static const PROGMEM IRMP_PARAMETER radio1_param
=
1757 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
1759 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1760 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1761 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1762 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1763 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1764 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1765 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1766 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1767 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
1768 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
1769 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
1770 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
1771 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1772 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
1773 RADIO1_LSB
, // lsb_first: flag: LSB first
1774 RADIO1_FLAGS
// flags: some flags
1779 static uint_fast8_t irmp_bit
; // current bit position
1780 static IRMP_PARAMETER irmp_param
;
1782 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1783 static IRMP_PARAMETER irmp_param2
;
1786 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
1787 static volatile uint_fast8_t irmp_protocol
;
1788 static volatile uint_fast16_t irmp_address
;
1789 static volatile uint_fast16_t irmp_command
;
1790 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
1791 static volatile uint_fast8_t irmp_flags
;
1792 // static volatile uint_fast8_t irmp_busy_flag;
1795 #define input(x) (x)
1796 static uint_fast8_t IRMP_PIN
;
1797 static uint_fast8_t radio
;
1800 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1801 * Initialize IRMP decoder
1802 * @details Configures IRMP input pin
1803 *---------------------------------------------------------------------------------------------------------------------------------------------------
1809 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
1810 #elif defined (ARM_STM32) // STM32
1811 GPIO_InitTypeDef GPIO_InitStructure
;
1813 /* GPIOx clock enable */
1814 #if defined (ARM_STM32L1XX)
1815 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1816 #elif defined (ARM_STM32F10X)
1817 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1818 #elif defined (ARM_STM32F4XX)
1819 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1822 /* GPIO Configuration */
1823 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
1824 #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
1825 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
1826 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1827 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
1828 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
1829 #elif defined (ARM_STM32F10X)
1830 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1831 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
1833 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
1834 #elif defined(STELLARIS_ARM_CORTEX_M4)
1835 // Enable the GPIO port
1836 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
1839 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
1840 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
,
1842 GPIO_PIN_TYPE_STD_WPU
);
1844 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
1845 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
1848 #if IRMP_LOGGING == 1
1853 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1855 * @details gets decoded IRMP data
1856 * @param pointer in order to store IRMP data
1857 * @return TRUE: successful, FALSE: failed
1858 *---------------------------------------------------------------------------------------------------------------------------------------------------
1861 irmp_get_data (IRMP_DATA
* irmp_data_p
)
1863 uint_fast8_t rtc
= FALSE
;
1865 if (irmp_ir_detected
)
1867 switch (irmp_protocol
)
1869 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1870 case IRMP_SAMSUNG_PROTOCOL
:
1871 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1873 irmp_command
&= 0xff;
1874 irmp_command
|= irmp_id
<< 8;
1879 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
1880 case IRMP_SAMSUNG48_PROTOCOL
:
1881 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
1887 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1888 case IRMP_NEC_PROTOCOL
:
1889 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1891 irmp_command
&= 0xff;
1894 else if (irmp_address
== 0x87EE)
1897 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
1899 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
1900 irmp_address
= (irmp_command
& 0xFF00) >> 8;
1901 irmp_command
&= 0x00FF;
1906 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1907 case IRMP_BOSE_PROTOCOL
:
1908 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1910 irmp_command
&= 0xff;
1915 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1916 case IRMP_SIEMENS_PROTOCOL
:
1917 case IRMP_RUWIDO_PROTOCOL
:
1918 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
1925 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1926 case IRMP_KATHREIN_PROTOCOL
:
1927 if (irmp_command
!= 0x0000)
1933 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1934 case IRMP_RC5_PROTOCOL
:
1935 irmp_address
&= ~0x20; // clear toggle bit
1939 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
1940 case IRMP_IR60_PROTOCOL
:
1941 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
1948 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
1953 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1954 case IRMP_RCCAR_PROTOCOL
:
1955 // frame in irmp_data:
1956 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
1957 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
1958 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
1959 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
1960 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
1961 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
1962 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
1966 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
1967 case IRMP_NETBOX_PROTOCOL
:
1968 if (irmp_command
& 0x1000) // last bit set?
1970 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
1973 irmp_command
&= 0x7F;
1976 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
1979 irmp_command
|= 0x80;
1985 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
1992 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
1997 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1998 case IRMP_LEGO_PROTOCOL
:
2000 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2002 if ((irmp_command
& 0x000F) == crc
)
2010 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2012 // rtc = TRUE; // don't accept codes with CRC errors
2027 irmp_data_p
->protocol
= irmp_protocol
;
2028 irmp_data_p
->address
= irmp_address
;
2029 irmp_data_p
->command
= irmp_command
;
2030 irmp_data_p
->flags
= irmp_flags
;
2036 irmp_ir_detected
= FALSE
;
2042 #if IRMP_USE_CALLBACK == 1
2044 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2046 irmp_callback_ptr
= cb
;
2048 #endif // IRMP_USE_CALLBACK == 1
2050 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2051 static uint_fast16_t irmp_tmp_address
; // ir address
2052 static uint_fast16_t irmp_tmp_command
; // ir command
2054 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2055 static uint_fast16_t irmp_tmp_address2
; // ir address
2056 static uint_fast16_t irmp_tmp_command2
; // ir command
2059 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2060 static uint_fast16_t irmp_lgair_address
; // ir address
2061 static uint_fast16_t irmp_lgair_command
; // ir command
2064 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2065 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2067 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2068 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2069 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2072 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2073 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2076 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2078 * @details store bit in temp address or temp command
2079 * @param value to store: 0 or 1
2080 *---------------------------------------------------------------------------------------------------------------------------------------------------
2082 // verhindert, dass irmp_store_bit() inline compiliert wird:
2083 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2086 irmp_store_bit (uint_fast8_t value
)
2088 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2089 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2098 else if (irmp_bit
== 14)
2100 if (value
) // value == 1: even parity
2104 parity
= PARITY_CHECK_FAILED
;
2108 parity
= PARITY_CHECK_OK
;
2113 if (parity
& 0x01) // value == 0: odd parity
2115 parity
= PARITY_CHECK_OK
;
2119 parity
= PARITY_CHECK_FAILED
;
2126 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2127 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2134 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2136 if (irmp_param
.lsb_first
)
2138 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2142 irmp_tmp_address
<<= 1;
2143 irmp_tmp_address
|= value
;
2146 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2148 if (irmp_param
.lsb_first
)
2150 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2151 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2153 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2158 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2163 irmp_tmp_command
<<= 1;
2164 irmp_tmp_command
|= value
;
2168 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2169 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2173 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2174 irmp_lgair_address
|= value
;
2176 else if (irmp_bit
< 24)
2178 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2179 irmp_lgair_command
|= value
;
2185 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2186 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2188 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2193 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2194 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2196 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2201 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2202 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2204 if (irmp_bit
>= 20 && irmp_bit
< 24)
2206 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2208 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2210 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2213 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2217 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2221 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2234 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2236 * @details store bit in temp address or temp command
2237 * @param value to store: 0 or 1
2238 *---------------------------------------------------------------------------------------------------------------------------------------------------
2240 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2242 irmp_store_bit2 (uint_fast8_t value
)
2244 uint_fast8_t irmp_bit2
;
2246 if (irmp_param
.protocol
)
2248 irmp_bit2
= irmp_bit
- 2;
2252 irmp_bit2
= irmp_bit
- 1;
2255 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2257 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2259 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2261 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2264 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2266 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2268 * @details ISR routine, called 10000 times per second
2269 *---------------------------------------------------------------------------------------------------------------------------------------------------
2274 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2275 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2276 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2277 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2278 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2279 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2280 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2281 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2282 static uint_fast8_t repetition_frame_number
;
2283 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2284 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2285 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2287 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2288 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2290 #if IRMP_SUPPORT_MANCHESTER == 1
2291 static PAUSE_LEN last_pause
; // last pause value
2293 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2294 static uint_fast8_t last_value
; // last bit value
2296 uint_fast8_t irmp_input
; // input value
2302 irmp_input
= input(IRMP_PIN
);
2304 #if IRMP_USE_CALLBACK == 1
2305 if (irmp_callback_ptr
)
2307 static uint_fast8_t last_inverted_input
;
2309 if (last_inverted_input
!= !irmp_input
)
2311 (*irmp_callback_ptr
) (! irmp_input
);
2312 last_inverted_input
= !irmp_input
;
2315 #endif // IRMP_USE_CALLBACK == 1
2317 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2319 if (! irmp_ir_detected
) // ir code already detected?
2321 if (! irmp_start_bit_detected
) // start bit detected?
2323 if (! irmp_input
) // receiving burst?
2325 // irmp_busy_flag = TRUE;
2327 if (! irmp_pulse_time
)
2329 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2332 irmp_pulse_time
++; // increment counter
2336 if (irmp_pulse_time
) // it's dark....
2337 { // set flags for counting the time of darkness...
2338 irmp_start_bit_detected
= 1;
2339 wait_for_start_space
= 1;
2341 irmp_tmp_command
= 0;
2342 irmp_tmp_address
= 0;
2343 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2346 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2350 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2351 irmp_tmp_command2
= 0;
2352 irmp_tmp_address2
= 0;
2354 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2355 irmp_lgair_command
= 0;
2356 irmp_lgair_address
= 0;
2359 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2360 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2361 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2366 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2368 key_repetition_len
++;
2370 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2371 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2373 denon_repetition_len
++;
2375 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2378 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2379 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2381 last_irmp_denon_command
= 0;
2382 denon_repetition_len
= 0xFFFF;
2385 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2392 if (wait_for_start_space
) // we have received start bit...
2393 { // ...and are counting the time of darkness
2394 if (irmp_input
) // still dark?
2396 irmp_pause_time
++; // increment counter
2398 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2399 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
) ||
2400 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2402 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2405 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2406 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2411 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2414 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
);
2415 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2419 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2420 irmp_pulse_time
= 0;
2421 irmp_pause_time
= 0;
2425 { // receiving first data pulse!
2426 IRMP_PARAMETER
* irmp_param_p
;
2427 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2429 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2430 irmp_param2
.protocol
= 0;
2434 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2437 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2438 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2439 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2442 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2443 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2444 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2446 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2449 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2451 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2452 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2453 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2454 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2457 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2458 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2459 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2461 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2464 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2466 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2467 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2468 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2470 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2472 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2473 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2474 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2476 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2479 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2480 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2481 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2483 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2486 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2487 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2489 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2490 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2491 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2493 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2494 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2495 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2497 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2500 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2503 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2504 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2505 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2508 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2513 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2514 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2515 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2516 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2517 { // it's JVC repetition type 3
2519 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2520 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2521 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2523 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2526 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2528 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2530 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2531 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2532 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2535 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2536 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2537 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2539 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2542 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2544 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2545 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2546 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2549 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2550 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2551 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2553 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2556 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2558 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2559 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
2560 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
2563 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2564 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
2565 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
2567 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
2570 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2572 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2573 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2574 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2577 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2578 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2579 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2581 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2584 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2586 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2587 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2588 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2591 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2592 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2593 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2595 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2598 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2600 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2601 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2602 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2603 { // it's MATSUSHITA
2605 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2606 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2607 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2609 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2612 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2614 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2615 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2616 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2619 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2620 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2621 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2623 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2626 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2628 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2629 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2630 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2633 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2634 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2635 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2637 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2640 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2642 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2643 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2644 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2647 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2648 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2649 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2651 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2654 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2656 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2657 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
2658 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
2659 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
2660 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
2662 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2663 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2664 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2667 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
2668 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2669 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2670 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2671 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2672 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2673 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2675 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
2678 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2680 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2681 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2682 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2685 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
2686 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2687 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2688 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2689 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2690 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2691 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2693 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
2696 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2699 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2700 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2701 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
2702 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2703 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
2707 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
2708 last_pause
= irmp_pause_time
;
2710 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
2711 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
2714 rc5_cmd_bit6
= 1<<6;
2722 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
2724 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2725 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
2726 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
2727 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
2730 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2731 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
2732 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
2733 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
2735 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
2738 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2740 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2741 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
2742 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
2743 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
2746 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2747 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
2748 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
2749 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
2751 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
2754 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2756 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2757 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
2758 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
2761 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2762 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
2763 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
2765 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
2768 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
2770 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2771 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
2772 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
2775 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2776 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
2777 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
2779 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
2784 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2786 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2787 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
2788 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
2791 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2792 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
2793 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
2795 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
2798 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2800 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2801 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
2802 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
2805 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2806 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
2807 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
2809 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
2812 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2814 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2815 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
2816 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
2819 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2820 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
2821 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
2823 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
2826 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2828 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2829 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
2830 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
2831 { // it's BANG_OLUFSEN
2833 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
2834 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2835 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
2836 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
2837 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2838 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
2839 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
2840 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2841 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
2842 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
2843 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2844 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
2845 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
2847 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
2851 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2853 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2854 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
2855 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
2858 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2859 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
2860 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
2862 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
2863 last_pause
= irmp_pause_time
;
2867 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2869 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2870 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
2871 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
2872 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
2873 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
2874 { // it's RUWIDO or SIEMENS
2876 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2877 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2878 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2879 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
2880 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
2882 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
2883 last_pause
= irmp_pause_time
;
2887 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2889 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2890 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2891 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2894 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2895 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2896 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2898 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
2901 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2903 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2904 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2905 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2908 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2909 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2910 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2912 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
2915 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2917 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2918 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
2919 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
2922 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2923 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
2924 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
2926 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
2929 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2931 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2932 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
2933 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
2936 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2937 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
2938 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
2940 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
2943 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2945 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2946 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
2947 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
2950 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2951 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
2952 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
2954 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
2957 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
2959 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2960 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
2961 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
2964 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2965 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
2966 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
2968 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
2973 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2975 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2976 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
2977 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
2978 { // it's ORTEK (Hama)
2980 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2981 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
2982 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
2984 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
2990 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2992 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
2993 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
2994 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
2997 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2998 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
2999 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3001 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3004 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3007 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3009 irmp_start_bit_detected
= 0; // wait for another start bit...
3012 if (irmp_start_bit_detected
)
3014 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3016 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3019 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3020 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3026 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3027 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3028 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3029 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3033 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3034 if (irmp_param2
.protocol
)
3037 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3038 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3039 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3040 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3046 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3047 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3050 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3055 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3058 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3059 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3065 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3066 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3067 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3068 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3073 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3074 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3076 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3077 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3081 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3082 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3083 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3084 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3090 #if IRMP_SUPPORT_MANCHESTER == 1
3091 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3092 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3093 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3095 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3098 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3099 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3102 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3104 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3107 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3108 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3111 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3115 #endif // IRMP_SUPPORT_MANCHESTER == 1
3117 #if IRMP_SUPPORT_SERIAL == 1
3118 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3123 #endif // IRMP_SUPPORT_SERIAL == 1
3126 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3127 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3130 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3133 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3134 { // pause timings correct for "1"?
3136 ANALYZE_PUTCHAR ('1'); // yes, store 1
3141 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3142 { // pause timings correct for "0"?
3144 ANALYZE_PUTCHAR ('0'); // yes, store 0
3151 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3152 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3153 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3156 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3159 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3160 { // pause timings correct for "1"?
3162 ANALYZE_PUTCHAR ('1'); // yes, store 1
3167 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3168 { // pause timings correct for "0"?
3170 ANALYZE_PUTCHAR ('0'); // yes, store 0
3177 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3179 ; // else do nothing
3182 irmp_pulse_time
= 1; // set counter to 1, not 0
3183 irmp_pause_time
= 0;
3184 wait_for_start_space
= 0;
3187 else if (wait_for_space
) // the data section....
3188 { // counting the time of darkness....
3189 uint_fast8_t got_light
= FALSE
;
3191 if (irmp_input
) // still dark?
3193 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3196 #if IRMP_SUPPORT_MANCHESTER == 1
3197 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3199 #if IRMP_SUPPORT_SERIAL == 1
3200 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3202 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3205 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3207 ANALYZE_PRINTF ("stop bit detected\n");
3210 irmp_param
.stop_bit
= 0;
3215 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",
3216 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3218 irmp_start_bit_detected
= 0; // wait for another start bit...
3219 irmp_pulse_time
= 0;
3220 irmp_pause_time
= 0;
3225 irmp_pause_time
++; // increment counter
3227 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3228 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3229 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3230 irmp_bit
>= 12 - 1) // pause too long?
3231 { // yes, break and close this frame
3232 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3233 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3234 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3235 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3236 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3240 #if IRMP_SUPPORT_SERIAL == 1
3241 // NETBOX generates no stop bit, here is the timeout condition:
3242 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3243 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3245 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3249 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3250 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3252 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3255 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3257 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3258 irmp_param
.stop_bit
= TRUE
; // set flag
3260 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3261 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3262 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3263 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3264 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3265 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3267 irmp_tmp_command
<<= 1;
3268 irmp_tmp_command
|= first_bit
;
3270 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3271 { // special manchester decoder
3272 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3273 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3274 irmp_param
.stop_bit
= TRUE
; // set flag
3276 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3279 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");
3281 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3282 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3283 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3284 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3285 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3287 if (irmp_tmp_command
& 0x300)
3289 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3290 irmp_tmp_command
&= 0xFF;
3296 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3297 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3299 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3300 { // special manchester decoder
3301 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3302 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3303 irmp_param
.stop_bit
= TRUE
; // set flag
3305 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3308 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3310 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3311 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3312 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3313 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3314 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3317 // RUWIDO: AAAAAAAAACCCCCCCp
3318 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3319 irmp_tmp_address
<<= 2;
3320 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3321 irmp_tmp_command
&= 0x003F;
3322 // irmp_tmp_command <<= 4;
3323 irmp_tmp_command
|= last_value
;
3328 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3329 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3330 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3331 { // break and close this frame
3332 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3334 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3336 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3338 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3341 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3345 #if IRMP_SUPPORT_MANCHESTER == 1
3346 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3347 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3348 { // special manchester decoder
3349 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3350 irmp_param
.stop_bit
= TRUE
; // set flag
3353 #endif // IRMP_SUPPORT_MANCHESTER == 1
3354 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3356 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3360 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3361 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3364 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3366 irmp_param
.stop_bit
= TRUE
; // set flag
3367 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3368 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3369 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3370 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3371 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3373 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3374 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3375 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3378 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3380 irmp_param
.stop_bit
= TRUE
; // set flag
3381 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3382 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3383 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3384 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3385 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3387 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3389 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3390 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3391 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3394 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3396 irmp_param
.stop_bit
= TRUE
; // set flag
3397 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3398 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3400 // 0123456789ABC0123456789ABC0123456701234567
3401 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3402 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3403 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3404 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3406 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3407 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3408 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3411 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3413 irmp_param
.stop_bit
= TRUE
; // set flag
3414 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3415 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3416 irmp_tmp_address
= irmp_lgair_address
;
3417 irmp_tmp_command
= irmp_lgair_command
;
3419 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3420 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3421 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3424 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3426 irmp_param
.stop_bit
= TRUE
; // set flag
3427 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3428 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3430 // 0123456789ABC0123456789ABC0123456701234567
3431 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3432 // JVC: AAAACCCCCCCCCCCC
3433 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3434 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3436 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3437 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3439 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3440 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3443 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3445 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3446 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3447 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3448 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3450 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3452 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3453 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3457 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3458 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3461 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3463 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3465 else // if ((irmp_bit == 24)
3468 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3470 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3472 irmp_param
.stop_bit
= TRUE
; // set flag
3473 irmp_param
.complete_len
= irmp_bit
; // patch length
3475 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3479 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3480 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3482 irmp_start_bit_detected
= 0; // wait for another start bit...
3483 irmp_pulse_time
= 0;
3484 irmp_pause_time
= 0;
3497 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3500 #if IRMP_SUPPORT_MANCHESTER == 1
3501 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3504 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3505 #else // better, but some IR-RCs use asymmetric timings :-/
3506 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3507 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3510 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3511 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3514 ANALYZE_PUTCHAR ('T');
3516 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3531 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3534 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3536 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
3538 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3539 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3542 ANALYZE_PUTCHAR ('T');
3546 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
3559 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3562 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3564 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
3565 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3566 if (! irmp_param2
.protocol
)
3573 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
3577 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
3578 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
3580 uint_fast8_t manchester_value
;
3582 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
3584 manchester_value
= last_value
? 0 : 1;
3585 last_value
= manchester_value
;
3589 manchester_value
= last_value
;
3593 ANALYZE_PUTCHAR (manchester_value
+ '0');
3596 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3597 if (! irmp_param2
.protocol
)
3605 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3606 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
3609 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
3611 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
3612 irmp_param
.address_offset
= 5;
3613 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
3614 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
3615 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
3616 irmp_tmp_address
= 0;
3618 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3620 irmp_store_bit (manchester_value
);
3624 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3625 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
3626 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
3627 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
3628 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
3631 ANALYZE_PUTCHAR ('?');
3633 irmp_param
.protocol
= 0; // switch to FDC, see below
3636 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3637 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3638 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
3639 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
3640 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
3641 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
3644 ANALYZE_PUTCHAR ('?');
3646 irmp_param
.protocol
= 0; // switch to RCCAR, see below
3649 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3652 ANALYZE_PUTCHAR ('?');
3654 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3655 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3657 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3658 irmp_pause_time
= 0;
3662 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3663 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
3665 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
3668 ANALYZE_PRINTF (" 1 (FDC)\n");
3670 irmp_store_bit2 (1);
3672 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
3675 ANALYZE_PRINTF (" 0 (FDC)\n");
3677 irmp_store_bit2 (0);
3680 if (! irmp_param
.protocol
)
3683 ANALYZE_PRINTF ("Switching to FDC protocol\n");
3685 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3686 irmp_param2
.protocol
= 0;
3687 irmp_tmp_address
= irmp_tmp_address2
;
3688 irmp_tmp_command
= irmp_tmp_command2
;
3691 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3692 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3693 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
3695 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
3698 ANALYZE_PRINTF (" 1 (RCCAR)\n");
3700 irmp_store_bit2 (1);
3702 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
3705 ANALYZE_PRINTF (" 0 (RCCAR)\n");
3707 irmp_store_bit2 (0);
3710 if (! irmp_param
.protocol
)
3713 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
3715 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3716 irmp_param2
.protocol
= 0;
3717 irmp_tmp_address
= irmp_tmp_address2
;
3718 irmp_tmp_command
= irmp_tmp_command2
;
3721 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3723 last_pause
= irmp_pause_time
;
3727 #endif // IRMP_SUPPORT_MANCHESTER == 1
3729 #if IRMP_SUPPORT_SERIAL == 1
3730 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3732 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
3735 ANALYZE_PUTCHAR ('1');
3739 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
3741 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
3745 irmp_pulse_time
= 0;
3749 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
3752 ANALYZE_PUTCHAR ('0');
3756 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
3758 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
3762 irmp_pause_time
= 0;
3771 #endif // IRMP_SUPPORT_SERIAL == 1
3773 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3774 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
3776 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
3777 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3780 ANALYZE_PRINTF ("SYNC\n");
3785 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
3787 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3789 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
3791 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
3792 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
3793 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
3794 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
3797 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
3799 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3800 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3801 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3802 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3804 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
3807 ANALYZE_PUTCHAR ('1');
3816 ANALYZE_PUTCHAR ('0');
3824 { // timing incorrect!
3826 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3827 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3829 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3830 irmp_pause_time
= 0;
3834 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
3836 #if IRMP_SUPPORT_NEC16_PROTOCOL
3837 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3838 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
3839 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
3840 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
3841 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3842 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
3845 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
3847 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
3848 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
3849 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
3850 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
3851 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
3852 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
3856 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
3858 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3859 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3861 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
3863 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
3865 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
3868 ANALYZE_PRINTF ("3rd start bit\n");
3874 { // timing incorrect!
3876 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
);
3877 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3879 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3880 irmp_pause_time
= 0;
3883 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
3885 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
3888 ANALYZE_PRINTF ("trailer bit\n");
3894 { // timing incorrect!
3896 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
);
3897 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3899 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3900 irmp_pause_time
= 0;
3905 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
3906 { // pulse & pause timings correct for "1"?
3908 ANALYZE_PUTCHAR ('1');
3915 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
3916 { // pulse & pause timings correct for "0"?
3918 ANALYZE_PUTCHAR ('0');
3925 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
3928 ANALYZE_PUTCHAR (last_value
+ '0');
3931 irmp_store_bit (last_value
);
3935 { // timing incorrect!
3937 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
);
3938 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3940 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3941 irmp_pause_time
= 0;
3946 { // timing incorrect!
3948 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
);
3949 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3951 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3952 irmp_pause_time
= 0;
3956 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
3958 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3959 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
3961 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
3964 ANALYZE_PUTCHAR ('0');
3965 ANALYZE_PUTCHAR ('0');
3970 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
3973 ANALYZE_PUTCHAR ('0');
3974 ANALYZE_PUTCHAR ('1');
3979 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
3982 ANALYZE_PUTCHAR ('1');
3983 ANALYZE_PUTCHAR ('0');
3988 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
3991 ANALYZE_PUTCHAR ('1');
3992 ANALYZE_PUTCHAR ('1');
3998 ANALYZE_PRINTF ("\n");
4005 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4006 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4007 { // pulse & pause timings correct for "1"?
4009 ANALYZE_PUTCHAR ('1');
4015 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4016 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4017 { // pulse & pause timings correct for "0"?
4019 ANALYZE_PUTCHAR ('0');
4026 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4028 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4029 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4030 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4031 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4033 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4040 ANALYZE_PUTCHAR ('S');
4043 irmp_tmp_command
<<= 1;
4048 ANALYZE_PUTCHAR ('S');
4056 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4057 { // timing incorrect!
4059 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4060 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4062 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4063 irmp_pause_time
= 0;
4066 irmp_pulse_time
= 1; // set counter to 1, not 0
4070 { // counting the pulse length ...
4071 if (! irmp_input
) // still light?
4073 irmp_pulse_time
++; // increment counter
4077 wait_for_space
= 1; // let's count the time (see above)
4078 irmp_pause_time
= 1; // set pause counter to 1, not 0
4082 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4084 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4086 repetition_frame_number
++;
4090 repetition_frame_number
= 0;
4093 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4094 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4095 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4098 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4099 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4101 key_repetition_len
= 0;
4106 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4107 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4108 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4111 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4112 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4114 key_repetition_len
= 0;
4119 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4120 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4121 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4124 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4125 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4127 key_repetition_len
= 0;
4132 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4133 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4134 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4137 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4138 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4140 key_repetition_len
= 0;
4145 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4146 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4147 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4150 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4151 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4153 key_repetition_len
= 0;
4158 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4159 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4160 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4163 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4164 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4166 key_repetition_len
= 0;
4173 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4175 irmp_ir_detected
= TRUE
;
4177 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4178 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4179 { // check for repetition frame
4180 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4182 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4183 last_irmp_denon_command
= 0;
4185 irmp_protocol
= irmp_param
.protocol
; // store protocol
4186 irmp_address
= irmp_tmp_address
; // store address
4187 irmp_command
= irmp_tmp_command
; // store command
4191 if ((irmp_tmp_command
& 0x01) == 0x00)
4194 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4196 last_irmp_denon_command
= irmp_tmp_command
;
4197 denon_repetition_len
= 0;
4198 irmp_ir_detected
= FALSE
;
4203 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4205 last_irmp_denon_command
= 0;
4206 irmp_ir_detected
= FALSE
;
4211 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4213 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4214 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4215 { // Grundig start frame?
4217 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4219 irmp_ir_detected
= FALSE
;
4222 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4224 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4225 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4226 { // Nokia start frame?
4228 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4230 irmp_ir_detected
= FALSE
;
4233 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4235 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4236 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4238 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4241 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4242 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4244 irmp_tmp_address
= last_irmp_address
; // address is last address
4245 irmp_tmp_command
= last_irmp_command
; // command is last command
4246 irmp_flags
|= IRMP_FLAG_REPETITION
;
4247 key_repetition_len
= 0;
4252 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4253 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4255 irmp_ir_detected
= FALSE
;
4258 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4260 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4261 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4263 uint_fast8_t xor_value
;
4265 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4267 if (xor_value
!= (xor_check
[2] & 0x0F))
4270 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4272 irmp_ir_detected
= FALSE
;
4275 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4277 if (xor_value
!= xor_check
[5])
4280 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4282 irmp_ir_detected
= FALSE
;
4285 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4287 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4289 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4290 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4292 if (parity
== PARITY_CHECK_FAILED
)
4295 ANALYZE_PRINTF ("error 6: parity check failed\n");
4297 irmp_ir_detected
= FALSE
;
4300 if ((irmp_tmp_address
& 0x03) == 0x02)
4303 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4305 irmp_ir_detected
= FALSE
;
4307 irmp_tmp_address
>>= 2;
4309 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4311 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4312 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4314 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4317 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4319 irmp_protocol
= irmp_param
.protocol
;
4322 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4323 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4325 if (irmp_tmp_command
& 0x000F) // released key?
4327 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4331 irmp_tmp_command
>>= 4; // no, it's a pressed key
4333 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4334 irmp_tmp_address
&= 0x003F;
4338 irmp_address
= irmp_tmp_address
; // store address
4339 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4340 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4342 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4346 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4347 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4349 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4352 irmp_command
= irmp_tmp_command
; // store command
4354 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4355 irmp_id
= irmp_tmp_id
;
4360 if (irmp_ir_detected
)
4362 if (last_irmp_command
== irmp_tmp_command
&&
4363 last_irmp_address
== irmp_tmp_address
&&
4364 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4366 irmp_flags
|= IRMP_FLAG_REPETITION
;
4369 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4370 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4372 key_repetition_len
= 0;
4377 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4381 irmp_start_bit_detected
= 0; // and wait for next start bit
4382 irmp_tmp_command
= 0;
4383 irmp_pulse_time
= 0;
4384 irmp_pause_time
= 0;
4386 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4387 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4388 { // set pulse time here!
4389 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4391 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4396 #if defined(STELLARIS_ARM_CORTEX_M4)
4397 // Clear the timer interrupt
4398 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4401 return (irmp_ir_detected
);
4406 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4407 * main functions - for Unix/Linux + Windows only!
4411 * Compile it under linux with:
4414 * usage: ./irmp [-v|-s|-a|-l|-p] < file
4420 * -l list pulse/pauses
4422 *---------------------------------------------------------------------------------------------------------------------------------------------------
4426 print_timings (void)
4428 printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN
, sizeof (PAUSE_LEN
));
4429 printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN
);
4431 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");
4432 printf ("====================================================================================\n");
4433 printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4434 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
, SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
,
4435 SIRCS_0_PULSE_LEN_MIN
, SIRCS_0_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
,
4436 SIRCS_1_PULSE_LEN_MIN
, SIRCS_1_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
);
4438 printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4439 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
,
4440 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4441 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4443 printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4444 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
,
4445 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4446 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4448 printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4449 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
, SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
,
4450 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_0_PAUSE_LEN_MIN
, SAMSUNG_0_PAUSE_LEN_MAX
,
4451 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_1_PAUSE_LEN_MIN
, SAMSUNG_1_PAUSE_LEN_MAX
);
4453 printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4454 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
, MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
,
4455 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_0_PAUSE_LEN_MIN
, MATSUSHITA_0_PAUSE_LEN_MAX
,
4456 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_1_PAUSE_LEN_MIN
, MATSUSHITA_1_PAUSE_LEN_MAX
);
4458 printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4459 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
, KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
,
4460 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_0_PAUSE_LEN_MIN
, KASEIKYO_0_PAUSE_LEN_MAX
,
4461 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_1_PAUSE_LEN_MIN
, KASEIKYO_1_PAUSE_LEN_MAX
);
4463 printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4464 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
, RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
,
4465 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_0_PAUSE_LEN_MIN
, RECS80_0_PAUSE_LEN_MAX
,
4466 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_1_PAUSE_LEN_MIN
, RECS80_1_PAUSE_LEN_MAX
);
4468 printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",
4469 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
, RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
4470 RC5_BIT_LEN_MIN
, RC5_BIT_LEN_MAX
);
4472 printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4473 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
4474 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
,
4475 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
);
4477 printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4478 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
4479 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
,
4480 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
);
4482 printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4483 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
, RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
,
4484 RC6_BIT_PULSE_LEN_MIN
, RC6_BIT_PULSE_LEN_MAX
, RC6_BIT_PAUSE_LEN_MIN
, RC6_BIT_PAUSE_LEN_MAX
);
4486 printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4487 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
, RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
,
4488 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_0_PAUSE_LEN_MIN
, RECS80EXT_0_PAUSE_LEN_MAX
,
4489 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_1_PAUSE_LEN_MIN
, RECS80EXT_1_PAUSE_LEN_MAX
);
4491 printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4492 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
, NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
,
4493 NUBERT_0_PULSE_LEN_MIN
, NUBERT_0_PULSE_LEN_MAX
, NUBERT_0_PAUSE_LEN_MIN
, NUBERT_0_PAUSE_LEN_MAX
,
4494 NUBERT_1_PULSE_LEN_MIN
, NUBERT_1_PULSE_LEN_MAX
, NUBERT_1_PAUSE_LEN_MIN
, NUBERT_1_PAUSE_LEN_MAX
);
4496 printf ("SPEAKER 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4497 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
, SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
,
4498 SPEAKER_0_PULSE_LEN_MIN
, SPEAKER_0_PULSE_LEN_MAX
, SPEAKER_0_PAUSE_LEN_MIN
, SPEAKER_0_PAUSE_LEN_MAX
,
4499 SPEAKER_1_PULSE_LEN_MIN
, SPEAKER_1_PULSE_LEN_MAX
, SPEAKER_1_PAUSE_LEN_MIN
, SPEAKER_1_PAUSE_LEN_MAX
);
4501 printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",
4502 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
4503 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
4505 printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",
4506 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
4507 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
4509 printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",
4510 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
4511 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
4513 printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",
4514 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
4515 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
4517 printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4518 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_0_PAUSE_LEN_MIN
, BANG_OLUFSEN_0_PAUSE_LEN_MAX
,
4519 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_1_PAUSE_LEN_MIN
, BANG_OLUFSEN_1_PAUSE_LEN_MAX
);
4521 printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",
4522 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
4523 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
,
4524 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
);
4526 printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4527 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
4528 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
4529 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4530 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
,
4531 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4532 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
);
4534 printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4535 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
, FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
,
4536 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_0_PAUSE_LEN_MIN
, FDC_0_PAUSE_LEN_MAX
,
4537 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_1_PAUSE_LEN_MIN
, FDC_1_PAUSE_LEN_MAX
);
4539 printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4540 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
, RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
,
4541 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_0_PAUSE_LEN_MIN
, RCCAR_0_PAUSE_LEN_MAX
,
4542 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_1_PAUSE_LEN_MIN
, RCCAR_1_PAUSE_LEN_MAX
);
4544 printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4545 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
, NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
,
4546 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_0_PAUSE_LEN_MIN
, NIKON_0_PAUSE_LEN_MAX
,
4547 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_1_PAUSE_LEN_MIN
, NIKON_1_PAUSE_LEN_MAX
);
4549 printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4550 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
, LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
,
4551 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_0_PAUSE_LEN_MIN
, LEGO_0_PAUSE_LEN_MAX
,
4552 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_1_PAUSE_LEN_MIN
, LEGO_1_PAUSE_LEN_MAX
);
4555 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE PAUSE-00 PAUSE-01 PAUSE-10 PAUSE-11\n");
4556 printf ("================================================================================================\n");
4557 printf ("RCMM 1 %3d %3d %3d %3d %3d %3d %3d\n",
4558 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PULSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PAUSE_TIME
),
4559 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_PULSE_TIME
),
4560 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_00_PAUSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_01_PAUSE_TIME
),
4561 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_10_PAUSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_11_PAUSE_TIME
));
4562 printf ("RCMM 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4563 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
, RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
,
4564 RCMM32_BIT_PULSE_LEN_MIN
, RCMM32_BIT_PULSE_LEN_MAX
, RCMM32_BIT_00_PAUSE_LEN_MIN
, RCMM32_BIT_00_PAUSE_LEN_MAX
,
4565 RCMM32_BIT_01_PAUSE_LEN_MIN
, RCMM32_BIT_01_PAUSE_LEN_MAX
, RCMM32_BIT_10_PAUSE_LEN_MIN
, RCMM32_BIT_10_PAUSE_LEN_MAX
,
4566 RCMM32_BIT_11_PAUSE_LEN_MIN
, RCMM32_BIT_11_PAUSE_LEN_MAX
);
4570 print_spectrum (char * text
, int * buf
, int is_pulse
)
4583 puts ("-------------------------------------------------------------------------------");
4584 printf ("%s:\n", text
);
4586 for (i
= 0; i
< 256; i
++)
4588 if (buf
[i
] > max_value
)
4594 for (i
= 1; i
< 200; i
++)
4599 value
= (buf
[i
] * 60) / max_value
;
4601 for (j
= 0; j
< value
; j
++)
4605 printf (" %d\n", buf
[i
]);
4616 average
= (float) sum
/ (float) counter
;
4627 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4628 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4629 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4631 tolerance
= (max
- average
);
4633 if (average
- min
> tolerance
)
4635 tolerance
= average
- min
;
4638 tolerance
= tolerance
* 100 / average
;
4639 printf ("tol: %4.1f%%\n", tolerance
);
4649 #define STATE_LEFT_SHIFT 0x01
4650 #define STATE_RIGHT_SHIFT 0x02
4651 #define STATE_LEFT_CTRL 0x04
4652 #define STATE_LEFT_ALT 0x08
4653 #define STATE_RIGHT_ALT 0x10
4655 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4656 #define KEY_MENUE 0x80 // keycode = 0x0070
4657 #define KEY_BACK 0x81 // keycode = 0x0071
4658 #define KEY_FORWARD 0x82 // keycode = 0x0072
4659 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4660 #define KEY_WINDOW 0x84 // keycode = 0x0074
4661 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4662 #define KEY_STOP 0x86 // keycode = 0x0076
4663 #define KEY_MAIL 0x87 // keycode = 0x0077
4664 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4665 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4666 #define KEY_SETUP 0x8A // keycode = 0x007a
4667 #define KEY_FONT 0x8B // keycode = 0x007b
4668 #define KEY_PRINT 0x8C // keycode = 0x007c
4669 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4671 #define KEY_INSERT 0x90 // keycode = 0x004b
4672 #define KEY_DELETE 0x91 // keycode = 0x004c
4673 #define KEY_LEFT 0x92 // keycode = 0x004f
4674 #define KEY_HOME 0x93 // keycode = 0x0050
4675 #define KEY_END 0x94 // keycode = 0x0051
4676 #define KEY_UP 0x95 // keycode = 0x0053
4677 #define KEY_DOWN 0x96 // keycode = 0x0054
4678 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
4679 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
4680 #define KEY_RIGHT 0x99 // keycode = 0x0059
4681 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
4682 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
4685 get_fdc_key (uint_fast16_t cmd
)
4687 static uint8_t key_table
[128] =
4689 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
4690 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
4691 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
4692 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
4693 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
4695 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
4696 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
4697 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
4698 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
4700 static uint_fast8_t state
;
4702 uint_fast8_t key
= 0;
4706 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
4707 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
4708 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
4709 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
4710 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
4711 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
4712 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
4713 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
4714 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
4715 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
4717 case 0x006e: key
= KEY_ESCAPE
; break;
4718 case 0x004b: key
= KEY_INSERT
; break;
4719 case 0x004c: key
= KEY_DELETE
; break;
4720 case 0x004f: key
= KEY_LEFT
; break;
4721 case 0x0050: key
= KEY_HOME
; break;
4722 case 0x0051: key
= KEY_END
; break;
4723 case 0x0053: key
= KEY_UP
; break;
4724 case 0x0054: key
= KEY_DOWN
; break;
4725 case 0x0055: key
= KEY_PAGE_UP
; break;
4726 case 0x0056: key
= KEY_PAGE_DOWN
; break;
4727 case 0x0059: key
= KEY_RIGHT
; break;
4728 case 0x0400: key
= KEY_MOUSE_1
; break;
4729 case 0x0800: key
= KEY_MOUSE_2
; break;
4733 if (!(cmd
& 0x80)) // pressed key
4735 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
4737 key
= cmd
+ 0x10; // 7x -> 8x
4739 else if (cmd
< 64) // key listed in key_table
4741 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
4745 case 0x0003: key
= '²'; break;
4746 case 0x0008: key
= '{'; break;
4747 case 0x0009: key
= '['; break;
4748 case 0x000A: key
= ']'; break;
4749 case 0x000B: key
= '}'; break;
4750 case 0x000C: key
= '\\'; break;
4751 case 0x001C: key
= '~'; break;
4752 case 0x002D: key
= '|'; break;
4753 case 0x0034: key
= 0xB5; break; // Mu
4756 else if (state
& (STATE_LEFT_CTRL
))
4758 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
4760 key
= key_table
[cmd
] - 'a' + 1;
4764 key
= key_table
[cmd
];
4769 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
4773 key
= key_table
[idx
];
4785 static int analyze
= FALSE
;
4786 static int list
= FALSE
;
4787 static IRMP_DATA irmp_data
;
4788 static int expected_protocol
;
4789 static int expected_address
;
4790 static int expected_command
;
4791 static int do_check_expected_values
;
4796 if (! analyze
&& ! list
)
4800 if (irmp_get_data (&irmp_data
))
4804 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
4808 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4811 if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
4813 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
4815 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
4816 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
4818 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
4820 char * p
= (char *) NULL
;
4824 case '\t' : p
= "TAB"; break;
4825 case '\r' : p
= "CR"; break;
4826 case KEY_ESCAPE
: p
= "ESCAPE"; break;
4827 case KEY_MENUE
: p
= "MENUE"; break;
4828 case KEY_BACK
: p
= "BACK"; break;
4829 case KEY_FORWARD
: p
= "FORWARD"; break;
4830 case KEY_ADDRESS
: p
= "ADDRESS"; break;
4831 case KEY_WINDOW
: p
= "WINDOW"; break;
4832 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
4833 case KEY_STOP
: p
= "STOP"; break;
4834 case KEY_MAIL
: p
= "MAIL"; break;
4835 case KEY_FAVORITES
: p
= "FAVORITES"; break;
4836 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
4837 case KEY_SETUP
: p
= "SETUP"; break;
4838 case KEY_FONT
: p
= "FONT"; break;
4839 case KEY_PRINT
: p
= "PRINT"; break;
4840 case KEY_ON_OFF
: p
= "ON_OFF"; break;
4842 case KEY_INSERT
: p
= "INSERT"; break;
4843 case KEY_DELETE
: p
= "DELETE"; break;
4844 case KEY_LEFT
: p
= "LEFT"; break;
4845 case KEY_HOME
: p
= "HOME"; break;
4846 case KEY_END
: p
= "END"; break;
4847 case KEY_UP
: p
= "UP"; break;
4848 case KEY_DOWN
: p
= "DOWN"; break;
4849 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
4850 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
4851 case KEY_RIGHT
: p
= "RIGHT"; break;
4852 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
4853 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
4854 default : p
= "<UNKNWON>"; break;
4857 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
4858 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
4862 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
4863 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
4868 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
4869 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
4872 if (do_check_expected_values
)
4874 if (irmp_data
.protocol
!= expected_protocol
||
4875 irmp_data
.address
!= expected_address
||
4876 irmp_data
.command
!= expected_command
)
4878 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
4879 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
4883 printf (" checked!\n");
4885 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
4896 main (int argc
, char ** argv
)
4904 int start_pulses
[256];
4905 int start_pauses
[256];
4909 int first_pulse
= TRUE
;
4910 int first_pause
= TRUE
;
4914 if (! strcmp (argv
[1], "-v"))
4918 else if (! strcmp (argv
[1], "-l"))
4922 else if (! strcmp (argv
[1], "-a"))
4926 else if (! strcmp (argv
[1], "-s"))
4930 else if (! strcmp (argv
[1], "-p"))
4935 else if (! strcmp (argv
[1], "-r"))
4941 for (i
= 0; i
< 256; i
++)
4943 start_pulses
[i
] = 0;
4944 start_pauses
[i
] = 0;
4951 while ((ch
= getchar ()) != EOF
)
4953 if (ch
== '_' || ch
== '0')
4961 printf ("pause: %d\n", pause
);
4970 start_pauses
[pause
]++;
4972 first_pause
= FALSE
;
4988 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
4994 printf ("pulse: %d ", pulse
);
5003 start_pulses
[pulse
]++;
5005 first_pulse
= FALSE
;
5021 else if (ch
== '\n')
5026 if (list
&& pause
> 0)
5028 printf ("pause: %d\n", pause
);
5034 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5048 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5059 puts ("-------------------------------------------------------------------");
5063 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5065 if (ch
!= '\r') // ignore CR in DOS/Windows files
5067 if (ch
== '[' && idx
== -1)
5075 do_check_expected_values
= FALSE
;
5079 expected_protocol
= atoi (buf
);
5081 if (expected_protocol
> 0)
5090 if (sscanf (p
, "%x", &expected_address
) == 1)
5092 do_check_expected_values
= TRUE
;
5099 if (do_check_expected_values
)
5101 do_check_expected_values
= FALSE
;
5109 if (sscanf (p
, "%x", &expected_command
) == 1)
5111 do_check_expected_values
= TRUE
;
5118 if (do_check_expected_values
)
5120 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5125 else if (idx
< 1024 - 2)
5145 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5146 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5147 print_spectrum ("PULSES", pulses
, TRUE
);
5148 print_spectrum ("PAUSES", pauses
, FALSE
);
5149 puts ("-------------------------------------------------------------------------------");