1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.159 2014/07/09 15:31:25 fm Exp $
10 * Supported mikrocontrollers:
15 * ATmega8, ATmega16, ATmega32
17 * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
18 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
24 *---------------------------------------------------------------------------------------------------------------------------------------------------
29 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
30 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
32 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
35 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
36 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
38 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
41 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
42 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
43 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
44 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
45 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
46 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
47 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
48 # define IRMP_SUPPORT_MANCHESTER 1
50 # define IRMP_SUPPORT_MANCHESTER 0
53 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
54 # define IRMP_SUPPORT_SERIAL 1
56 # define IRMP_SUPPORT_SERIAL 0
59 #define IRMP_KEY_REPETITION_LEN (uint16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
61 #define MIN_TOLERANCE_00 1.0 // -0%
62 #define MAX_TOLERANCE_00 1.0 // +0%
64 #define MIN_TOLERANCE_05 0.95 // -5%
65 #define MAX_TOLERANCE_05 1.05 // +5%
67 #define MIN_TOLERANCE_10 0.9 // -10%
68 #define MAX_TOLERANCE_10 1.1 // +10%
70 #define MIN_TOLERANCE_15 0.85 // -15%
71 #define MAX_TOLERANCE_15 1.15 // +15%
73 #define MIN_TOLERANCE_20 0.8 // -20%
74 #define MAX_TOLERANCE_20 1.2 // +20%
76 #define MIN_TOLERANCE_30 0.7 // -30%
77 #define MAX_TOLERANCE_30 1.3 // +30%
79 #define MIN_TOLERANCE_40 0.6 // -40%
80 #define MAX_TOLERANCE_40 1.4 // +40%
82 #define MIN_TOLERANCE_50 0.5 // -50%
83 #define MAX_TOLERANCE_50 1.5 // +50%
85 #define MIN_TOLERANCE_60 0.4 // -60%
86 #define MAX_TOLERANCE_60 1.6 // +60%
88 #define MIN_TOLERANCE_70 0.3 // -70%
89 #define MAX_TOLERANCE_70 1.7 // +70%
91 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
92 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
93 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
94 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
95 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
96 #else // only 5% + 1 to avoid conflict with RC6:
97 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
99 #define SIRCS_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
100 #define SIRCS_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
101 #define SIRCS_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
102 #define SIRCS_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
103 #define SIRCS_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
104 #define SIRCS_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
106 #define NEC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
107 #define NEC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
108 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
109 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
110 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
111 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
112 #define NEC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 #define NEC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
117 #define NEC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
118 // autodetect nec repetition frame within 50 msec:
119 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
121 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
123 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
126 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
127 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
128 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
129 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
130 #define SAMSUNG_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
131 #define SAMSUNG_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
132 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
133 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
134 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
135 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
137 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
138 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
139 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
140 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
141 #define MATSUSHITA_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
142 #define MATSUSHITA_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
143 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
144 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
145 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
146 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
148 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
149 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
150 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
151 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
152 #define KASEIKYO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
153 #define KASEIKYO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
154 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
155 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
156 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
157 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
159 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
160 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
161 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
162 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
163 #define RECS80_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
164 #define RECS80_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
165 #define RECS80_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define RECS80_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
167 #define RECS80_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
168 #define RECS80_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
171 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
172 #define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
173 #define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
175 #define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
176 #define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
179 #define RC5_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
180 #define RC5_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
182 #define DENON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
183 #define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
184 #define DENON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
185 #define DENON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
186 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
187 #define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
188 #define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
189 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define THOMSON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
192 #define THOMSON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
193 #define THOMSON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define THOMSON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
195 #define THOMSON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
196 #define THOMSON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
198 #define RC6_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define RC6_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
201 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define RC6_TOGGLE_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
203 #define RC6_TOGGLE_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
204 #define RC6_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
205 #define RC6_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
206 #define RC6_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
207 #define RC6_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
209 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
210 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
211 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
212 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
213 #define RECS80EXT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
214 #define RECS80EXT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
215 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
217 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
218 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
220 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
221 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
222 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
223 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
224 #define NUBERT_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
225 #define NUBERT_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
226 #define NUBERT_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
227 #define NUBERT_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
228 #define NUBERT_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
229 #define NUBERT_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
230 #define NUBERT_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
231 #define NUBERT_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
233 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
234 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
235 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
236 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
237 #define SPEAKER_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
238 #define SPEAKER_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
239 #define SPEAKER_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
240 #define SPEAKER_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
241 #define SPEAKER_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
242 #define SPEAKER_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
243 #define SPEAKER_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
244 #define SPEAKER_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
246 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
247 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
248 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
249 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
250 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
251 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
252 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
253 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
254 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
255 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
256 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
257 #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
258 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
259 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
260 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
261 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
262 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
263 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
264 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
265 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
266 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
267 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
268 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
269 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
270 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
271 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
273 #define IR60_TIMEOUT_LEN ((uint8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
274 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
275 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
276 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
277 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
278 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
279 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
281 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
282 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
283 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
284 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
285 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
286 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
287 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
288 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
290 #define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
291 #define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
292 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
293 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
294 #define FDC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
295 #define FDC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
296 #define FDC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
297 #define FDC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
299 #define FDC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255
301 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
303 #define FDC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
305 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
306 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
307 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
308 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
309 #define RCCAR_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
310 #define RCCAR_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
311 #define RCCAR_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
312 #define RCCAR_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
313 #define RCCAR_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
314 #define RCCAR_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
316 #define JVC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
317 #define JVC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
318 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!
319 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!
320 #define JVC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
321 #define JVC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
322 #define JVC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
323 #define JVC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
324 #define JVC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
325 #define JVC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
326 // autodetect JVC repetition frame within 50 msec:
327 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
329 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
330 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
331 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
332 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
333 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
334 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
335 #define NIKON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
336 #define NIKON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
337 #define NIKON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
338 #define NIKON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
339 #define NIKON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
340 #define NIKON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
341 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
343 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
344 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
345 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
346 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
347 #define KATHREIN_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
348 #define KATHREIN_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
349 #define KATHREIN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
350 #define KATHREIN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
351 #define KATHREIN_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
352 #define KATHREIN_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
353 #define KATHREIN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
354 #define KATHREIN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
355 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
356 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
358 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
359 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
360 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
361 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
362 #define NETBOX_PULSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
363 #define NETBOX_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
364 #define NETBOX_PULSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
365 #define NETBOX_PAUSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
367 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
368 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
369 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
370 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
371 #define LEGO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
372 #define LEGO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
373 #define LEGO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
374 #define LEGO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
375 #define LEGO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
376 #define LEGO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
378 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
379 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
380 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
381 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
382 #define BOSE_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
383 #define BOSE_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
384 #define BOSE_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
385 #define BOSE_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
386 #define BOSE_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
387 #define BOSE_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
388 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
390 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
391 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
392 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
393 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
394 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
395 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
396 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
397 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
399 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
400 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
401 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
402 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
403 #define ORTEK_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
404 #define ORTEK_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
405 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
406 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
408 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
409 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
410 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
411 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
412 #define TELEFUNKEN_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
413 #define TELEFUNKEN_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
414 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
415 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
416 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
417 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
418 // autodetect TELEFUNKEN repetition frame within 50 msec:
419 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
421 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
422 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
423 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
424 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
425 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
426 #define ROOMBA_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
427 #define ROOMBA_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
428 #define ROOMBA_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
429 #define ROOMBA_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
430 #define ROOMBA_0_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
431 #define ROOMBA_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
432 #define ROOMBA_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
433 #define ROOMBA_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
434 #define ROOMBA_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
436 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
437 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
438 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
439 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
440 #define RCMM32_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
441 #define RCMM32_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
442 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
443 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
444 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
445 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
446 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
447 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
448 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
449 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
451 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
452 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
453 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
454 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
455 #define RADIO1_1_PAUSE_LEN_EXACT ((uint8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
456 #define RADIO1_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
457 #define RADIO1_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
458 #define RADIO1_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
459 #define RADIO1_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
460 #define RADIO1_0_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
461 #define RADIO1_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
462 #define RADIO1_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
463 #define RADIO1_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
464 #define RADIO1_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
466 #define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t!
469 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
470 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
471 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
472 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
473 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
475 static int time_counter
;
478 /******************************* not every PIC compiler knows variadic macros :-(
480 # define ANALYZE_PUTCHAR(a)
481 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
482 # define ANALYZE_PRINTF(...)
483 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
485 # define ANALYZE_NEWLINE()
486 *********************************/
489 #if IRMP_USE_CALLBACK == 1
490 static void (*irmp_callback_ptr
) (uint8_t);
491 #endif // IRMP_USE_CALLBACK == 1
493 #define PARITY_CHECK_OK 1
494 #define PARITY_CHECK_FAILED 0
496 /*---------------------------------------------------------------------------------------------------------------------------------------------------
498 *---------------------------------------------------------------------------------------------------------------------------------------------------
500 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
502 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] =
551 /*---------------------------------------------------------------------------------------------------------------------------------------------------
553 *---------------------------------------------------------------------------------------------------------------------------------------------------
555 #if IRMP_LOGGING == 1 // logging via UART
557 #if defined(ARM_STM32F4XX)
558 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // per UART2 an PA2
559 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
560 # define STM32_GPIO_PORT GPIOA
561 # define STM32_GPIO_PIN GPIO_Pin_2
562 # define STM32_GPIO_SOURCE GPIO_PinSource2
563 # define STM32_UART_AF GPIO_AF_USART2
564 # define STM32_UART_COM USART2
565 # define STM32_UART_BAUD 115200 // mit 115200 Baud
566 # include "stm32f4xx_usart.h"
568 # if IRMP_EXT_LOGGING == 1 // use external logging
569 # include "irmpextlog.h"
570 # else // normal UART log (IRMP_EXT_LOGGING == 0)
572 # ifndef UNIX_OR_WINDOWS
573 # include <util/setbaud.h>
578 #define UART0_UBRRH UBRR0H
579 #define UART0_UBRRL UBRR0L
580 #define UART0_UCSRA UCSR0A
581 #define UART0_UCSRB UCSR0B
582 #define UART0_UCSRC UCSR0C
583 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
584 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
585 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
587 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
589 #define UART0_URSEL_BIT_VALUE (0)
591 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
592 #define UART0_UDR UDR0
593 #define UART0_U2X U2X0
597 #define UART0_UBRRH UBRRH
598 #define UART0_UBRRL UBRRL
599 #define UART0_UCSRA UCSRA
600 #define UART0_UCSRB UCSRB
601 #define UART0_UCSRC UCSRC
602 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
603 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
604 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
606 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
608 #define UART0_URSEL_BIT_VALUE (0)
610 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
611 #define UART0_UDR UDR
612 #define UART0_U2X U2X
615 #endif //IRMP_EXT_LOGGING
616 #endif //ARM_STM32F4XX
618 /*---------------------------------------------------------------------------------------------------------------------------------------------------
620 * @details Initializes UART
621 *---------------------------------------------------------------------------------------------------------------------------------------------------
624 irmp_uart_init (void)
626 #ifndef UNIX_OR_WINDOWS
627 #if defined(ARM_STM32F4XX)
628 GPIO_InitTypeDef GPIO_InitStructure
;
629 USART_InitTypeDef USART_InitStructure
;
631 // Clock enable vom TX Pin
632 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
634 // Clock enable der UART
635 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
637 // UART Alternative-Funktion mit dem IO-Pin verbinden
638 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
640 // UART als Alternative-Funktion mit PushPull
641 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
642 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
643 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
644 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
647 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
648 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
651 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
653 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
654 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
655 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
656 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
657 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
658 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
659 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
660 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
663 USART_Cmd(STM32_UART_COM
, ENABLE
);
666 #if (IRMP_EXT_LOGGING == 0) // use UART
667 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
668 UART0_UBRRL
= UBRRL_VALUE
;
671 UART0_UCSRA
|= (1<<UART0_U2X
);
673 UART0_UCSRA
&= ~(1<<UART0_U2X
);
676 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
677 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
678 #else // other log method
680 #endif //IRMP_EXT_LOGGING
681 #endif //ARM_STM32F4XX
682 #endif // UNIX_OR_WINDOWS
685 /*---------------------------------------------------------------------------------------------------------------------------------------------------
687 * @details Sends character
688 * @param ch character to be transmitted
689 *---------------------------------------------------------------------------------------------------------------------------------------------------
692 irmp_uart_putc (unsigned char ch
)
694 #ifndef UNIX_OR_WINDOWS
695 #if defined(ARM_STM32F4XX)
696 // warten bis altes Byte gesendet wurde
697 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
702 USART_SendData(STM32_UART_COM
, ch
);
706 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
707 USART_SendData(STM32_UART_COM
, '\r');
711 #if (IRMP_EXT_LOGGING == 0)
713 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
722 sendextlog(ch
); // use external log
724 #endif //IRMP_EXT_LOGGING
725 #endif //ARM_STM32F4XX
728 #endif // UNIX_OR_WINDOWS
731 /*---------------------------------------------------------------------------------------------------------------------------------------------------
733 *---------------------------------------------------------------------------------------------------------------------------------------------------
736 #define STARTCYCLES 2 // min count of zeros before start of logging
737 #define ENDBITS 1000 // number of sequenced highbits to detect end
738 #define DATALEN 700 // log buffer size
740 #if 0 // old log routine
743 irmp_log (uint8_t val
)
745 static uint8_t buf
[DATALEN
]; // logging buffer
746 static uint16_t buf_idx
; // number of written bits
747 static uint8_t startcycles
; // current number of start-zeros
748 static uint16_t cnt
; // counts sequenced highbits - to detect end
750 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
758 if (! val
|| (val
&& buf_idx
!= 0)) // start or continue logging on "0", "1" cannot init logging
760 if (buf_idx
< DATALEN
* 8) // index in range?
764 buf
[(buf_idx
/ 8)] |= (1<<(buf_idx
% 8)); // set bit
768 buf
[(buf_idx
/ 8)] &= ~(1<<(buf_idx
% 8)); // reset bit
775 { // if high received then look at log-stop condition
779 { // if stop condition is true, output on uart
782 for (i
= 0; i
< STARTCYCLES
; i
++)
784 irmp_uart_putc ('0'); // the ignored starting zeros
787 for (i
= 0; i
< (buf_idx
- ENDBITS
+ 20) / 8; i
++) // transform bitset into uart chars
792 for (j
= 0; j
< 8; j
++)
794 irmp_uart_putc ((d
& 1) + '0');
799 irmp_uart_putc ('\n');
811 #else // new log routine
814 irmp_log (uint8_t val
)
816 static uint8_t buf
[DATALEN
]; // logging buffer
817 static uint16_t buf_idx
; // index
818 static uint8_t startcycles
; // current number of start-zeros
819 static uint16_t cnt
; // counts sequenced highbits - to detect end
820 static uint8_t last_val
= 1;
822 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
830 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
836 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
837 { // if stop condition is true, output on uart
844 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
846 irmp_uart_putc ('0'); // the ignored starting zeros
849 for (i
= 0; i
< buf_idx
; i
++)
858 d
|= ((uint16_t) buf
[i
] << 8);
861 for (j
= 0; j
< d
; j
++)
866 v
= (v
== '1') ? '0' : '1';
869 for (i8
= 0; i8
< 20; i8
++)
871 irmp_uart_putc ('1');
874 irmp_uart_putc ('\n');
880 else if (buf_idx
< DATALEN
- 3)
884 buf
[buf_idx
++] = 0xff;
885 buf
[buf_idx
++] = (cnt
& 0xff);
886 buf
[buf_idx
] = (cnt
>> 8);
904 #define irmp_log(val)
905 #endif //IRMP_LOGGING
909 uint8_t protocol
; // ir protocol
910 uint8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
911 uint8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
912 uint8_t pause_1_len_min
; // minimum length of pause with bit value 1
913 uint8_t pause_1_len_max
; // maximum length of pause with bit value 1
914 uint8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
915 uint8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
916 uint8_t pause_0_len_min
; // minimum length of pause with bit value 0
917 uint8_t pause_0_len_max
; // maximum length of pause with bit value 0
918 uint8_t address_offset
; // address offset
919 uint8_t address_end
; // end of address
920 uint8_t command_offset
; // command offset
921 uint8_t command_end
; // end of command
922 uint8_t complete_len
; // complete length of frame
923 uint8_t stop_bit
; // flag: frame has stop bit
924 uint8_t lsb_first
; // flag: LSB first
925 uint8_t flags
; // some flags
928 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
930 static const PROGMEM IRMP_PARAMETER sircs_param
=
932 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
933 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
934 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
935 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
936 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
937 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
938 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
939 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
940 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
941 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
942 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
943 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
944 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
945 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
946 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
947 SIRCS_LSB
, // lsb_first: flag: LSB first
948 SIRCS_FLAGS
// flags: some flags
953 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
955 static const PROGMEM IRMP_PARAMETER nec_param
=
957 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
958 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
959 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
960 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
961 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
962 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
963 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
964 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
965 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
966 NEC_ADDRESS_OFFSET
, // address_offset: address offset
967 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
968 NEC_COMMAND_OFFSET
, // command_offset: command offset
969 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
970 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
971 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
972 NEC_LSB
, // lsb_first: flag: LSB first
973 NEC_FLAGS
// flags: some flags
976 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
978 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
979 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
980 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
981 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
982 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
983 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
984 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
985 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
986 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
987 0, // address_offset: address offset
988 0, // address_end: end of address
989 0, // command_offset: command offset
990 0, // command_end: end of command
991 0, // complete_len: complete length of frame
992 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
993 NEC_LSB
, // lsb_first: flag: LSB first
994 NEC_FLAGS
// flags: some flags
999 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1001 static const PROGMEM IRMP_PARAMETER nec42_param
=
1003 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1004 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1005 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1006 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1007 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1008 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1009 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1010 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1011 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1012 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1013 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1014 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1015 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1016 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1017 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1018 NEC_LSB
, // lsb_first: flag: LSB first
1019 NEC_FLAGS
// flags: some flags
1024 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1026 static const PROGMEM IRMP_PARAMETER lgair_param
=
1028 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1029 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1030 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1031 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1032 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1033 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1034 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1035 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1036 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1037 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1038 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1039 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1040 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1041 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1042 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1043 NEC_LSB
, // lsb_first: flag: LSB first
1044 NEC_FLAGS
// flags: some flags
1049 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1051 static const PROGMEM IRMP_PARAMETER samsung_param
=
1053 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1054 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1055 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1056 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1057 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1058 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1059 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1060 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1061 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1062 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1063 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1064 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1065 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1066 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1067 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1068 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1069 SAMSUNG_FLAGS
// flags: some flags
1074 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1076 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1078 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1079 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1080 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1081 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1082 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1083 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1084 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1085 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1086 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1087 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1088 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1089 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1090 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1091 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1092 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1093 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1094 TELEFUNKEN_FLAGS
// flags: some flags
1099 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1101 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1103 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1104 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1105 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1106 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1107 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1108 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1109 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1110 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1111 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1112 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1113 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1114 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1115 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1116 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1117 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1118 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1119 MATSUSHITA_FLAGS
// flags: some flags
1124 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1126 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1128 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1129 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1130 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1131 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1132 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1133 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1134 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1135 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1136 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1137 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1138 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1139 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1140 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1141 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1142 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1143 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1144 KASEIKYO_FLAGS
// flags: some flags
1149 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1151 static const PROGMEM IRMP_PARAMETER recs80_param
=
1153 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1154 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1155 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1156 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1157 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1158 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1159 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1160 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1161 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1162 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1163 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1164 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1165 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1166 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1167 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1168 RECS80_LSB
, // lsb_first: flag: LSB first
1169 RECS80_FLAGS
// flags: some flags
1174 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1176 static const PROGMEM IRMP_PARAMETER rc5_param
=
1178 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1179 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1180 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1181 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1182 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1183 0, // pulse_0_len_min: here: not used
1184 0, // pulse_0_len_max: here: not used
1185 0, // pause_0_len_min: here: not used
1186 0, // pause_0_len_max: here: not used
1187 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1188 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1189 RC5_COMMAND_OFFSET
, // command_offset: command offset
1190 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1191 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1192 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1193 RC5_LSB
, // lsb_first: flag: LSB first
1194 RC5_FLAGS
// flags: some flags
1199 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1201 static const PROGMEM IRMP_PARAMETER denon_param
=
1203 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1204 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1205 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1206 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1207 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1208 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1209 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1210 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1211 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1212 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1213 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1214 DENON_COMMAND_OFFSET
, // command_offset: command offset
1215 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1216 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1217 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1218 DENON_LSB
, // lsb_first: flag: LSB first
1219 DENON_FLAGS
// flags: some flags
1224 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1226 static const PROGMEM IRMP_PARAMETER rc6_param
=
1228 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1230 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1231 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1232 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1233 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1234 0, // pulse_0_len_min: here: not used
1235 0, // pulse_0_len_max: here: not used
1236 0, // pause_0_len_min: here: not used
1237 0, // pause_0_len_max: here: not used
1238 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1239 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1240 RC6_COMMAND_OFFSET
, // command_offset: command offset
1241 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1242 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1243 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1244 RC6_LSB
, // lsb_first: flag: LSB first
1245 RC6_FLAGS
// flags: some flags
1250 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1252 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1254 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1255 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1256 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1257 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1258 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1259 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1260 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1261 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1262 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1263 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1264 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1265 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1266 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1267 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1268 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1269 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1270 RECS80EXT_FLAGS
// flags: some flags
1275 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1277 static const PROGMEM IRMP_PARAMETER nubert_param
=
1279 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1280 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1281 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1282 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1283 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1284 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1285 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1286 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1287 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1288 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1289 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1290 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1291 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1292 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1293 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1294 NUBERT_LSB
, // lsb_first: flag: LSB first
1295 NUBERT_FLAGS
// flags: some flags
1300 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1302 static const PROGMEM IRMP_PARAMETER speaker_param
=
1304 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1305 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1306 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1307 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1308 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1309 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1310 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1311 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1312 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1313 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1314 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1315 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1316 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1317 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1318 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1319 SPEAKER_LSB
, // lsb_first: flag: LSB first
1320 SPEAKER_FLAGS
// flags: some flags
1325 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1327 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1329 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1330 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1331 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1332 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1333 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1334 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1335 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1336 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1337 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1338 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1339 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1340 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1341 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1342 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1343 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1344 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1345 BANG_OLUFSEN_FLAGS
// flags: some flags
1350 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1352 static uint8_t first_bit
;
1354 static const PROGMEM IRMP_PARAMETER grundig_param
=
1356 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1358 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1359 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1360 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1361 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1362 0, // pulse_0_len_min: here: not used
1363 0, // pulse_0_len_max: here: not used
1364 0, // pause_0_len_min: here: not used
1365 0, // pause_0_len_max: here: not used
1366 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1367 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1368 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1369 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1370 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1371 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1372 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1373 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1378 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1380 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1382 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1383 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1384 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1385 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1386 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1387 0, // pulse_0_len_min: here: not used
1388 0, // pulse_0_len_max: here: not used
1389 0, // pause_0_len_min: here: not used
1390 0, // pause_0_len_max: here: not used
1391 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1392 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1393 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1394 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1395 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1396 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1397 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1398 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1403 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1405 static const PROGMEM IRMP_PARAMETER fdc_param
=
1407 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1408 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1409 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1410 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1411 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1412 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1413 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1414 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1415 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1416 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1417 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1418 FDC_COMMAND_OFFSET
, // command_offset: command offset
1419 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1420 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1421 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1422 FDC_LSB
, // lsb_first: flag: LSB first
1423 FDC_FLAGS
// flags: some flags
1428 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1430 static const PROGMEM IRMP_PARAMETER rccar_param
=
1432 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1433 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1434 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1435 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1436 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1437 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1438 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1439 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1440 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1441 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1442 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1443 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1444 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1445 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1446 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1447 RCCAR_LSB
, // lsb_first: flag: LSB first
1448 RCCAR_FLAGS
// flags: some flags
1453 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1455 static const PROGMEM IRMP_PARAMETER nikon_param
=
1457 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1458 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1459 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1460 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1461 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1462 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1463 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1464 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1465 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1466 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1467 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1468 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1469 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1470 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1471 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1472 NIKON_LSB
, // lsb_first: flag: LSB first
1473 NIKON_FLAGS
// flags: some flags
1478 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1480 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1482 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1483 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1484 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1485 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1486 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1487 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1488 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1489 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1490 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1491 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1492 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1493 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1494 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1495 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1496 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1497 KATHREIN_LSB
, // lsb_first: flag: LSB first
1498 KATHREIN_FLAGS
// flags: some flags
1503 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1505 static const PROGMEM IRMP_PARAMETER netbox_param
=
1507 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1508 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1509 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1510 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1511 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1512 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1513 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1514 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1515 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1516 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1517 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1518 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1519 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1520 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1521 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1522 NETBOX_LSB
, // lsb_first: flag: LSB first
1523 NETBOX_FLAGS
// flags: some flags
1528 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1530 static const PROGMEM IRMP_PARAMETER lego_param
=
1532 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1533 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1534 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1535 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1536 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1537 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1538 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1539 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1540 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1541 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1542 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1543 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1544 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1545 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1546 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1547 LEGO_LSB
, // lsb_first: flag: LSB first
1548 LEGO_FLAGS
// flags: some flags
1553 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1555 static const PROGMEM IRMP_PARAMETER thomson_param
=
1557 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1558 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1559 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1560 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1561 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1562 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1563 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1564 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1565 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1566 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1567 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1568 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1569 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1570 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1571 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1572 THOMSON_LSB
, // lsb_first: flag: LSB first
1573 THOMSON_FLAGS
// flags: some flags
1578 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1580 static const PROGMEM IRMP_PARAMETER bose_param
=
1582 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1583 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1584 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1585 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1586 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1587 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1588 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1589 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1590 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1591 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1592 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1593 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1594 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1595 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1596 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1597 BOSE_LSB
, // lsb_first: flag: LSB first
1598 BOSE_FLAGS
// flags: some flags
1603 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1605 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1607 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1609 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1610 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1611 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1612 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1613 0, // pulse_0_len_min: here: not used
1614 0, // pulse_0_len_max: here: not used
1615 0, // pause_0_len_min: here: not used
1616 0, // pause_0_len_max: here: not used
1617 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1618 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1619 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1620 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1621 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1622 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1623 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1624 A1TVBOX_FLAGS
// flags: some flags
1629 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1631 static const PROGMEM IRMP_PARAMETER ortek_param
=
1633 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1635 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1636 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1637 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1638 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1639 0, // pulse_0_len_min: here: not used
1640 0, // pulse_0_len_max: here: not used
1641 0, // pause_0_len_min: here: not used
1642 0, // pause_0_len_max: here: not used
1643 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1644 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1645 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1646 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1647 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1648 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1649 ORTEK_LSB
, // lsb_first: flag: LSB first
1650 ORTEK_FLAGS
// flags: some flags
1655 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1657 static const PROGMEM IRMP_PARAMETER roomba_param
=
1659 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1660 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1661 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1662 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1663 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1664 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1665 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1666 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1667 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1668 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1669 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1670 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1671 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1672 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1673 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1674 ROOMBA_LSB
, // lsb_first: flag: LSB first
1675 ROOMBA_FLAGS
// flags: some flags
1680 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1682 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1684 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1686 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1687 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1688 0, // pause_1_len_min: here: minimum length of short pause
1689 0, // pause_1_len_max: here: maximum length of short pause
1690 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1691 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1692 0, // pause_0_len_min: here: not used
1693 0, // pause_0_len_max: here: not used
1694 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1695 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1696 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1697 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1698 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1699 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1700 RCMM32_LSB
, // lsb_first: flag: LSB first
1701 RCMM32_FLAGS
// flags: some flags
1706 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
1708 static const PROGMEM IRMP_PARAMETER radio1_param
=
1710 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
1712 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1713 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1714 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1715 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1716 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1717 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1718 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1719 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1720 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
1721 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
1722 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
1723 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
1724 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1725 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
1726 RADIO1_LSB
, // lsb_first: flag: LSB first
1727 RADIO1_FLAGS
// flags: some flags
1732 static uint8_t irmp_bit
; // current bit position
1733 static IRMP_PARAMETER irmp_param
;
1735 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1736 static IRMP_PARAMETER irmp_param2
;
1739 static volatile uint8_t irmp_ir_detected
;
1740 static volatile uint8_t irmp_protocol
;
1741 static volatile uint16_t irmp_address
;
1742 static volatile uint16_t irmp_command
;
1743 static volatile uint16_t irmp_id
; // only used for SAMSUNG protocol
1744 static volatile uint8_t irmp_flags
;
1745 // static volatile uint8_t irmp_busy_flag;
1748 #define input(x) (x)
1749 static uint8_t IRMP_PIN
;
1750 static uint8_t radio
;
1753 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1754 * Initialize IRMP decoder
1755 * @details Configures IRMP input pin
1756 *---------------------------------------------------------------------------------------------------------------------------------------------------
1762 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
1763 #elif defined (ARM_STM32) // STM32
1764 GPIO_InitTypeDef GPIO_InitStructure
;
1766 /* GPIOx clock enable */
1767 #if defined (ARM_STM32L1XX)
1768 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1769 #elif defined (ARM_STM32F10X)
1770 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1771 #elif defined (ARM_STM32F4XX)
1772 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1775 /* GPIO Configuration */
1776 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
1777 #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
1778 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
1779 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1780 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
1781 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
1782 #elif defined (ARM_STM32F10X)
1783 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1784 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
1786 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
1787 #elif defined(STELLARIS_ARM_CORTEX_M4)
1788 // Enable the GPIO port
1789 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
1792 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
1793 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
,
1795 GPIO_PIN_TYPE_STD_WPU
);
1797 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
1798 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
1801 #if IRMP_LOGGING == 1
1806 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1808 * @details gets decoded IRMP data
1809 * @param pointer in order to store IRMP data
1810 * @return TRUE: successful, FALSE: failed
1811 *---------------------------------------------------------------------------------------------------------------------------------------------------
1814 irmp_get_data (IRMP_DATA
* irmp_data_p
)
1816 uint8_t rtc
= FALSE
;
1818 if (irmp_ir_detected
)
1820 switch (irmp_protocol
)
1822 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1823 case IRMP_SAMSUNG_PROTOCOL
:
1824 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1826 irmp_command
&= 0xff;
1827 irmp_command
|= irmp_id
<< 8;
1832 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
1833 case IRMP_SAMSUNG48_PROTOCOL
:
1834 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
1840 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1841 case IRMP_NEC_PROTOCOL
:
1842 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1844 irmp_command
&= 0xff;
1847 else if (irmp_address
== 0x87EE)
1850 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
1852 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
1853 irmp_address
= (irmp_command
& 0xFF00) >> 8;
1854 irmp_command
&= 0x00FF;
1859 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1860 case IRMP_BOSE_PROTOCOL
:
1861 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1863 irmp_command
&= 0xff;
1868 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1869 case IRMP_SIEMENS_PROTOCOL
:
1870 case IRMP_RUWIDO_PROTOCOL
:
1871 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
1878 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1879 case IRMP_KATHREIN_PROTOCOL
:
1880 if (irmp_command
!= 0x0000)
1886 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1887 case IRMP_RC5_PROTOCOL
:
1888 irmp_address
&= ~0x20; // clear toggle bit
1892 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
1893 case IRMP_IR60_PROTOCOL
:
1894 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
1901 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
1906 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1907 case IRMP_RCCAR_PROTOCOL
:
1908 // frame in irmp_data:
1909 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
1910 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
1911 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
1912 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
1913 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
1914 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
1915 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
1919 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
1920 case IRMP_NETBOX_PROTOCOL
:
1921 if (irmp_command
& 0x1000) // last bit set?
1923 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
1926 irmp_command
&= 0x7F;
1929 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
1932 irmp_command
|= 0x80;
1938 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
1945 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
1950 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1951 case IRMP_LEGO_PROTOCOL
:
1953 uint8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
1955 if ((irmp_command
& 0x000F) == crc
)
1963 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
1965 // rtc = TRUE; // don't accept codes with CRC errors
1980 irmp_data_p
->protocol
= irmp_protocol
;
1981 irmp_data_p
->address
= irmp_address
;
1982 irmp_data_p
->command
= irmp_command
;
1983 irmp_data_p
->flags
= irmp_flags
;
1989 irmp_ir_detected
= FALSE
;
1996 // irmp_is_busy (void)
1998 // return irmp_busy_flag;
2001 #if IRMP_USE_CALLBACK == 1
2003 irmp_set_callback_ptr (void (*cb
)(uint8_t))
2005 irmp_callback_ptr
= cb
;
2007 #endif // IRMP_USE_CALLBACK == 1
2009 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2010 static uint16_t irmp_tmp_address
; // ir address
2011 static uint16_t irmp_tmp_command
; // ir command
2013 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2014 static uint16_t irmp_tmp_address2
; // ir address
2015 static uint16_t irmp_tmp_command2
; // ir command
2018 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2019 static uint16_t irmp_lgair_address
; // ir address
2020 static uint16_t irmp_lgair_command
; // ir command
2023 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2024 static uint16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2026 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2027 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2028 static uint8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2031 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2032 static uint8_t parity
; // number of '1' of the first 14 bits, check if even.
2035 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2037 * @details store bit in temp address or temp command
2038 * @param value to store: 0 or 1
2039 *---------------------------------------------------------------------------------------------------------------------------------------------------
2041 // verhindert, dass irmp_store_bit() inline compiliert wird:
2042 // static void irmp_store_bit (uint8_t) __attribute__ ((noinline));
2045 irmp_store_bit (uint8_t value
)
2047 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2048 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2057 else if (irmp_bit
== 14)
2059 if (value
) // value == 1: even parity
2063 parity
= PARITY_CHECK_FAILED
;
2067 parity
= PARITY_CHECK_OK
;
2072 if (parity
& 0x01) // value == 0: odd parity
2074 parity
= PARITY_CHECK_OK
;
2078 parity
= PARITY_CHECK_FAILED
;
2085 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2086 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2093 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2095 if (irmp_param
.lsb_first
)
2097 irmp_tmp_address
|= (((uint16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2101 irmp_tmp_address
<<= 1;
2102 irmp_tmp_address
|= value
;
2105 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2107 if (irmp_param
.lsb_first
)
2109 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2110 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2112 irmp_tmp_id
|= (((uint16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2117 irmp_tmp_command
|= (((uint16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2122 irmp_tmp_command
<<= 1;
2123 irmp_tmp_command
|= value
;
2127 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2128 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2132 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2133 irmp_lgair_address
|= value
;
2135 else if (irmp_bit
< 24)
2137 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2138 irmp_lgair_command
|= value
;
2144 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2145 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2147 irmp_tmp_address2
|= (((uint16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2152 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2153 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2155 irmp_tmp_id
|= (((uint16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2160 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2161 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2163 if (irmp_bit
>= 20 && irmp_bit
< 24)
2165 irmp_tmp_command
|= (((uint16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2167 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2169 genre2
|= (((uint8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2172 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2176 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2180 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2193 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2195 * @details store bit in temp address or temp command
2196 * @param value to store: 0 or 1
2197 *---------------------------------------------------------------------------------------------------------------------------------------------------
2199 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2201 irmp_store_bit2 (uint8_t value
)
2205 if (irmp_param
.protocol
)
2207 irmp_bit2
= irmp_bit
- 2;
2211 irmp_bit2
= irmp_bit
- 1;
2214 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2216 irmp_tmp_address2
|= (((uint16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2218 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2220 irmp_tmp_command2
|= (((uint16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2223 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2225 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2227 * @details ISR routine, called 10000 times per second
2228 *---------------------------------------------------------------------------------------------------------------------------------------------------
2233 static uint8_t irmp_start_bit_detected
; // flag: start bit detected
2234 static uint8_t wait_for_space
; // flag: wait for data bit space
2235 static uint8_t wait_for_start_space
; // flag: wait for start bit space
2236 static uint8_t irmp_pulse_time
; // count bit time for pulse
2237 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2238 static uint16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2239 static uint16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2240 static uint16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2241 static uint8_t repetition_frame_number
;
2242 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2243 static uint16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2244 static uint16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2246 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2247 static uint8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2249 #if IRMP_SUPPORT_MANCHESTER == 1
2250 static PAUSE_LEN last_pause
; // last pause value
2252 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2253 static uint8_t last_value
; // last bit value
2255 uint8_t irmp_input
; // input value
2261 irmp_input
= input(IRMP_PIN
);
2263 #if IRMP_USE_CALLBACK == 1
2264 if (irmp_callback_ptr
)
2266 static uint8_t last_inverted_input
;
2268 if (last_inverted_input
!= !irmp_input
)
2270 (*irmp_callback_ptr
) (! irmp_input
);
2271 last_inverted_input
= !irmp_input
;
2274 #endif // IRMP_USE_CALLBACK == 1
2276 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2278 if (! irmp_ir_detected
) // ir code already detected?
2280 if (! irmp_start_bit_detected
) // start bit detected?
2282 if (! irmp_input
) // receiving burst?
2284 // irmp_busy_flag = TRUE;
2286 if (! irmp_pulse_time
)
2288 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2291 irmp_pulse_time
++; // increment counter
2295 if (irmp_pulse_time
) // it's dark....
2296 { // set flags for counting the time of darkness...
2297 irmp_start_bit_detected
= 1;
2298 wait_for_start_space
= 1;
2300 irmp_tmp_command
= 0;
2301 irmp_tmp_address
= 0;
2302 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2305 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2309 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2310 irmp_tmp_command2
= 0;
2311 irmp_tmp_address2
= 0;
2313 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2314 irmp_lgair_command
= 0;
2315 irmp_lgair_address
= 0;
2318 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2319 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2320 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2325 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2327 key_repetition_len
++;
2329 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2330 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2332 denon_repetition_len
++;
2334 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2337 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2338 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2340 last_irmp_denon_command
= 0;
2341 denon_repetition_len
= 0xFFFF;
2344 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2351 if (wait_for_start_space
) // we have received start bit...
2352 { // ...and are counting the time of darkness
2353 if (irmp_input
) // still dark?
2355 irmp_pause_time
++; // increment counter
2357 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2358 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
) ||
2359 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2361 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2364 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2365 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2370 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2373 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
);
2374 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2378 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2379 irmp_pulse_time
= 0;
2380 irmp_pause_time
= 0;
2384 { // receiving first data pulse!
2385 IRMP_PARAMETER
* irmp_param_p
= (IRMP_PARAMETER
*) 0;
2387 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2388 irmp_param2
.protocol
= 0;
2392 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2395 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2396 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2397 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2400 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2401 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2402 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2404 irmp_param_p
= (IRMP_PARAMETER
*) (IRMP_PARAMETER
*) &sircs_param
;
2407 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2409 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2410 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2411 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2412 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2415 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2416 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2417 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2419 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2422 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2424 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2425 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2426 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2428 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2430 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2431 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2432 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2434 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2437 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2438 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2439 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2441 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2444 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2445 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2447 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2448 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2449 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2451 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2452 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2453 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2455 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2458 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2461 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2462 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2463 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2466 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2471 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2472 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2473 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2474 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2475 { // it's JVC repetition type 3
2477 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2478 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2479 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2481 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2484 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2486 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2488 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2489 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2490 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2493 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2494 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2495 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2497 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2500 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2502 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2503 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2504 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2507 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2508 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2509 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2511 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2514 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2516 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2517 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2518 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2521 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2522 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2523 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2525 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2528 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2530 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2531 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2532 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2535 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2536 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2537 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2539 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2542 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2544 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2545 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2546 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2547 { // it's MATSUSHITA
2549 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2550 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2551 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2553 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2556 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2558 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2559 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2560 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2563 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2564 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2565 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2567 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2570 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2572 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2573 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2574 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2577 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2578 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2579 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2581 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2584 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2586 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2587 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2588 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2591 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2592 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2593 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2595 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2598 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2600 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2601 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
2602 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
2603 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
2604 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
2606 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2607 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2608 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2611 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
2612 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2613 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2614 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2615 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2616 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2617 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2619 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
2622 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2624 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2625 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2626 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2629 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
2630 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2631 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2632 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2633 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2634 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2635 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2637 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
2640 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2643 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2644 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2645 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
2646 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2647 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
2651 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
2652 last_pause
= irmp_pause_time
;
2654 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
2655 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
2658 rc5_cmd_bit6
= 1<<6;
2666 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
2668 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2669 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
2670 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
2671 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
2674 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2675 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
2676 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
2677 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
2679 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
2682 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2684 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2685 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
2686 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
2687 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
2690 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2691 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
2692 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
2693 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
2695 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
2698 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2700 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2701 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
2702 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
2705 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2706 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
2707 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
2709 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
2712 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
2714 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2715 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
2716 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
2719 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2720 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
2721 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
2723 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
2728 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2730 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2731 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
2732 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
2735 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2736 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
2737 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
2739 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
2742 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2744 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2745 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
2746 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
2749 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2750 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
2751 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
2753 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
2756 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2758 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2759 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
2760 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
2763 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2764 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
2765 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
2767 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
2770 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2772 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2773 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
2774 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
2775 { // it's BANG_OLUFSEN
2777 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
2778 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2779 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
2780 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
2781 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2782 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
2783 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
2784 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2785 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
2786 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
2787 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2788 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
2789 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
2791 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
2795 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2797 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2798 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
2799 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
2802 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2803 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
2804 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
2806 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
2807 last_pause
= irmp_pause_time
;
2811 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2813 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2814 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
2815 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
2816 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
2817 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
2818 { // it's RUWIDO or SIEMENS
2820 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2821 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2822 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2823 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
2824 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
2826 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
2827 last_pause
= irmp_pause_time
;
2831 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2833 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2834 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2835 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2838 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2839 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2840 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2842 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
2845 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2847 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2848 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2849 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2852 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2853 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2854 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2856 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
2859 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2861 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2862 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
2863 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
2866 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2867 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
2868 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
2870 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
2873 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2875 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2876 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
2877 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
2880 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2881 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
2882 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
2884 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
2887 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2889 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2890 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
2891 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
2894 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2895 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
2896 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
2898 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
2901 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
2903 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2904 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
2905 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
2908 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2909 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
2910 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
2912 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
2917 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2919 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2920 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
2921 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
2922 { // it's ORTEK (Hama)
2924 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2925 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
2926 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
2928 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
2934 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2936 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
2937 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
2938 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
2941 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2942 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
2943 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
2945 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
2948 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
2951 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
2953 irmp_start_bit_detected
= 0; // wait for another start bit...
2956 if (irmp_start_bit_detected
)
2958 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
2960 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
2963 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
2964 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
2970 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
2971 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
2972 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
2973 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
2977 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2978 if (irmp_param2
.protocol
)
2981 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
2982 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
2983 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
2984 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
2990 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2991 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
2994 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
2999 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3002 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3003 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3009 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3010 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3011 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3012 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3017 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3018 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3020 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3021 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3025 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3026 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3027 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3028 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3034 #if IRMP_SUPPORT_MANCHESTER == 1
3035 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3036 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3037 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3039 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3042 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3043 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3046 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3048 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3051 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3052 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3055 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3059 #endif // IRMP_SUPPORT_MANCHESTER == 1
3061 #if IRMP_SUPPORT_SERIAL == 1
3062 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3067 #endif // IRMP_SUPPORT_SERIAL == 1
3070 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3071 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3074 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3077 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3078 { // pause timings correct for "1"?
3080 ANALYZE_PUTCHAR ('1'); // yes, store 1
3085 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3086 { // pause timings correct for "0"?
3088 ANALYZE_PUTCHAR ('0'); // yes, store 0
3095 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3096 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3097 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3100 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3103 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3104 { // pause timings correct for "1"?
3106 ANALYZE_PUTCHAR ('1'); // yes, store 1
3111 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3112 { // pause timings correct for "0"?
3114 ANALYZE_PUTCHAR ('0'); // yes, store 0
3121 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3123 ; // else do nothing
3126 irmp_pulse_time
= 1; // set counter to 1, not 0
3127 irmp_pause_time
= 0;
3128 wait_for_start_space
= 0;
3131 else if (wait_for_space
) // the data section....
3132 { // counting the time of darkness....
3133 uint8_t got_light
= FALSE
;
3135 if (irmp_input
) // still dark?
3137 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3140 #if IRMP_SUPPORT_MANCHESTER == 1
3141 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3143 #if IRMP_SUPPORT_SERIAL == 1
3144 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3146 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3149 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3151 ANALYZE_PRINTF ("stop bit detected\n");
3154 irmp_param
.stop_bit
= 0;
3159 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",
3160 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3162 irmp_start_bit_detected
= 0; // wait for another start bit...
3163 irmp_pulse_time
= 0;
3164 irmp_pause_time
= 0;
3169 irmp_pause_time
++; // increment counter
3171 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3172 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3173 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3174 irmp_bit
>= 12 - 1) // pause too long?
3175 { // yes, break and close this frame
3176 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3177 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3178 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3179 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3180 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3184 #if IRMP_SUPPORT_SERIAL == 1
3185 // NETBOX generates no stop bit, here is the timeout condition:
3186 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3187 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3189 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3193 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3194 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3196 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3199 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3201 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3202 irmp_param
.stop_bit
= TRUE
; // set flag
3204 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3205 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3206 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3207 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3208 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3209 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3211 irmp_tmp_command
<<= 1;
3212 irmp_tmp_command
|= first_bit
;
3214 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3215 { // special manchester decoder
3216 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3217 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3218 irmp_param
.stop_bit
= TRUE
; // set flag
3220 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3223 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");
3225 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3226 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3227 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3228 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3229 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3231 if (irmp_tmp_command
& 0x300)
3233 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3234 irmp_tmp_command
&= 0xFF;
3240 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3241 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3243 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3244 { // special manchester decoder
3245 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3246 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3247 irmp_param
.stop_bit
= TRUE
; // set flag
3249 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3252 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3254 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3255 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3256 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3257 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3258 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3261 // RUWIDO: AAAAAAAAACCCCCCCp
3262 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3263 irmp_tmp_address
<<= 2;
3264 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3265 irmp_tmp_command
&= 0x003F;
3266 // irmp_tmp_command <<= 4;
3267 irmp_tmp_command
|= last_value
;
3272 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3273 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3274 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3275 { // break and close this frame
3276 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3278 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3280 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3282 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3285 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3289 #if IRMP_SUPPORT_MANCHESTER == 1
3290 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3291 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3292 { // special manchester decoder
3293 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3294 irmp_param
.stop_bit
= TRUE
; // set flag
3297 #endif // IRMP_SUPPORT_MANCHESTER == 1
3298 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3300 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3304 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3305 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3308 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3310 irmp_param
.stop_bit
= TRUE
; // set flag
3311 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3312 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3313 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3314 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3315 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3317 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3318 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3319 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3322 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3324 irmp_param
.stop_bit
= TRUE
; // set flag
3325 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3326 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3327 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3328 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3329 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3331 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3333 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3334 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3335 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3338 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3340 irmp_param
.stop_bit
= TRUE
; // set flag
3341 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3342 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3344 // 0123456789ABC0123456789ABC0123456701234567
3345 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3346 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3347 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3348 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3350 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3351 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3352 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3355 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3357 irmp_param
.stop_bit
= TRUE
; // set flag
3358 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3359 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3360 irmp_tmp_address
= irmp_lgair_address
;
3361 irmp_tmp_command
= irmp_lgair_command
;
3363 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3364 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3365 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3368 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3370 irmp_param
.stop_bit
= TRUE
; // set flag
3371 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3372 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3374 // 0123456789ABC0123456789ABC0123456701234567
3375 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3376 // JVC: AAAACCCCCCCCCCCC
3377 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3378 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3380 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3381 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3383 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3384 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3387 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3389 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3390 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3391 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3392 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3394 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3396 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3397 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3401 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3402 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3405 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3407 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3409 else // if ((irmp_bit == 24)
3412 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3414 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3416 irmp_param
.stop_bit
= TRUE
; // set flag
3417 irmp_param
.complete_len
= irmp_bit
; // patch length
3419 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3423 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3424 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3426 irmp_start_bit_detected
= 0; // wait for another start bit...
3427 irmp_pulse_time
= 0;
3428 irmp_pause_time
= 0;
3441 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3444 #if IRMP_SUPPORT_MANCHESTER == 1
3445 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3448 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3449 #else // better, but some IR-RCs use asymmetric timings :-/
3450 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3451 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3454 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3455 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3458 ANALYZE_PUTCHAR ('T');
3460 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3475 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3478 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3480 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
3482 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3483 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3486 ANALYZE_PUTCHAR ('T');
3490 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
3503 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3506 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3508 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
3509 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3510 if (! irmp_param2
.protocol
)
3517 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
3521 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
3522 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
3524 uint8_t manchester_value
;
3526 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
3528 manchester_value
= last_value
? 0 : 1;
3529 last_value
= manchester_value
;
3533 manchester_value
= last_value
;
3537 ANALYZE_PUTCHAR (manchester_value
+ '0');
3540 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3541 if (! irmp_param2
.protocol
)
3549 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3550 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
3553 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
3555 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
3556 irmp_param
.address_offset
= 5;
3557 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
3558 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
3559 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
3560 irmp_tmp_address
= 0;
3562 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3564 irmp_store_bit (manchester_value
);
3568 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3569 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
3570 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
3571 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
3572 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
3575 ANALYZE_PUTCHAR ('?');
3577 irmp_param
.protocol
= 0; // switch to FDC, see below
3580 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3581 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3582 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
3583 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
3584 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
3585 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
3588 ANALYZE_PUTCHAR ('?');
3590 irmp_param
.protocol
= 0; // switch to RCCAR, see below
3593 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3596 ANALYZE_PUTCHAR ('?');
3598 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3599 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3601 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3602 irmp_pause_time
= 0;
3606 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3607 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
3609 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
3612 ANALYZE_PRINTF (" 1 (FDC)\n");
3614 irmp_store_bit2 (1);
3616 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
3619 ANALYZE_PRINTF (" 0 (FDC)\n");
3621 irmp_store_bit2 (0);
3624 if (! irmp_param
.protocol
)
3627 ANALYZE_PRINTF ("Switching to FDC protocol\n");
3629 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3630 irmp_param2
.protocol
= 0;
3631 irmp_tmp_address
= irmp_tmp_address2
;
3632 irmp_tmp_command
= irmp_tmp_command2
;
3635 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3636 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3637 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
3639 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
3642 ANALYZE_PRINTF (" 1 (RCCAR)\n");
3644 irmp_store_bit2 (1);
3646 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
3649 ANALYZE_PRINTF (" 0 (RCCAR)\n");
3651 irmp_store_bit2 (0);
3654 if (! irmp_param
.protocol
)
3657 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
3659 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3660 irmp_param2
.protocol
= 0;
3661 irmp_tmp_address
= irmp_tmp_address2
;
3662 irmp_tmp_command
= irmp_tmp_command2
;
3665 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3667 last_pause
= irmp_pause_time
;
3671 #endif // IRMP_SUPPORT_MANCHESTER == 1
3673 #if IRMP_SUPPORT_SERIAL == 1
3674 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3676 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
3679 ANALYZE_PUTCHAR ('1');
3683 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
3685 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
3689 irmp_pulse_time
= 0;
3693 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
3696 ANALYZE_PUTCHAR ('0');
3700 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
3702 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
3706 irmp_pause_time
= 0;
3715 #endif // IRMP_SUPPORT_SERIAL == 1
3717 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3718 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
3720 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
3721 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3724 ANALYZE_PRINTF ("SYNC\n");
3729 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
3731 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3733 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
3735 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
3736 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
3737 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
3738 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
3741 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
3743 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3744 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3745 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3746 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3748 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
3751 ANALYZE_PUTCHAR ('1');
3760 ANALYZE_PUTCHAR ('0');
3768 { // timing incorrect!
3770 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3771 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3773 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3774 irmp_pause_time
= 0;
3778 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
3780 #if IRMP_SUPPORT_NEC16_PROTOCOL
3781 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3782 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
3783 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
3784 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
3785 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3786 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
3789 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
3791 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
3792 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
3793 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
3794 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
3795 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
3796 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
3800 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
3802 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3803 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3805 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
3807 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
3809 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
3812 ANALYZE_PRINTF ("3rd start bit\n");
3818 { // timing incorrect!
3820 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
);
3821 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3823 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3824 irmp_pause_time
= 0;
3827 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
3829 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
3832 ANALYZE_PRINTF ("trailer bit\n");
3838 { // timing incorrect!
3840 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
);
3841 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3843 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3844 irmp_pause_time
= 0;
3849 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
3850 { // pulse & pause timings correct for "1"?
3852 ANALYZE_PUTCHAR ('1');
3859 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
3860 { // pulse & pause timings correct for "0"?
3862 ANALYZE_PUTCHAR ('0');
3869 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
3872 ANALYZE_PUTCHAR (last_value
+ '0');
3875 irmp_store_bit (last_value
);
3879 { // timing incorrect!
3881 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
);
3882 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3884 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3885 irmp_pause_time
= 0;
3890 { // timing incorrect!
3892 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
);
3893 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3895 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3896 irmp_pause_time
= 0;
3900 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
3902 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3903 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
3905 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
3908 ANALYZE_PUTCHAR ('0');
3909 ANALYZE_PUTCHAR ('0');
3914 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
3917 ANALYZE_PUTCHAR ('0');
3918 ANALYZE_PUTCHAR ('1');
3923 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
3926 ANALYZE_PUTCHAR ('1');
3927 ANALYZE_PUTCHAR ('0');
3932 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
3935 ANALYZE_PUTCHAR ('1');
3936 ANALYZE_PUTCHAR ('1');
3942 ANALYZE_PRINTF ("\n");
3949 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
3950 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
3951 { // pulse & pause timings correct for "1"?
3953 ANALYZE_PUTCHAR ('1');
3959 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
3960 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
3961 { // pulse & pause timings correct for "0"?
3963 ANALYZE_PUTCHAR ('0');
3970 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
3972 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
3973 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
3974 (((irmp_bit
== 8 || irmp_bit
== 6) &&
3975 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
3977 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
3984 ANALYZE_PUTCHAR ('S');
3987 irmp_tmp_command
<<= 1;
3992 ANALYZE_PUTCHAR ('S');
4000 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4001 { // timing incorrect!
4003 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4004 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4006 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4007 irmp_pause_time
= 0;
4010 irmp_pulse_time
= 1; // set counter to 1, not 0
4014 { // counting the pulse length ...
4015 if (! irmp_input
) // still light?
4017 irmp_pulse_time
++; // increment counter
4021 wait_for_space
= 1; // let's count the time (see above)
4022 irmp_pause_time
= 1; // set pause counter to 1, not 0
4026 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4028 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4030 repetition_frame_number
++;
4034 repetition_frame_number
= 0;
4037 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4038 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4039 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4042 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4043 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4045 key_repetition_len
= 0;
4050 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4051 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4052 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4055 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4056 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4058 key_repetition_len
= 0;
4063 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4064 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4065 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4068 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4069 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4071 key_repetition_len
= 0;
4076 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4077 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4078 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4081 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4082 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4084 key_repetition_len
= 0;
4089 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4090 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4091 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4094 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4095 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4097 key_repetition_len
= 0;
4102 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4103 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4104 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4107 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4108 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4110 key_repetition_len
= 0;
4117 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4119 irmp_ir_detected
= TRUE
;
4121 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4122 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4123 { // check for repetition frame
4124 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4126 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4127 last_irmp_denon_command
= 0;
4129 irmp_protocol
= irmp_param
.protocol
; // store protocol
4130 irmp_address
= irmp_tmp_address
; // store address
4131 irmp_command
= irmp_tmp_command
; // store command
4135 if ((irmp_tmp_command
& 0x01) == 0x00)
4138 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4140 last_irmp_denon_command
= irmp_tmp_command
;
4141 denon_repetition_len
= 0;
4142 irmp_ir_detected
= FALSE
;
4147 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4149 last_irmp_denon_command
= 0;
4150 irmp_ir_detected
= FALSE
;
4155 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4157 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4158 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4159 { // Grundig start frame?
4161 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4163 irmp_ir_detected
= FALSE
;
4166 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4168 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4169 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4170 { // Nokia start frame?
4172 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4174 irmp_ir_detected
= FALSE
;
4177 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4179 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4180 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4182 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4185 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4186 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4188 irmp_tmp_address
= last_irmp_address
; // address is last address
4189 irmp_tmp_command
= last_irmp_command
; // command is last command
4190 irmp_flags
|= IRMP_FLAG_REPETITION
;
4191 key_repetition_len
= 0;
4196 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4197 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4199 irmp_ir_detected
= FALSE
;
4202 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4204 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4205 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4209 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4211 if (xor_value
!= (xor_check
[2] & 0x0F))
4214 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4216 irmp_ir_detected
= FALSE
;
4219 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4221 if (xor_value
!= xor_check
[5])
4224 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4226 irmp_ir_detected
= FALSE
;
4229 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4231 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4233 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4234 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4236 if (parity
== PARITY_CHECK_FAILED
)
4239 ANALYZE_PRINTF ("error 6: parity check failed\n");
4241 irmp_ir_detected
= FALSE
;
4244 if ((irmp_tmp_address
& 0x03) == 0x02)
4247 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4249 irmp_ir_detected
= FALSE
;
4251 irmp_tmp_address
>>= 2;
4253 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4255 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4256 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4258 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4261 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4263 irmp_protocol
= irmp_param
.protocol
;
4266 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4267 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4269 if (irmp_tmp_command
& 0x000F) // released key?
4271 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4275 irmp_tmp_command
>>= 4; // no, it's a pressed key
4277 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4278 irmp_tmp_address
&= 0x003F;
4282 irmp_address
= irmp_tmp_address
; // store address
4283 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4284 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4286 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4290 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4291 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4293 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4296 irmp_command
= irmp_tmp_command
; // store command
4298 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4299 irmp_id
= irmp_tmp_id
;
4304 if (irmp_ir_detected
)
4306 if (last_irmp_command
== irmp_tmp_command
&&
4307 last_irmp_address
== irmp_tmp_address
&&
4308 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4310 irmp_flags
|= IRMP_FLAG_REPETITION
;
4313 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4314 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4316 key_repetition_len
= 0;
4321 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4325 irmp_start_bit_detected
= 0; // and wait for next start bit
4326 irmp_tmp_command
= 0;
4327 irmp_pulse_time
= 0;
4328 irmp_pause_time
= 0;
4330 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4331 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4332 { // set pulse time here!
4333 irmp_pulse_time
= ((uint8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4335 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4340 #if defined(STELLARIS_ARM_CORTEX_M4)
4341 // Clear the timer interrupt
4342 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4345 return (irmp_ir_detected
);
4350 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4351 * main functions - for Unix/Linux + Windows only!
4355 * Compile it under linux with:
4358 * usage: ./irmp [-v|-s|-a|-l|-p] < file
4364 * -l list pulse/pauses
4366 *---------------------------------------------------------------------------------------------------------------------------------------------------
4370 print_timings (void)
4372 printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN
, sizeof (PAUSE_LEN
));
4373 printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN
);
4375 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");
4376 printf ("====================================================================================\n");
4377 printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4378 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
, SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
,
4379 SIRCS_0_PULSE_LEN_MIN
, SIRCS_0_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
,
4380 SIRCS_1_PULSE_LEN_MIN
, SIRCS_1_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
);
4382 printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4383 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
,
4384 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4385 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4387 printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4388 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
,
4389 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4390 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4392 printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4393 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
, SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
,
4394 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_0_PAUSE_LEN_MIN
, SAMSUNG_0_PAUSE_LEN_MAX
,
4395 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_1_PAUSE_LEN_MIN
, SAMSUNG_1_PAUSE_LEN_MAX
);
4397 printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4398 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
, MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
,
4399 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_0_PAUSE_LEN_MIN
, MATSUSHITA_0_PAUSE_LEN_MAX
,
4400 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_1_PAUSE_LEN_MIN
, MATSUSHITA_1_PAUSE_LEN_MAX
);
4402 printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4403 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
, KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
,
4404 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_0_PAUSE_LEN_MIN
, KASEIKYO_0_PAUSE_LEN_MAX
,
4405 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_1_PAUSE_LEN_MIN
, KASEIKYO_1_PAUSE_LEN_MAX
);
4407 printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4408 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
, RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
,
4409 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_0_PAUSE_LEN_MIN
, RECS80_0_PAUSE_LEN_MAX
,
4410 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_1_PAUSE_LEN_MIN
, RECS80_1_PAUSE_LEN_MAX
);
4412 printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",
4413 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
, RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
4414 RC5_BIT_LEN_MIN
, RC5_BIT_LEN_MAX
);
4416 printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4417 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
4418 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
,
4419 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
);
4421 printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4422 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
4423 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
,
4424 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
);
4426 printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4427 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
, RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
,
4428 RC6_BIT_PULSE_LEN_MIN
, RC6_BIT_PULSE_LEN_MAX
, RC6_BIT_PAUSE_LEN_MIN
, RC6_BIT_PAUSE_LEN_MAX
);
4430 printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4431 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
, RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
,
4432 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_0_PAUSE_LEN_MIN
, RECS80EXT_0_PAUSE_LEN_MAX
,
4433 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_1_PAUSE_LEN_MIN
, RECS80EXT_1_PAUSE_LEN_MAX
);
4435 printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4436 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
, NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
,
4437 NUBERT_0_PULSE_LEN_MIN
, NUBERT_0_PULSE_LEN_MAX
, NUBERT_0_PAUSE_LEN_MIN
, NUBERT_0_PAUSE_LEN_MAX
,
4438 NUBERT_1_PULSE_LEN_MIN
, NUBERT_1_PULSE_LEN_MAX
, NUBERT_1_PAUSE_LEN_MIN
, NUBERT_1_PAUSE_LEN_MAX
);
4440 printf ("SPEAKER 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4441 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
, SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
,
4442 SPEAKER_0_PULSE_LEN_MIN
, SPEAKER_0_PULSE_LEN_MAX
, SPEAKER_0_PAUSE_LEN_MIN
, SPEAKER_0_PAUSE_LEN_MAX
,
4443 SPEAKER_1_PULSE_LEN_MIN
, SPEAKER_1_PULSE_LEN_MAX
, SPEAKER_1_PAUSE_LEN_MIN
, SPEAKER_1_PAUSE_LEN_MAX
);
4445 printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",
4446 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
4447 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
4449 printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",
4450 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
4451 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
4453 printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",
4454 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
4455 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
4457 printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",
4458 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
4459 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
4461 printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4462 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_0_PAUSE_LEN_MIN
, BANG_OLUFSEN_0_PAUSE_LEN_MAX
,
4463 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_1_PAUSE_LEN_MIN
, BANG_OLUFSEN_1_PAUSE_LEN_MAX
);
4465 printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",
4466 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
4467 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
,
4468 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
);
4470 printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4471 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
4472 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
4473 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4474 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
,
4475 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4476 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
);
4478 printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4479 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
, FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
,
4480 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_0_PAUSE_LEN_MIN
, FDC_0_PAUSE_LEN_MAX
,
4481 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_1_PAUSE_LEN_MIN
, FDC_1_PAUSE_LEN_MAX
);
4483 printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4484 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
, RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
,
4485 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_0_PAUSE_LEN_MIN
, RCCAR_0_PAUSE_LEN_MAX
,
4486 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_1_PAUSE_LEN_MIN
, RCCAR_1_PAUSE_LEN_MAX
);
4488 printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4489 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
, NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
,
4490 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_0_PAUSE_LEN_MIN
, NIKON_0_PAUSE_LEN_MAX
,
4491 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_1_PAUSE_LEN_MIN
, NIKON_1_PAUSE_LEN_MAX
);
4493 printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4494 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
, LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
,
4495 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_0_PAUSE_LEN_MIN
, LEGO_0_PAUSE_LEN_MAX
,
4496 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_1_PAUSE_LEN_MIN
, LEGO_1_PAUSE_LEN_MAX
);
4499 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE PAUSE-00 PAUSE-01 PAUSE-10 PAUSE-11\n");
4500 printf ("================================================================================================\n");
4501 printf ("RCMM 1 %3d %3d %3d %3d %3d %3d %3d\n",
4502 (uint8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PULSE_TIME
), (uint8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PAUSE_TIME
),
4503 (uint8_t)(F_INTERRUPTS
* RCMM32_PULSE_TIME
),
4504 (uint8_t)(F_INTERRUPTS
* RCMM32_00_PAUSE_TIME
), (uint8_t)(F_INTERRUPTS
* RCMM32_01_PAUSE_TIME
),
4505 (uint8_t)(F_INTERRUPTS
* RCMM32_10_PAUSE_TIME
), (uint8_t)(F_INTERRUPTS
* RCMM32_11_PAUSE_TIME
));
4506 printf ("RCMM 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4507 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
, RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
,
4508 RCMM32_BIT_PULSE_LEN_MIN
, RCMM32_BIT_PULSE_LEN_MAX
, RCMM32_BIT_00_PAUSE_LEN_MIN
, RCMM32_BIT_00_PAUSE_LEN_MAX
,
4509 RCMM32_BIT_01_PAUSE_LEN_MIN
, RCMM32_BIT_01_PAUSE_LEN_MAX
, RCMM32_BIT_10_PAUSE_LEN_MIN
, RCMM32_BIT_10_PAUSE_LEN_MAX
,
4510 RCMM32_BIT_11_PAUSE_LEN_MIN
, RCMM32_BIT_11_PAUSE_LEN_MAX
);
4514 print_spectrum (char * text
, int * buf
, int is_pulse
)
4527 puts ("-------------------------------------------------------------------------------");
4528 printf ("%s:\n", text
);
4530 for (i
= 0; i
< 256; i
++)
4532 if (buf
[i
] > max_value
)
4538 for (i
= 1; i
< 200; i
++)
4543 value
= (buf
[i
] * 60) / max_value
;
4545 for (j
= 0; j
< value
; j
++)
4549 printf (" %d\n", buf
[i
]);
4560 average
= (float) sum
/ (float) counter
;
4571 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4572 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4573 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4575 tolerance
= (max
- average
);
4577 if (average
- min
> tolerance
)
4579 tolerance
= average
- min
;
4582 tolerance
= tolerance
* 100 / average
;
4583 printf ("tol: %4.1f%%\n", tolerance
);
4593 #define STATE_LEFT_SHIFT 0x01
4594 #define STATE_RIGHT_SHIFT 0x02
4595 #define STATE_LEFT_CTRL 0x04
4596 #define STATE_LEFT_ALT 0x08
4597 #define STATE_RIGHT_ALT 0x10
4599 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4600 #define KEY_MENUE 0x80 // keycode = 0x0070
4601 #define KEY_BACK 0x81 // keycode = 0x0071
4602 #define KEY_FORWARD 0x82 // keycode = 0x0072
4603 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4604 #define KEY_WINDOW 0x84 // keycode = 0x0074
4605 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4606 #define KEY_STOP 0x86 // keycode = 0x0076
4607 #define KEY_MAIL 0x87 // keycode = 0x0077
4608 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4609 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4610 #define KEY_SETUP 0x8A // keycode = 0x007a
4611 #define KEY_FONT 0x8B // keycode = 0x007b
4612 #define KEY_PRINT 0x8C // keycode = 0x007c
4613 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4615 #define KEY_INSERT 0x90 // keycode = 0x004b
4616 #define KEY_DELETE 0x91 // keycode = 0x004c
4617 #define KEY_LEFT 0x92 // keycode = 0x004f
4618 #define KEY_HOME 0x93 // keycode = 0x0050
4619 #define KEY_END 0x94 // keycode = 0x0051
4620 #define KEY_UP 0x95 // keycode = 0x0053
4621 #define KEY_DOWN 0x96 // keycode = 0x0054
4622 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
4623 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
4624 #define KEY_RIGHT 0x99 // keycode = 0x0059
4625 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
4626 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
4629 get_fdc_key (uint16_t cmd
)
4631 static uint8_t key_table
[128] =
4633 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
4634 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
4635 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
4636 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
4637 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
4639 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
4640 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
4641 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
4642 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
4644 static uint8_t state
;
4650 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
4651 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
4652 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
4653 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
4654 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
4655 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
4656 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
4657 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
4658 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
4659 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
4661 case 0x006e: key
= KEY_ESCAPE
; break;
4662 case 0x004b: key
= KEY_INSERT
; break;
4663 case 0x004c: key
= KEY_DELETE
; break;
4664 case 0x004f: key
= KEY_LEFT
; break;
4665 case 0x0050: key
= KEY_HOME
; break;
4666 case 0x0051: key
= KEY_END
; break;
4667 case 0x0053: key
= KEY_UP
; break;
4668 case 0x0054: key
= KEY_DOWN
; break;
4669 case 0x0055: key
= KEY_PAGE_UP
; break;
4670 case 0x0056: key
= KEY_PAGE_DOWN
; break;
4671 case 0x0059: key
= KEY_RIGHT
; break;
4672 case 0x0400: key
= KEY_MOUSE_1
; break;
4673 case 0x0800: key
= KEY_MOUSE_2
; break;
4677 if (!(cmd
& 0x80)) // pressed key
4679 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
4681 key
= cmd
+ 0x10; // 7x -> 8x
4683 else if (cmd
< 64) // key listed in key_table
4685 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
4689 case 0x0003: key
= '²'; break;
4690 case 0x0008: key
= '{'; break;
4691 case 0x0009: key
= '['; break;
4692 case 0x000A: key
= ']'; break;
4693 case 0x000B: key
= '}'; break;
4694 case 0x000C: key
= '\\'; break;
4695 case 0x001C: key
= '~'; break;
4696 case 0x002D: key
= '|'; break;
4697 case 0x0034: key
= 0xB5; break; // Mu
4700 else if (state
& (STATE_LEFT_CTRL
))
4702 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
4704 key
= key_table
[cmd
] - 'a' + 1;
4708 key
= key_table
[cmd
];
4713 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
4717 key
= key_table
[idx
];
4729 static int analyze
= FALSE
;
4730 static int list
= FALSE
;
4731 static IRMP_DATA irmp_data
;
4732 static int expected_protocol
;
4733 static int expected_address
;
4734 static int expected_command
;
4735 static int do_check_expected_values
;
4740 if (! analyze
&& ! list
)
4744 if (irmp_get_data (&irmp_data
))
4748 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
4752 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4755 if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
4757 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
4759 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
4760 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
4762 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
4764 char * p
= (char *) NULL
;
4768 case '\t' : p
= "TAB"; break;
4769 case '\r' : p
= "CR"; break;
4770 case KEY_ESCAPE
: p
= "ESCAPE"; break;
4771 case KEY_MENUE
: p
= "MENUE"; break;
4772 case KEY_BACK
: p
= "BACK"; break;
4773 case KEY_FORWARD
: p
= "FORWARD"; break;
4774 case KEY_ADDRESS
: p
= "ADDRESS"; break;
4775 case KEY_WINDOW
: p
= "WINDOW"; break;
4776 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
4777 case KEY_STOP
: p
= "STOP"; break;
4778 case KEY_MAIL
: p
= "MAIL"; break;
4779 case KEY_FAVORITES
: p
= "FAVORITES"; break;
4780 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
4781 case KEY_SETUP
: p
= "SETUP"; break;
4782 case KEY_FONT
: p
= "FONT"; break;
4783 case KEY_PRINT
: p
= "PRINT"; break;
4784 case KEY_ON_OFF
: p
= "ON_OFF"; break;
4786 case KEY_INSERT
: p
= "INSERT"; break;
4787 case KEY_DELETE
: p
= "DELETE"; break;
4788 case KEY_LEFT
: p
= "LEFT"; break;
4789 case KEY_HOME
: p
= "HOME"; break;
4790 case KEY_END
: p
= "END"; break;
4791 case KEY_UP
: p
= "UP"; break;
4792 case KEY_DOWN
: p
= "DOWN"; break;
4793 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
4794 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
4795 case KEY_RIGHT
: p
= "RIGHT"; break;
4796 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
4797 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
4798 default : p
= "<UNKNWON>"; break;
4801 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
4802 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
4806 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
4807 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
4812 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
4813 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
4816 if (do_check_expected_values
)
4818 if (irmp_data
.protocol
!= expected_protocol
||
4819 irmp_data
.address
!= expected_address
||
4820 irmp_data
.command
!= expected_command
)
4822 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
4823 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
4827 printf (" checked!\n");
4829 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
4840 main (int argc
, char ** argv
)
4848 int start_pulses
[256];
4849 int start_pauses
[256];
4853 int first_pulse
= TRUE
;
4854 int first_pause
= TRUE
;
4858 if (! strcmp (argv
[1], "-v"))
4862 else if (! strcmp (argv
[1], "-l"))
4866 else if (! strcmp (argv
[1], "-a"))
4870 else if (! strcmp (argv
[1], "-s"))
4874 else if (! strcmp (argv
[1], "-p"))
4879 else if (! strcmp (argv
[1], "-r"))
4885 for (i
= 0; i
< 256; i
++)
4887 start_pulses
[i
] = 0;
4888 start_pauses
[i
] = 0;
4895 while ((ch
= getchar ()) != EOF
)
4897 if (ch
== '_' || ch
== '0')
4905 printf ("pause: %d\n", pause
);
4914 start_pauses
[pause
]++;
4916 first_pause
= FALSE
;
4932 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
4938 printf ("pulse: %d ", pulse
);
4947 start_pulses
[pulse
]++;
4949 first_pulse
= FALSE
;
4965 else if (ch
== '\n')
4970 if (list
&& pause
> 0)
4972 printf ("pause: %d\n", pause
);
4978 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
4992 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5003 puts ("-------------------------------------------------------------------");
5007 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5009 if (ch
!= '\r') // ignore CR in DOS/Windows files
5011 if (ch
== '[' && idx
== -1)
5019 do_check_expected_values
= FALSE
;
5023 expected_protocol
= atoi (buf
);
5025 if (expected_protocol
> 0)
5034 if (sscanf (p
, "%x", &expected_address
) == 1)
5036 do_check_expected_values
= TRUE
;
5043 if (do_check_expected_values
)
5045 do_check_expected_values
= FALSE
;
5053 if (sscanf (p
, "%x", &expected_command
) == 1)
5055 do_check_expected_values
= TRUE
;
5062 if (do_check_expected_values
)
5064 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5069 else if (idx
< 1024 - 2)
5089 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5090 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5091 print_spectrum ("PULSES", pulses
, TRUE
);
5092 print_spectrum ("PAUSES", pauses
, FALSE
);
5093 puts ("-------------------------------------------------------------------------------");