1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.176 2015/06/15 10:30:08 fm Exp $
8 * Supported AVR mikrocontrollers:
13 * ATmega8, ATmega16, ATmega32
15 * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
16 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *---------------------------------------------------------------------------------------------------------------------------------------------------
27 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
28 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
30 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
33 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
34 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
36 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
39 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
40 IRMP_SUPPORT_S100_PROTOCOL == 1 || \
41 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
42 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
43 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
44 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
45 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
46 IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \
47 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
48 # define IRMP_SUPPORT_MANCHESTER 1
50 # define IRMP_SUPPORT_MANCHESTER 0
53 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
54 # define IRMP_SUPPORT_SERIAL 1
56 # define IRMP_SUPPORT_SERIAL 0
59 #define IRMP_KEY_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
61 #define MIN_TOLERANCE_00 1.0 // -0%
62 #define MAX_TOLERANCE_00 1.0 // +0%
64 #define MIN_TOLERANCE_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 ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
92 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
93 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_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 ((uint_fast8_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 ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
99 #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
100 #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
101 #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
102 #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
103 #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
104 #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
106 #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
107 #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
108 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
109 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
110 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
111 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
112 #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
117 #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_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 (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
123 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
126 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
127 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
128 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
129 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
130 #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
131 #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
132 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
133 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
134 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
135 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
137 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
138 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
139 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
140 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
141 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
142 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
143 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
144 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
145 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
146 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
148 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
149 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
150 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
151 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
152 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
153 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
154 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
155 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
156 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
157 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
159 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
160 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
161 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
162 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
163 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
164 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
165 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
167 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
168 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_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 ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
173 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
175 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
176 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
179 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
180 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
182 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
183 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
184 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
186 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
187 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
190 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
191 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
193 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
195 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
196 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
197 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
198 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
203 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
204 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
205 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
206 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
207 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
209 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
210 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
211 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
212 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
213 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
214 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
215 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
217 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
218 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
220 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
221 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
222 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
223 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
224 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
225 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
226 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
227 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
228 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
229 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
231 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
232 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
233 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
234 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
235 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
236 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
237 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
238 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
239 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
240 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
241 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
242 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
244 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
245 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
246 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
247 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
248 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
249 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
250 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
251 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
252 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
253 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
254 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
255 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
257 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
258 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
259 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
260 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
261 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
262 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
263 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
264 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
265 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
266 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
267 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
268 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
270 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
271 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
272 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
275 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
276 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
277 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
278 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
279 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
280 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
281 #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
282 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
283 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
284 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
285 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
286 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
287 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
288 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
289 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
290 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
291 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
292 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
293 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
294 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
295 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
297 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
298 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
299 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
300 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
301 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
302 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
303 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
305 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
306 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
307 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
308 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
309 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
310 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
311 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
312 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
314 #define FDC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
315 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
316 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
317 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
318 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
319 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
320 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
321 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
323 #define FDC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255
325 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
327 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
329 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
330 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
331 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
332 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
333 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
334 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
335 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
336 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
337 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
338 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
340 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
341 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
342 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!
343 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!
344 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
345 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
346 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
347 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
348 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
349 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
350 // autodetect JVC repetition frame within 50 msec:
351 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
353 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
354 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
355 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
356 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
357 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
358 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
359 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
360 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
361 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
362 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
363 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
364 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
365 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
367 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
368 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
369 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
370 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
371 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
372 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
373 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
374 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
375 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
376 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
377 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
378 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
379 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
380 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
382 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
383 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
384 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
385 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
386 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
387 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
388 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
389 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
391 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
392 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
393 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
394 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
395 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
396 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
397 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
398 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
399 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
400 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
402 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
403 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
404 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
405 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
406 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
407 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
408 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
409 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
410 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
411 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
412 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
414 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
415 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
416 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
417 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
418 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
419 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
420 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
421 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
423 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
424 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
425 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
426 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
427 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
428 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
429 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
430 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
432 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
433 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
434 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
435 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
436 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
437 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
438 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
439 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
441 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
442 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
443 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
444 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
445 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
446 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
447 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
448 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
449 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
450 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
451 // autodetect TELEFUNKEN repetition frame within 50 msec:
452 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
454 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
455 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
456 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
457 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
458 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
459 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
460 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
461 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
462 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
463 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
464 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
465 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
466 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
467 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
469 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
470 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
471 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
472 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
473 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
474 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
475 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
476 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
477 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
478 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
479 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
480 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
481 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
482 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
484 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
485 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
486 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
487 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
488 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
489 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
490 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
491 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
492 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
493 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
494 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
495 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
496 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
497 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
499 #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
500 #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
501 #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
502 #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
503 #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
504 #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
505 #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
506 #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
507 #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
508 #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
510 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
511 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
512 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
513 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
514 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
515 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
516 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
517 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
518 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
519 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
520 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
521 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
522 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
523 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
525 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
528 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
529 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
530 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
531 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
532 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
534 static int time_counter
;
537 /******************************* not every PIC compiler knows variadic macros :-(
539 # define ANALYZE_PUTCHAR(a)
540 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
541 # define ANALYZE_PRINTF(...)
542 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
544 # define ANALYZE_NEWLINE()
545 *********************************/
548 #if IRMP_USE_CALLBACK == 1
549 static void (*irmp_callback_ptr
) (uint_fast8_t);
550 #endif // IRMP_USE_CALLBACK == 1
552 #define PARITY_CHECK_OK 1
553 #define PARITY_CHECK_FAILED 0
555 /*---------------------------------------------------------------------------------------------------------------------------------------------------
557 *---------------------------------------------------------------------------------------------------------------------------------------------------
559 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
560 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
561 static const char proto_sircs
[] PROGMEM
= "SIRCS";
562 static const char proto_nec
[] PROGMEM
= "NEC";
563 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
564 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
565 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
566 static const char proto_recs80
[] PROGMEM
= "RECS80";
567 static const char proto_rc5
[] PROGMEM
= "RC5";
568 static const char proto_denon
[] PROGMEM
= "DENON";
569 static const char proto_rc6
[] PROGMEM
= "RC6";
570 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
571 static const char proto_apple
[] PROGMEM
= "APPLE";
572 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
573 static const char proto_nubert
[] PROGMEM
= "NUBERT";
574 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
575 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
576 static const char proto_nokia
[] PROGMEM
= "NOKIA";
577 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
578 static const char proto_fdc
[] PROGMEM
= "FDC";
579 static const char proto_rccar
[] PROGMEM
= "RCCAR";
580 static const char proto_jvc
[] PROGMEM
= "JVC";
581 static const char proto_rc6a
[] PROGMEM
= "RC6A";
582 static const char proto_nikon
[] PROGMEM
= "NIKON";
583 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
584 static const char proto_ir60
[] PROGMEM
= "IR60";
585 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
586 static const char proto_netbox
[] PROGMEM
= "NETBOX";
587 static const char proto_nec16
[] PROGMEM
= "NEC16";
588 static const char proto_nec42
[] PROGMEM
= "NEC42";
589 static const char proto_lego
[] PROGMEM
= "LEGO";
590 static const char proto_thomson
[] PROGMEM
= "THOMSON";
591 static const char proto_bose
[] PROGMEM
= "BOSE";
592 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
593 static const char proto_ortek
[] PROGMEM
= "ORTEK";
594 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
595 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
596 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
597 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
598 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
599 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
600 static const char proto_lgair
[] PROGMEM
= "LGAIR";
601 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
602 static const char proto_merlin
[] PROGMEM
= "MERLIN";
603 static const char proto_pentax
[] PROGMEM
= "PENTAX";
604 static const char proto_fan
[] PROGMEM
= "FAN";
605 static const char proto_s100
[] PROGMEM
= "S100";
606 static const char proto_acp24
[] PROGMEM
= "ACP24";
608 static const char proto_radio1
[] PROGMEM
= "RADIO1";
611 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
665 /*---------------------------------------------------------------------------------------------------------------------------------------------------
667 *---------------------------------------------------------------------------------------------------------------------------------------------------
669 #if IRMP_LOGGING == 1 // logging via UART
671 #if defined(ARM_STM32F4XX)
672 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
673 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
674 # define STM32_GPIO_PORT GPIOA
675 # define STM32_GPIO_PIN GPIO_Pin_2
676 # define STM32_GPIO_SOURCE GPIO_PinSource2
677 # define STM32_UART_AF GPIO_AF_USART2
678 # define STM32_UART_COM USART2
679 # define STM32_UART_BAUD 115200 // 115200 Baud
680 # include "stm32f4xx_usart.h"
681 #elif defined(ARM_STM32F10X)
682 # define STM32_UART_COM USART3 // UART3 on PB10
684 # if IRMP_EXT_LOGGING == 1 // use external logging
685 # include "irmpextlog.h"
686 # else // normal UART log (IRMP_EXT_LOGGING == 0)
688 # ifndef UNIX_OR_WINDOWS
689 # include <util/setbaud.h>
694 #define UART0_UBRRH UBRR0H
695 #define UART0_UBRRL UBRR0L
696 #define UART0_UCSRA UCSR0A
697 #define UART0_UCSRB UCSR0B
698 #define UART0_UCSRC UCSR0C
699 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
700 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
701 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
703 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
705 #define UART0_URSEL_BIT_VALUE (0)
707 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
708 #define UART0_UDR UDR0
709 #define UART0_U2X U2X0
713 #define UART0_UBRRH UBRRH
714 #define UART0_UBRRL UBRRL
715 #define UART0_UCSRA UCSRA
716 #define UART0_UCSRB UCSRB
717 #define UART0_UCSRC UCSRC
718 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
719 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
720 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
722 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
724 #define UART0_URSEL_BIT_VALUE (0)
726 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
727 #define UART0_UDR UDR
728 #define UART0_U2X U2X
731 #endif //IRMP_EXT_LOGGING
732 #endif //ARM_STM32F4XX
734 /*---------------------------------------------------------------------------------------------------------------------------------------------------
736 * @details Initializes UART
737 *---------------------------------------------------------------------------------------------------------------------------------------------------
740 irmp_uart_init (void)
742 #ifndef UNIX_OR_WINDOWS
743 #if defined(ARM_STM32F4XX)
744 GPIO_InitTypeDef GPIO_InitStructure
;
745 USART_InitTypeDef USART_InitStructure
;
747 // Clock enable vom TX Pin
748 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
750 // Clock enable der UART
751 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
753 // UART Alternative-Funktion mit dem IO-Pin verbinden
754 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
756 // UART als Alternative-Funktion mit PushPull
757 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
758 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
759 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
760 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
763 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
764 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
767 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
769 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
770 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
771 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
772 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
773 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
774 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
775 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
776 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
779 USART_Cmd(STM32_UART_COM
, ENABLE
);
781 #elif defined(ARM_STM32F10X)
782 GPIO_InitTypeDef GPIO_InitStructure
;
783 USART_InitTypeDef USART_InitStructure
;
785 // Clock enable vom TX Pin
786 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
788 // Clock enable der UART
789 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
791 // UART als Alternative-Funktion mit PushPull
792 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
793 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
796 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
797 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
800 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
802 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
803 USART_InitStructure
.USART_BaudRate
= 115200;
804 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
805 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
806 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
807 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
808 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
809 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
812 USART_Cmd(STM32_UART_COM
, ENABLE
);
814 #elif defined (__AVR_XMEGA__)
816 PMIC
.CTRL
|= PMIC_HILVLEN_bm
;
818 USARTC1
.BAUDCTRLB
= 0;
819 USARTC1
.BAUDCTRLA
= F_CPU
/153600-1;
820 USARTC1
.CTRLA
= USART_RXCINTLVL_HI_gc
; // High Level (Empfangen)
821 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; //Aktiviert Senden und Empfangen
822 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; //Größe der Zeichen: 8 Bit
823 PORTC
.DIR |= (1<<7); //TXD als Ausgang setzen
824 PORTC
.DIR &= ~(1<<6);
828 #if (IRMP_EXT_LOGGING == 0) // use UART
829 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
830 UART0_UBRRL
= UBRRL_VALUE
;
833 UART0_UCSRA
|= (1<<UART0_U2X
);
835 UART0_UCSRA
&= ~(1<<UART0_U2X
);
838 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
839 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
840 #else // other log method
842 #endif //IRMP_EXT_LOGGING
843 #endif //ARM_STM32F4XX
844 #endif // UNIX_OR_WINDOWS
847 /*---------------------------------------------------------------------------------------------------------------------------------------------------
849 * @details Sends character
850 * @param ch character to be transmitted
851 *---------------------------------------------------------------------------------------------------------------------------------------------------
854 irmp_uart_putc (unsigned char ch
)
856 #ifndef UNIX_OR_WINDOWS
857 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
858 // warten bis altes Byte gesendet wurde
859 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
864 USART_SendData(STM32_UART_COM
, ch
);
868 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
869 USART_SendData(STM32_UART_COM
, '\r');
873 #if (IRMP_EXT_LOGGING == 0)
875 # if defined (__AVR_XMEGA__)
876 while (!(USARTC1
.STATUS
& USART_DREIF_bm
));
880 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
886 #endif //__AVR_XMEGA__
889 sendextlog(ch
); // use external log
891 #endif //IRMP_EXT_LOGGING
892 #endif //ARM_STM32F4XX
895 #endif // UNIX_OR_WINDOWS
898 /*---------------------------------------------------------------------------------------------------------------------------------------------------
900 *---------------------------------------------------------------------------------------------------------------------------------------------------
903 #define STARTCYCLES 2 // min count of zeros before start of logging
904 #define ENDBITS 1000 // number of sequenced highbits to detect end
905 #define DATALEN 700 // log buffer size
908 irmp_log (uint_fast8_t val
)
910 static uint8_t buf
[DATALEN
]; // logging buffer
911 static uint_fast16_t buf_idx
; // index
912 static uint_fast8_t startcycles
; // current number of start-zeros
913 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
914 static uint_fast8_t last_val
= 1;
916 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
924 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
930 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
931 { // if stop condition is true, output on uart
935 uint_fast8_t v
= '1';
938 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
940 irmp_uart_putc ('0'); // the ignored starting zeros
943 for (i
= 0; i
< buf_idx
; i
++)
952 d
|= ((uint_fast16_t) buf
[i
] << 8);
955 for (j
= 0; j
< d
; j
++)
960 v
= (v
== '1') ? '0' : '1';
963 for (i8
= 0; i8
< 20; i8
++)
965 irmp_uart_putc ('1');
968 irmp_uart_putc ('\n');
974 else if (buf_idx
< DATALEN
- 3)
978 buf
[buf_idx
++] = 0xff;
979 buf
[buf_idx
++] = (cnt
& 0xff);
980 buf
[buf_idx
] = (cnt
>> 8);
996 #define irmp_log(val)
997 #endif //IRMP_LOGGING
1001 uint_fast8_t protocol
; // ir protocol
1002 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
1003 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
1004 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
1005 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
1006 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
1007 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
1008 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
1009 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
1010 uint_fast8_t address_offset
; // address offset
1011 uint_fast8_t address_end
; // end of address
1012 uint_fast8_t command_offset
; // command offset
1013 uint_fast8_t command_end
; // end of command
1014 uint_fast8_t complete_len
; // complete length of frame
1015 uint_fast8_t stop_bit
; // flag: frame has stop bit
1016 uint_fast8_t lsb_first
; // flag: LSB first
1017 uint_fast8_t flags
; // some flags
1020 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1022 static const PROGMEM IRMP_PARAMETER sircs_param
=
1024 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
1025 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1026 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1027 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1028 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1029 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1030 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1031 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1032 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1033 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
1034 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
1035 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
1036 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
1037 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1038 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
1039 SIRCS_LSB
, // lsb_first: flag: LSB first
1040 SIRCS_FLAGS
// flags: some flags
1045 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1047 static const PROGMEM IRMP_PARAMETER nec_param
=
1049 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1050 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1051 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1052 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1053 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1054 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1055 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1056 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1057 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1058 NEC_ADDRESS_OFFSET
, // address_offset: address offset
1059 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
1060 NEC_COMMAND_OFFSET
, // command_offset: command offset
1061 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
1062 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1063 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1064 NEC_LSB
, // lsb_first: flag: LSB first
1065 NEC_FLAGS
// flags: some flags
1068 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1070 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1071 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1072 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1073 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1074 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1075 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1076 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1077 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1078 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1079 0, // address_offset: address offset
1080 0, // address_end: end of address
1081 0, // command_offset: command offset
1082 0, // command_end: end of command
1083 0, // complete_len: complete length of frame
1084 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1085 NEC_LSB
, // lsb_first: flag: LSB first
1086 NEC_FLAGS
// flags: some flags
1091 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1093 static const PROGMEM IRMP_PARAMETER nec42_param
=
1095 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1096 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1097 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1098 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1099 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1100 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1101 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1102 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1103 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1104 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1105 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1106 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1107 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1108 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1109 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1110 NEC_LSB
, // lsb_first: flag: LSB first
1111 NEC_FLAGS
// flags: some flags
1116 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1118 static const PROGMEM IRMP_PARAMETER lgair_param
=
1120 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1121 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1122 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1123 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1124 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1125 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1126 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1127 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1128 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1129 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1130 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1131 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1132 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1133 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1134 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1135 NEC_LSB
, // lsb_first: flag: LSB first
1136 NEC_FLAGS
// flags: some flags
1141 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1143 static const PROGMEM IRMP_PARAMETER samsung_param
=
1145 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1146 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1147 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1148 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1149 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1150 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1151 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1152 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1153 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1154 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1155 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1156 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1157 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1158 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1159 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1160 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1161 SAMSUNG_FLAGS
// flags: some flags
1166 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1168 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1170 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1171 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1172 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1173 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1174 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1175 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1176 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1177 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1178 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1179 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1180 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1181 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1182 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1183 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1184 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1185 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1186 TELEFUNKEN_FLAGS
// flags: some flags
1191 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1193 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1195 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1196 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1197 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1198 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1199 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1200 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1201 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1202 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1203 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1204 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1205 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1206 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1207 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1208 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1209 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1210 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1211 MATSUSHITA_FLAGS
// flags: some flags
1216 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1218 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1220 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1221 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1222 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1223 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1224 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1225 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1226 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1227 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1228 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1229 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1230 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1231 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1232 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1233 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1234 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1235 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1236 KASEIKYO_FLAGS
// flags: some flags
1241 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1243 static const PROGMEM IRMP_PARAMETER recs80_param
=
1245 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1246 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1247 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1248 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1249 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1250 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1251 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1252 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1253 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1254 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1255 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1256 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1257 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1258 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1259 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1260 RECS80_LSB
, // lsb_first: flag: LSB first
1261 RECS80_FLAGS
// flags: some flags
1266 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1268 static const PROGMEM IRMP_PARAMETER rc5_param
=
1270 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1271 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1272 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1273 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1274 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1275 0, // pulse_0_len_min: here: not used
1276 0, // pulse_0_len_max: here: not used
1277 0, // pause_0_len_min: here: not used
1278 0, // pause_0_len_max: here: not used
1279 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1280 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1281 RC5_COMMAND_OFFSET
, // command_offset: command offset
1282 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1283 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1284 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1285 RC5_LSB
, // lsb_first: flag: LSB first
1286 RC5_FLAGS
// flags: some flags
1291 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1293 static const PROGMEM IRMP_PARAMETER s100_param
=
1295 IRMP_S100_PROTOCOL
, // protocol: ir protocol
1296 S100_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1297 S100_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1298 S100_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1299 S100_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1300 0, // pulse_0_len_min: here: not used
1301 0, // pulse_0_len_max: here: not used
1302 0, // pause_0_len_min: here: not used
1303 0, // pause_0_len_max: here: not used
1304 S100_ADDRESS_OFFSET
, // address_offset: address offset
1305 S100_ADDRESS_OFFSET
+ S100_ADDRESS_LEN
, // address_end: end of address
1306 S100_COMMAND_OFFSET
, // command_offset: command offset
1307 S100_COMMAND_OFFSET
+ S100_COMMAND_LEN
, // command_end: end of command
1308 S100_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1309 S100_STOP_BIT
, // stop_bit: flag: frame has stop bit
1310 S100_LSB
, // lsb_first: flag: LSB first
1311 S100_FLAGS
// flags: some flags
1316 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1318 static const PROGMEM IRMP_PARAMETER denon_param
=
1320 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1321 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1322 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1323 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1324 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1325 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1326 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1327 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1328 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1329 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1330 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1331 DENON_COMMAND_OFFSET
, // command_offset: command offset
1332 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1333 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1334 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1335 DENON_LSB
, // lsb_first: flag: LSB first
1336 DENON_FLAGS
// flags: some flags
1341 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1343 static const PROGMEM IRMP_PARAMETER rc6_param
=
1345 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1347 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1348 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1349 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1350 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1351 0, // pulse_0_len_min: here: not used
1352 0, // pulse_0_len_max: here: not used
1353 0, // pause_0_len_min: here: not used
1354 0, // pause_0_len_max: here: not used
1355 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1356 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1357 RC6_COMMAND_OFFSET
, // command_offset: command offset
1358 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1359 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1360 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1361 RC6_LSB
, // lsb_first: flag: LSB first
1362 RC6_FLAGS
// flags: some flags
1367 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1369 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1371 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1372 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1373 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1374 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1375 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1376 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1377 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1378 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1379 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1380 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1381 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1382 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1383 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1384 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1385 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1386 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1387 RECS80EXT_FLAGS
// flags: some flags
1392 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1394 static const PROGMEM IRMP_PARAMETER nubert_param
=
1396 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1397 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1398 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1399 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1400 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1401 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1402 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1403 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1404 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1405 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1406 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1407 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1408 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1409 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1410 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1411 NUBERT_LSB
, // lsb_first: flag: LSB first
1412 NUBERT_FLAGS
// flags: some flags
1417 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1419 static const PROGMEM IRMP_PARAMETER fan_param
=
1421 IRMP_FAN_PROTOCOL
, // protocol: ir protocol
1422 FAN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1423 FAN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1424 FAN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1425 FAN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1426 FAN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1427 FAN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1428 FAN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1429 FAN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1430 FAN_ADDRESS_OFFSET
, // address_offset: address offset
1431 FAN_ADDRESS_OFFSET
+ FAN_ADDRESS_LEN
, // address_end: end of address
1432 FAN_COMMAND_OFFSET
, // command_offset: command offset
1433 FAN_COMMAND_OFFSET
+ FAN_COMMAND_LEN
, // command_end: end of command
1434 FAN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1435 FAN_STOP_BIT
, // stop_bit: flag: frame has NO stop bit
1436 FAN_LSB
, // lsb_first: flag: LSB first
1437 FAN_FLAGS
// flags: some flags
1442 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1444 static const PROGMEM IRMP_PARAMETER speaker_param
=
1446 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1447 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1448 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1449 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1450 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1451 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1452 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1453 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1454 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1455 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1456 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1457 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1458 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1459 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1460 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1461 SPEAKER_LSB
, // lsb_first: flag: LSB first
1462 SPEAKER_FLAGS
// flags: some flags
1467 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1469 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1471 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1472 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1473 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1474 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1475 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1476 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1477 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1478 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1479 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1480 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1481 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1482 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1483 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1484 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1485 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1486 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1487 BANG_OLUFSEN_FLAGS
// flags: some flags
1492 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1494 static uint_fast8_t first_bit
;
1496 static const PROGMEM IRMP_PARAMETER grundig_param
=
1498 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1500 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1501 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1502 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1503 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1504 0, // pulse_0_len_min: here: not used
1505 0, // pulse_0_len_max: here: not used
1506 0, // pause_0_len_min: here: not used
1507 0, // pause_0_len_max: here: not used
1508 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1509 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1510 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1511 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1512 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1513 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1514 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1515 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1520 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1522 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1524 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1525 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1526 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1527 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1528 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1529 0, // pulse_0_len_min: here: not used
1530 0, // pulse_0_len_max: here: not used
1531 0, // pause_0_len_min: here: not used
1532 0, // pause_0_len_max: here: not used
1533 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1534 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1535 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1536 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1537 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1538 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1539 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1540 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1545 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1547 static const PROGMEM IRMP_PARAMETER fdc_param
=
1549 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1550 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1551 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1552 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1553 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1554 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1555 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1556 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1557 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1558 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1559 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1560 FDC_COMMAND_OFFSET
, // command_offset: command offset
1561 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1562 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1563 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1564 FDC_LSB
, // lsb_first: flag: LSB first
1565 FDC_FLAGS
// flags: some flags
1570 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1572 static const PROGMEM IRMP_PARAMETER rccar_param
=
1574 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1575 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1576 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1577 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1578 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1579 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1580 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1581 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1582 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1583 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1584 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1585 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1586 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1587 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1588 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1589 RCCAR_LSB
, // lsb_first: flag: LSB first
1590 RCCAR_FLAGS
// flags: some flags
1595 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1597 static const PROGMEM IRMP_PARAMETER nikon_param
=
1599 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1600 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1601 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1602 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1603 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1604 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1605 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1606 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1607 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1608 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1609 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1610 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1611 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1612 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1613 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1614 NIKON_LSB
, // lsb_first: flag: LSB first
1615 NIKON_FLAGS
// flags: some flags
1620 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1622 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1624 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1625 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1626 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1627 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1628 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1629 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1630 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1631 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1632 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1633 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1634 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1635 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1636 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1637 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1638 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1639 KATHREIN_LSB
, // lsb_first: flag: LSB first
1640 KATHREIN_FLAGS
// flags: some flags
1645 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1647 static const PROGMEM IRMP_PARAMETER netbox_param
=
1649 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1650 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1651 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1652 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1653 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1654 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1655 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1656 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1657 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1658 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1659 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1660 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1661 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1662 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1663 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1664 NETBOX_LSB
, // lsb_first: flag: LSB first
1665 NETBOX_FLAGS
// flags: some flags
1670 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1672 static const PROGMEM IRMP_PARAMETER lego_param
=
1674 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1675 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1676 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1677 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1678 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1679 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1680 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1681 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1682 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1683 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1684 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1685 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1686 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1687 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1688 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1689 LEGO_LSB
, // lsb_first: flag: LSB first
1690 LEGO_FLAGS
// flags: some flags
1695 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1697 static const PROGMEM IRMP_PARAMETER thomson_param
=
1699 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1700 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1701 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1702 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1703 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1704 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1705 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1706 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1707 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1708 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1709 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1710 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1711 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1712 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1713 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1714 THOMSON_LSB
, // lsb_first: flag: LSB first
1715 THOMSON_FLAGS
// flags: some flags
1720 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1722 static const PROGMEM IRMP_PARAMETER bose_param
=
1724 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1725 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1726 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1727 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1728 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1729 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1730 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1731 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1732 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1733 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1734 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1735 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1736 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1737 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1738 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1739 BOSE_LSB
, // lsb_first: flag: LSB first
1740 BOSE_FLAGS
// flags: some flags
1745 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1747 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1749 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1751 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1752 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1753 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1754 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1755 0, // pulse_0_len_min: here: not used
1756 0, // pulse_0_len_max: here: not used
1757 0, // pause_0_len_min: here: not used
1758 0, // pause_0_len_max: here: not used
1759 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1760 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1761 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1762 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1763 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1764 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1765 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1766 A1TVBOX_FLAGS
// flags: some flags
1771 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
1773 static const PROGMEM IRMP_PARAMETER merlin_param
=
1775 IRMP_MERLIN_PROTOCOL
, // protocol: ir protocol
1777 MERLIN_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1778 MERLIN_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1779 MERLIN_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1780 MERLIN_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1781 0, // pulse_0_len_min: here: not used
1782 0, // pulse_0_len_max: here: not used
1783 0, // pause_0_len_min: here: not used
1784 0, // pause_0_len_max: here: not used
1785 MERLIN_ADDRESS_OFFSET
, // address_offset: address offset
1786 MERLIN_ADDRESS_OFFSET
+ MERLIN_ADDRESS_LEN
, // address_end: end of address
1787 MERLIN_COMMAND_OFFSET
, // command_offset: command offset
1788 MERLIN_COMMAND_OFFSET
+ MERLIN_COMMAND_LEN
, // command_end: end of command
1789 MERLIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1790 MERLIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1791 MERLIN_LSB
, // lsb_first: flag: LSB first
1792 MERLIN_FLAGS
// flags: some flags
1797 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1799 static const PROGMEM IRMP_PARAMETER ortek_param
=
1801 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1803 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1804 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1805 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1806 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1807 0, // pulse_0_len_min: here: not used
1808 0, // pulse_0_len_max: here: not used
1809 0, // pause_0_len_min: here: not used
1810 0, // pause_0_len_max: here: not used
1811 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1812 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1813 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1814 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1815 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1816 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1817 ORTEK_LSB
, // lsb_first: flag: LSB first
1818 ORTEK_FLAGS
// flags: some flags
1823 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1825 static const PROGMEM IRMP_PARAMETER roomba_param
=
1827 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1828 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1829 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1830 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1831 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1832 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1833 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1834 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1835 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1836 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1837 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1838 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1839 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1840 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1841 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1842 ROOMBA_LSB
, // lsb_first: flag: LSB first
1843 ROOMBA_FLAGS
// flags: some flags
1848 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1850 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1852 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1854 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1855 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1856 0, // pause_1_len_min: here: minimum length of short pause
1857 0, // pause_1_len_max: here: maximum length of short pause
1858 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1859 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1860 0, // pause_0_len_min: here: not used
1861 0, // pause_0_len_max: here: not used
1862 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1863 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1864 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1865 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1866 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1867 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1868 RCMM32_LSB
, // lsb_first: flag: LSB first
1869 RCMM32_FLAGS
// flags: some flags
1874 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
1876 static const PROGMEM IRMP_PARAMETER pentax_param
=
1878 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
1879 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1880 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1881 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1882 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1883 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1884 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1885 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1886 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1887 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
1888 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
1889 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
1890 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
1891 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1892 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1893 PENTAX_LSB
, // lsb_first: flag: LSB first
1894 PENTAX_FLAGS
// flags: some flags
1899 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
1901 static const PROGMEM IRMP_PARAMETER acp24_param
=
1903 IRMP_ACP24_PROTOCOL
, // protocol: ir protocol
1904 ACP24_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1905 ACP24_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1906 ACP24_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1907 ACP24_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1908 ACP24_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1909 ACP24_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1910 ACP24_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1911 ACP24_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1912 ACP24_ADDRESS_OFFSET
, // address_offset: address offset
1913 ACP24_ADDRESS_OFFSET
+ ACP24_ADDRESS_LEN
, // address_end: end of address
1914 ACP24_COMMAND_OFFSET
, // command_offset: command offset
1915 ACP24_COMMAND_OFFSET
+ ACP24_COMMAND_LEN
, // command_end: end of command
1916 ACP24_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1917 ACP24_STOP_BIT
, // stop_bit: flag: frame has stop bit
1918 ACP24_LSB
, // lsb_first: flag: LSB first
1919 ACP24_FLAGS
// flags: some flags
1924 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
1926 static const PROGMEM IRMP_PARAMETER radio1_param
=
1928 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
1930 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1931 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1932 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1933 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1934 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1935 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1936 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1937 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1938 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
1939 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
1940 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
1941 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
1942 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1943 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
1944 RADIO1_LSB
, // lsb_first: flag: LSB first
1945 RADIO1_FLAGS
// flags: some flags
1950 static uint_fast8_t irmp_bit
; // current bit position
1951 static IRMP_PARAMETER irmp_param
;
1953 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1954 static IRMP_PARAMETER irmp_param2
;
1957 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
1958 static volatile uint_fast8_t irmp_protocol
;
1959 static volatile uint_fast16_t irmp_address
;
1960 static volatile uint_fast16_t irmp_command
;
1961 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
1962 static volatile uint_fast8_t irmp_flags
;
1963 // static volatile uint_fast8_t irmp_busy_flag;
1966 #define input(x) (x)
1967 static uint_fast8_t IRMP_PIN
;
1968 static uint_fast8_t radio
;
1971 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1972 * Initialize IRMP decoder
1973 * @details Configures IRMP input pin
1974 *---------------------------------------------------------------------------------------------------------------------------------------------------
1980 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
1981 #elif defined (ARM_STM32) // STM32
1982 GPIO_InitTypeDef GPIO_InitStructure
;
1984 /* GPIOx clock enable */
1985 #if defined (ARM_STM32L1XX)
1986 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1987 #elif defined (ARM_STM32F10X)
1988 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1989 #elif defined (ARM_STM32F4XX)
1990 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1993 /* GPIO Configuration */
1994 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
1995 #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
1996 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
1997 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1998 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
1999 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
2000 #elif defined (ARM_STM32F10X)
2001 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2002 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
2004 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
2005 #elif defined(STELLARIS_ARM_CORTEX_M4)
2006 // Enable the GPIO port
2007 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
2010 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
2011 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
,
2013 GPIO_PIN_TYPE_STD_WPU
);
2015 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
2016 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
2019 #if IRMP_LOGGING == 1
2024 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2026 * @details gets decoded IRMP data
2027 * @param pointer in order to store IRMP data
2028 * @return TRUE: successful, FALSE: failed
2029 *---------------------------------------------------------------------------------------------------------------------------------------------------
2032 irmp_get_data (IRMP_DATA
* irmp_data_p
)
2034 uint_fast8_t rtc
= FALSE
;
2036 if (irmp_ir_detected
)
2038 switch (irmp_protocol
)
2040 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2041 case IRMP_SAMSUNG_PROTOCOL
:
2042 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2044 irmp_command
&= 0xff;
2045 irmp_command
|= irmp_id
<< 8;
2050 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2051 case IRMP_SAMSUNG48_PROTOCOL
:
2052 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2058 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2059 case IRMP_NEC_PROTOCOL
:
2060 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2062 irmp_command
&= 0xff;
2065 else if (irmp_address
== 0x87EE)
2068 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2070 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2071 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2072 irmp_command
&= 0x00FF;
2077 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2078 case IRMP_BOSE_PROTOCOL
:
2079 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2081 irmp_command
&= 0xff;
2086 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2087 case IRMP_SIEMENS_PROTOCOL
:
2088 case IRMP_RUWIDO_PROTOCOL
:
2089 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2096 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2097 case IRMP_KATHREIN_PROTOCOL
:
2098 if (irmp_command
!= 0x0000)
2104 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2105 case IRMP_RC5_PROTOCOL
:
2106 irmp_address
&= ~0x20; // clear toggle bit
2110 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2111 case IRMP_S100_PROTOCOL
:
2112 irmp_address
&= ~0x20; // clear toggle bit
2116 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2117 case IRMP_IR60_PROTOCOL
:
2118 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2125 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2130 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2131 case IRMP_RCCAR_PROTOCOL
:
2132 // frame in irmp_data:
2133 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2134 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2135 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2136 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2137 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2138 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2139 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2143 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2144 case IRMP_NETBOX_PROTOCOL
:
2145 if (irmp_command
& 0x1000) // last bit set?
2147 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2150 irmp_command
&= 0x7F;
2153 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2156 irmp_command
|= 0x80;
2162 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2169 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2174 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2175 case IRMP_LEGO_PROTOCOL
:
2177 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2179 if ((irmp_command
& 0x000F) == crc
)
2187 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2189 // rtc = TRUE; // don't accept codes with CRC errors
2204 irmp_data_p
->protocol
= irmp_protocol
;
2205 irmp_data_p
->address
= irmp_address
;
2206 irmp_data_p
->command
= irmp_command
;
2207 irmp_data_p
->flags
= irmp_flags
;
2213 irmp_ir_detected
= FALSE
;
2219 #if IRMP_USE_CALLBACK == 1
2221 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2223 irmp_callback_ptr
= cb
;
2225 #endif // IRMP_USE_CALLBACK == 1
2227 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2228 static uint_fast16_t irmp_tmp_address
; // ir address
2229 static uint_fast16_t irmp_tmp_command
; // ir command
2231 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2232 static uint_fast16_t irmp_tmp_address2
; // ir address
2233 static uint_fast16_t irmp_tmp_command2
; // ir command
2236 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2237 static uint_fast16_t irmp_lgair_address
; // ir address
2238 static uint_fast16_t irmp_lgair_command
; // ir command
2241 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2242 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2244 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2245 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2246 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2249 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2250 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2253 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2255 * @details store bit in temp address or temp command
2256 * @param value to store: 0 or 1
2257 *---------------------------------------------------------------------------------------------------------------------------------------------------
2259 // verhindert, dass irmp_store_bit() inline compiliert wird:
2260 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2263 irmp_store_bit (uint_fast8_t value
)
2265 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2266 if (irmp_param
.protocol
== IRMP_ACP24_PROTOCOL
) // squeeze 64 bits into 16 bits:
2272 // 0123456789012345678901234567890123456789012345678901234567890123456789
2273 // N VVMMM ? ??? t vmA x y TTTT
2275 // irmp_data_p->command:
2282 case 0: irmp_tmp_command
|= (1<<15); break; // N
2283 case 2: irmp_tmp_command
|= (1<<13); break; // V
2284 case 3: irmp_tmp_command
|= (1<<12); break; // V
2285 case 4: irmp_tmp_command
|= (1<<10); break; // M
2286 case 5: irmp_tmp_command
|= (1<< 9); break; // M
2287 case 6: irmp_tmp_command
|= (1<< 8); break; // M
2288 case 20: irmp_tmp_command
|= (1<< 6); break; // t
2289 case 22: irmp_tmp_command
|= (1<<11); break; // v
2290 case 23: irmp_tmp_command
|= (1<< 7); break; // m
2291 case 24: irmp_tmp_command
|= (1<<14); break; // A
2292 case 26: irmp_tmp_command
|= (1<< 5); break; // x
2293 case 44: irmp_tmp_command
|= (1<< 4); break; // y
2294 case 66: irmp_tmp_command
|= (1<< 3); break; // T
2295 case 67: irmp_tmp_command
|= (1<< 2); break; // T
2296 case 68: irmp_tmp_command
|= (1<< 1); break; // T
2297 case 69: irmp_tmp_command
|= (1<< 0); break; // T
2302 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2304 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2305 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2314 else if (irmp_bit
== 14)
2316 if (value
) // value == 1: even parity
2320 parity
= PARITY_CHECK_FAILED
;
2324 parity
= PARITY_CHECK_OK
;
2329 if (parity
& 0x01) // value == 0: odd parity
2331 parity
= PARITY_CHECK_OK
;
2335 parity
= PARITY_CHECK_FAILED
;
2346 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2347 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2354 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2356 if (irmp_param
.lsb_first
)
2358 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2362 irmp_tmp_address
<<= 1;
2363 irmp_tmp_address
|= value
;
2366 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2368 if (irmp_param
.lsb_first
)
2370 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2371 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2373 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2378 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2383 irmp_tmp_command
<<= 1;
2384 irmp_tmp_command
|= value
;
2388 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2389 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2393 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2394 irmp_lgair_address
|= value
;
2396 else if (irmp_bit
< 24)
2398 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2399 irmp_lgair_command
|= value
;
2405 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2406 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2408 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2413 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2414 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2416 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2421 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2422 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2424 if (irmp_bit
>= 20 && irmp_bit
< 24)
2426 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2428 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2430 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2433 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2437 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2441 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2454 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2456 * @details store bit in temp address or temp command
2457 * @param value to store: 0 or 1
2458 *---------------------------------------------------------------------------------------------------------------------------------------------------
2460 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2462 irmp_store_bit2 (uint_fast8_t value
)
2464 uint_fast8_t irmp_bit2
;
2466 if (irmp_param
.protocol
)
2468 irmp_bit2
= irmp_bit
- 2;
2472 irmp_bit2
= irmp_bit
- 1;
2475 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2477 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2479 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2481 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2484 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2486 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2488 * @details ISR routine, called 10000 times per second
2489 *---------------------------------------------------------------------------------------------------------------------------------------------------
2494 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2495 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2496 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2497 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2498 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2499 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2500 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2501 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2502 static uint_fast8_t repetition_frame_number
;
2503 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2504 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2505 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2507 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2508 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2510 #if IRMP_SUPPORT_MANCHESTER == 1
2511 static PAUSE_LEN last_pause
; // last pause value
2513 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2514 static uint_fast8_t last_value
; // last bit value
2516 uint_fast8_t irmp_input
; // input value
2522 irmp_input
= input(IRMP_PIN
);
2524 #if IRMP_USE_CALLBACK == 1
2525 if (irmp_callback_ptr
)
2527 static uint_fast8_t last_inverted_input
;
2529 if (last_inverted_input
!= !irmp_input
)
2531 (*irmp_callback_ptr
) (! irmp_input
);
2532 last_inverted_input
= !irmp_input
;
2535 #endif // IRMP_USE_CALLBACK == 1
2537 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2539 if (! irmp_ir_detected
) // ir code already detected?
2541 if (! irmp_start_bit_detected
) // start bit detected?
2543 if (! irmp_input
) // receiving burst?
2545 // irmp_busy_flag = TRUE;
2547 if (! irmp_pulse_time
)
2549 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2552 irmp_pulse_time
++; // increment counter
2556 if (irmp_pulse_time
) // it's dark....
2557 { // set flags for counting the time of darkness...
2558 irmp_start_bit_detected
= 1;
2559 wait_for_start_space
= 1;
2561 irmp_tmp_command
= 0;
2562 irmp_tmp_address
= 0;
2563 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2566 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2570 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2571 irmp_tmp_command2
= 0;
2572 irmp_tmp_address2
= 0;
2574 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2575 irmp_lgair_command
= 0;
2576 irmp_lgair_address
= 0;
2579 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2580 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2581 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2586 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2588 key_repetition_len
++;
2590 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2591 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2593 denon_repetition_len
++;
2595 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2598 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2599 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2601 last_irmp_denon_command
= 0;
2602 denon_repetition_len
= 0xFFFF;
2605 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2612 if (wait_for_start_space
) // we have received start bit...
2613 { // ...and are counting the time of darkness
2614 if (irmp_input
) // still dark?
2616 irmp_pause_time
++; // increment counter
2618 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2619 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
) ||
2620 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2622 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2625 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2626 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2631 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2634 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
);
2635 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2639 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2640 irmp_pulse_time
= 0;
2641 irmp_pause_time
= 0;
2645 { // receiving first data pulse!
2646 IRMP_PARAMETER
* irmp_param_p
;
2647 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2649 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2650 irmp_param2
.protocol
= 0;
2654 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2657 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2658 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2659 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2662 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2663 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2664 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2666 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2669 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2671 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2672 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2673 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2674 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2677 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2678 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2679 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2681 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2684 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2686 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2687 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2688 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2690 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2692 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2693 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2694 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2696 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2699 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2700 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2701 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2703 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2706 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2707 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2709 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2710 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2711 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2713 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2714 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2715 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2717 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2720 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2723 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2724 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2725 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2728 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2733 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2734 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2735 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2736 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2737 { // it's JVC repetition type 3
2739 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2740 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2741 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2743 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2746 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2748 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2750 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2751 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2752 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2755 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2756 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2757 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2759 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2762 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2764 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2765 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2766 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2769 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2770 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2771 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2773 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2776 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2778 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2779 if (irmp_pulse_time
>= ACP24_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ACP24_START_BIT_PULSE_LEN_MAX
&&
2780 irmp_pause_time
>= ACP24_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ACP24_START_BIT_PAUSE_LEN_MAX
)
2783 ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2784 ACP24_START_BIT_PULSE_LEN_MIN
, ACP24_START_BIT_PULSE_LEN_MAX
,
2785 ACP24_START_BIT_PAUSE_LEN_MIN
, ACP24_START_BIT_PAUSE_LEN_MAX
);
2787 irmp_param_p
= (IRMP_PARAMETER
*) &acp24_param
;
2790 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2792 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2793 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
2794 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
2797 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2798 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
2799 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
2801 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
2804 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2806 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2807 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2808 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2811 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2812 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2813 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2815 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2818 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2820 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2821 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2822 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2825 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2826 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2827 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2829 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2832 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2834 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2835 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2836 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2837 { // it's MATSUSHITA
2839 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2840 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2841 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2843 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2846 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2848 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2849 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2850 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2853 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2854 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2855 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2857 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2860 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2862 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2863 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2864 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2867 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2868 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2869 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2871 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2874 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2876 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2877 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2878 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2881 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2882 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2883 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2885 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2888 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2890 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2891 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
2892 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
2893 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
2894 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
2897 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2898 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
2899 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
2900 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
2901 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
2904 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
2905 last_pause
= irmp_pause_time
;
2907 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
2908 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
2911 rc5_cmd_bit6
= 1<<6;
2919 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
2921 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2922 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
2923 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
2924 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
2925 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
2927 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2928 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2929 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2932 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
2933 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2934 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2935 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2936 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2937 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2938 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2940 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
2943 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2945 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2946 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2947 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2950 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
2951 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2952 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2953 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2954 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2955 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2956 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2958 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
2961 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2964 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2965 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2966 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
2967 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2968 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
2972 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
2973 last_pause
= irmp_pause_time
;
2975 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
2976 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
2979 rc5_cmd_bit6
= 1<<6;
2987 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
2989 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2990 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
2991 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
2992 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
2995 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2996 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
2997 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
2998 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
3000 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
3003 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3005 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3006 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
3007 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
3008 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
3011 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3012 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3013 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
3014 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
3016 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
3019 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3021 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3022 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
3023 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
3026 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3027 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
3028 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
3030 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
3033 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3035 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3036 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
3037 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
3040 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3041 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
3042 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
3044 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
3049 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3051 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3052 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
3053 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
3056 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3057 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
3058 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
3060 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
3063 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3065 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3066 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
3067 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
3070 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3071 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
3072 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
3074 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
3077 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3079 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3080 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
3081 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
3084 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3085 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
3086 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
3088 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
3091 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3093 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3094 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3095 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3098 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3099 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3100 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3102 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3105 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3107 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3108 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3109 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3110 { // it's BANG_OLUFSEN
3112 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3113 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3114 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3115 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3116 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3117 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3118 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3119 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3120 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3121 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3122 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3123 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3124 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3126 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3130 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3132 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3133 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3134 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3137 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3138 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3139 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3141 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3142 last_pause
= irmp_pause_time
;
3146 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3148 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3149 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3150 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3153 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3154 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3155 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3157 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3162 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3164 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3165 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3166 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3167 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3168 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3169 { // it's RUWIDO or SIEMENS
3171 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3172 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3173 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3174 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3175 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3177 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3178 last_pause
= irmp_pause_time
;
3182 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3184 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3185 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3186 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3189 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3190 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3191 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3193 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3196 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3198 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3199 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3200 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3203 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3204 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3205 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3207 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3210 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3212 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3213 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3214 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3217 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3218 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3219 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3221 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3224 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3226 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3227 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3228 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3231 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3232 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3233 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3235 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3238 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3240 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3241 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3242 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3245 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3246 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3247 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3249 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3252 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3254 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3255 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3256 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3259 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3260 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3261 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3263 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3268 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3270 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3271 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3272 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3273 { // it's ORTEK (Hama)
3275 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3276 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3277 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3279 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3285 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3287 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3288 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3289 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3292 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3293 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3294 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3296 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3299 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3302 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3304 irmp_start_bit_detected
= 0; // wait for another start bit...
3307 if (irmp_start_bit_detected
)
3309 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3311 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3314 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3315 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3321 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3322 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3323 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3324 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3328 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3329 if (irmp_param2
.protocol
)
3332 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3333 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3334 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3335 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3341 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3342 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3345 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3350 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3353 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3354 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3360 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3361 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3362 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3363 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3368 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3369 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3371 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3372 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3376 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3377 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3378 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3379 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3385 #if IRMP_SUPPORT_MANCHESTER == 1
3386 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3387 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3388 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3390 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3393 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3394 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3397 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3399 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3402 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3403 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3406 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3410 #endif // IRMP_SUPPORT_MANCHESTER == 1
3412 #if IRMP_SUPPORT_SERIAL == 1
3413 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3418 #endif // IRMP_SUPPORT_SERIAL == 1
3421 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3422 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3425 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3428 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3429 { // pause timings correct for "1"?
3431 ANALYZE_PUTCHAR ('1'); // yes, store 1
3436 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3437 { // pause timings correct for "0"?
3439 ANALYZE_PUTCHAR ('0'); // yes, store 0
3446 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3447 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3448 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3451 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3454 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3455 { // pause timings correct for "1"?
3457 ANALYZE_PUTCHAR ('1'); // yes, store 1
3462 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3463 { // pause timings correct for "0"?
3465 ANALYZE_PUTCHAR ('0'); // yes, store 0
3472 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3474 ; // else do nothing
3477 irmp_pulse_time
= 1; // set counter to 1, not 0
3478 irmp_pause_time
= 0;
3479 wait_for_start_space
= 0;
3482 else if (wait_for_space
) // the data section....
3483 { // counting the time of darkness....
3484 uint_fast8_t got_light
= FALSE
;
3486 if (irmp_input
) // still dark?
3488 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3491 #if IRMP_SUPPORT_MANCHESTER == 1
3492 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3494 #if IRMP_SUPPORT_SERIAL == 1
3495 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3497 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3500 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3502 ANALYZE_PRINTF ("stop bit detected\n");
3505 irmp_param
.stop_bit
= 0;
3510 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",
3511 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3513 irmp_start_bit_detected
= 0; // wait for another start bit...
3514 irmp_pulse_time
= 0;
3515 irmp_pause_time
= 0;
3520 irmp_pause_time
++; // increment counter
3522 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3523 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3524 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3525 irmp_bit
>= 12 - 1) // pause too long?
3526 { // yes, break and close this frame
3527 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3528 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3529 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3530 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3531 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3535 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3536 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3537 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3538 { // yes, break and close this frame
3539 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3542 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3544 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3546 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3549 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3551 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3556 #if IRMP_SUPPORT_SERIAL == 1
3557 // NETBOX generates no stop bit, here is the timeout condition:
3558 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3559 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3561 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3565 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3566 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3568 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3571 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3573 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3574 irmp_param
.stop_bit
= TRUE
; // set flag
3576 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3577 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3578 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3579 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3580 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3581 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3583 irmp_tmp_command
<<= 1;
3584 irmp_tmp_command
|= first_bit
;
3586 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3587 { // special manchester decoder
3588 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3589 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3590 irmp_param
.stop_bit
= TRUE
; // set flag
3592 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3595 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");
3597 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3598 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3599 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3600 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3601 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3603 if (irmp_tmp_command
& 0x300)
3605 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3606 irmp_tmp_command
&= 0xFF;
3612 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3613 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3615 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3616 { // special manchester decoder
3617 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3618 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3619 irmp_param
.stop_bit
= TRUE
; // set flag
3621 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3624 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3626 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3627 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3628 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3629 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3630 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3633 // RUWIDO: AAAAAAAAACCCCCCCp
3634 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3635 irmp_tmp_address
<<= 2;
3636 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3637 irmp_tmp_command
&= 0x003F;
3638 // irmp_tmp_command <<= 4;
3639 irmp_tmp_command
|= last_value
;
3644 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3645 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3646 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3647 { // break and close this frame
3648 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3650 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3652 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3654 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3657 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3661 #if IRMP_SUPPORT_MANCHESTER == 1
3662 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3663 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3664 { // special manchester decoder
3665 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3666 irmp_param
.stop_bit
= TRUE
; // set flag
3669 #endif // IRMP_SUPPORT_MANCHESTER == 1
3670 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3672 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3676 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3677 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3680 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3682 irmp_param
.stop_bit
= TRUE
; // set flag
3683 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3684 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3685 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3686 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3687 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3689 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3690 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3691 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3694 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3696 irmp_param
.stop_bit
= TRUE
; // set flag
3697 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3698 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3699 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3700 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3701 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3703 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3705 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3706 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3707 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3710 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3712 irmp_param
.stop_bit
= TRUE
; // set flag
3713 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3714 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3716 // 0123456789ABC0123456789ABC0123456701234567
3717 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3718 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3719 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3720 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3722 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3723 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3724 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3727 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3729 irmp_param
.stop_bit
= TRUE
; // set flag
3730 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3731 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3732 irmp_tmp_address
= irmp_lgair_address
;
3733 irmp_tmp_command
= irmp_lgair_command
;
3735 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3736 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3737 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3740 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3742 irmp_param
.stop_bit
= TRUE
; // set flag
3743 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3744 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3746 // 0123456789ABC0123456789ABC0123456701234567
3747 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3748 // JVC: AAAACCCCCCCCCCCC
3749 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3750 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3752 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3753 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3755 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3756 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3759 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3761 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3762 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3763 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3764 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3766 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3768 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3769 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3773 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3774 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3777 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3779 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3781 else // if ((irmp_bit == 24)
3784 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3786 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3788 irmp_param
.stop_bit
= TRUE
; // set flag
3789 irmp_param
.complete_len
= irmp_bit
; // patch length
3791 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3795 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3796 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3798 irmp_start_bit_detected
= 0; // wait for another start bit...
3799 irmp_pulse_time
= 0;
3800 irmp_pause_time
= 0;
3813 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3816 #if IRMP_SUPPORT_MANCHESTER == 1
3817 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3820 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3821 #else // better, but some IR-RCs use asymmetric timings :-/
3822 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3823 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3826 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3827 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3830 ANALYZE_PUTCHAR ('T');
3832 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3847 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3850 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3852 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
3854 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3855 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3858 ANALYZE_PUTCHAR ('T');
3862 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
3875 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3878 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3880 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
3881 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3882 if (! irmp_param2
.protocol
)
3889 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
3893 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
3894 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
3896 uint_fast8_t manchester_value
;
3898 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
3900 manchester_value
= last_value
? 0 : 1;
3901 last_value
= manchester_value
;
3905 manchester_value
= last_value
;
3909 ANALYZE_PUTCHAR (manchester_value
+ '0');
3912 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3913 if (! irmp_param2
.protocol
)
3921 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3922 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
3925 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
3927 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
3928 irmp_param
.address_offset
= 5;
3929 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
3930 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
3931 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
3932 irmp_tmp_address
= 0;
3934 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3936 irmp_store_bit (manchester_value
);
3940 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3941 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
3942 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
3943 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
3944 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
3947 ANALYZE_PUTCHAR ('?');
3949 irmp_param
.protocol
= 0; // switch to FDC, see below
3952 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3953 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3954 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
3955 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
3956 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
3957 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
3960 ANALYZE_PUTCHAR ('?');
3962 irmp_param
.protocol
= 0; // switch to RCCAR, see below
3965 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3968 ANALYZE_PUTCHAR ('?');
3970 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3971 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3973 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3974 irmp_pause_time
= 0;
3978 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3979 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
3981 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
3984 ANALYZE_PRINTF (" 1 (FDC)\n");
3986 irmp_store_bit2 (1);
3988 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
3991 ANALYZE_PRINTF (" 0 (FDC)\n");
3993 irmp_store_bit2 (0);
3996 if (! irmp_param
.protocol
)
3999 ANALYZE_PRINTF ("Switching to FDC protocol\n");
4001 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4002 irmp_param2
.protocol
= 0;
4003 irmp_tmp_address
= irmp_tmp_address2
;
4004 irmp_tmp_command
= irmp_tmp_command2
;
4007 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4008 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4009 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
4011 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
4014 ANALYZE_PRINTF (" 1 (RCCAR)\n");
4016 irmp_store_bit2 (1);
4018 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
4021 ANALYZE_PRINTF (" 0 (RCCAR)\n");
4023 irmp_store_bit2 (0);
4026 if (! irmp_param
.protocol
)
4029 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4031 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4032 irmp_param2
.protocol
= 0;
4033 irmp_tmp_address
= irmp_tmp_address2
;
4034 irmp_tmp_command
= irmp_tmp_command2
;
4037 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4039 last_pause
= irmp_pause_time
;
4043 #endif // IRMP_SUPPORT_MANCHESTER == 1
4045 #if IRMP_SUPPORT_SERIAL == 1
4046 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
4048 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
4051 ANALYZE_PUTCHAR ('1');
4055 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
4057 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
4061 irmp_pulse_time
= 0;
4065 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
4068 ANALYZE_PUTCHAR ('0');
4072 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
4074 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
4078 irmp_pause_time
= 0;
4087 #endif // IRMP_SUPPORT_SERIAL == 1
4089 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4090 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
4092 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
4093 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4096 ANALYZE_PRINTF ("SYNC\n");
4101 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4103 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4105 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4107 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4108 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4109 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4110 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4113 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4115 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4116 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4117 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4118 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4120 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4123 ANALYZE_PUTCHAR ('1');
4132 ANALYZE_PUTCHAR ('0');
4140 { // timing incorrect!
4142 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4143 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4145 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4146 irmp_pause_time
= 0;
4150 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4152 #if IRMP_SUPPORT_NEC16_PROTOCOL
4153 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4154 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4155 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4156 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4157 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4158 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4161 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4163 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4164 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4165 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4166 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4167 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4168 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4172 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4174 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4175 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4177 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4179 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4181 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4184 ANALYZE_PRINTF ("3rd start bit\n");
4190 { // timing incorrect!
4192 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
);
4193 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4195 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4196 irmp_pause_time
= 0;
4199 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4201 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4204 ANALYZE_PRINTF ("trailer bit\n");
4210 { // timing incorrect!
4212 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
);
4213 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4215 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4216 irmp_pause_time
= 0;
4221 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4222 { // pulse & pause timings correct for "1"?
4224 ANALYZE_PUTCHAR ('1');
4231 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4232 { // pulse & pause timings correct for "0"?
4234 ANALYZE_PUTCHAR ('0');
4241 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4244 ANALYZE_PUTCHAR (last_value
+ '0');
4247 irmp_store_bit (last_value
);
4251 { // timing incorrect!
4253 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
);
4254 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4256 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4257 irmp_pause_time
= 0;
4262 { // timing incorrect!
4264 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
);
4265 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4267 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4268 irmp_pause_time
= 0;
4272 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4274 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4275 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4277 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4280 ANALYZE_PUTCHAR ('0');
4281 ANALYZE_PUTCHAR ('0');
4286 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4289 ANALYZE_PUTCHAR ('0');
4290 ANALYZE_PUTCHAR ('1');
4295 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4298 ANALYZE_PUTCHAR ('1');
4299 ANALYZE_PUTCHAR ('0');
4304 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4307 ANALYZE_PUTCHAR ('1');
4308 ANALYZE_PUTCHAR ('1');
4314 ANALYZE_PRINTF ("\n");
4321 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4322 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4323 { // pulse & pause timings correct for "1"?
4325 ANALYZE_PUTCHAR ('1');
4331 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4332 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4333 { // pulse & pause timings correct for "0"?
4335 ANALYZE_PUTCHAR ('0');
4342 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4344 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4345 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4346 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4347 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4349 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4356 ANALYZE_PUTCHAR ('S');
4359 irmp_tmp_command
<<= 1;
4364 ANALYZE_PUTCHAR ('S');
4372 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4373 { // timing incorrect!
4375 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4376 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4378 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4379 irmp_pause_time
= 0;
4382 irmp_pulse_time
= 1; // set counter to 1, not 0
4386 { // counting the pulse length ...
4387 if (! irmp_input
) // still light?
4389 irmp_pulse_time
++; // increment counter
4393 wait_for_space
= 1; // let's count the time (see above)
4394 irmp_pause_time
= 1; // set pause counter to 1, not 0
4398 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4400 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4402 repetition_frame_number
++;
4406 repetition_frame_number
= 0;
4409 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4410 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4411 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4414 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4415 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4417 key_repetition_len
= 0;
4422 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4423 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4424 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4427 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4428 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4430 key_repetition_len
= 0;
4435 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4436 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4437 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4440 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4441 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4443 key_repetition_len
= 0;
4448 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4449 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4450 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4453 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4454 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4456 key_repetition_len
= 0;
4461 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4462 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4463 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4466 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4467 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4469 key_repetition_len
= 0;
4474 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4475 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4476 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4479 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4480 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4482 key_repetition_len
= 0;
4489 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4491 irmp_ir_detected
= TRUE
;
4493 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4494 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4495 { // check for repetition frame
4496 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4498 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4499 last_irmp_denon_command
= 0;
4501 irmp_protocol
= irmp_param
.protocol
; // store protocol
4502 irmp_address
= irmp_tmp_address
; // store address
4503 irmp_command
= irmp_tmp_command
; // store command
4507 if ((irmp_tmp_command
& 0x01) == 0x00)
4510 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4512 last_irmp_denon_command
= irmp_tmp_command
;
4513 denon_repetition_len
= 0;
4514 irmp_ir_detected
= FALSE
;
4519 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4521 last_irmp_denon_command
= 0;
4522 irmp_ir_detected
= FALSE
;
4527 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4529 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4530 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4531 { // Grundig start frame?
4533 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4535 irmp_ir_detected
= FALSE
;
4538 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4540 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4541 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4542 { // Nokia start frame?
4544 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4546 irmp_ir_detected
= FALSE
;
4549 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4551 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4552 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4554 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4557 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4558 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4560 irmp_tmp_address
= last_irmp_address
; // address is last address
4561 irmp_tmp_command
= last_irmp_command
; // command is last command
4562 irmp_flags
|= IRMP_FLAG_REPETITION
;
4563 key_repetition_len
= 0;
4568 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4569 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4571 irmp_ir_detected
= FALSE
;
4574 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4576 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4577 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4579 uint_fast8_t xor_value
;
4581 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4583 if (xor_value
!= (xor_check
[2] & 0x0F))
4586 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4588 irmp_ir_detected
= FALSE
;
4591 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4593 if (xor_value
!= xor_check
[5])
4596 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4598 irmp_ir_detected
= FALSE
;
4601 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4603 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4605 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4606 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4608 if (parity
== PARITY_CHECK_FAILED
)
4611 ANALYZE_PRINTF ("error 6: parity check failed\n");
4613 irmp_ir_detected
= FALSE
;
4616 if ((irmp_tmp_address
& 0x03) == 0x02)
4619 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4621 irmp_ir_detected
= FALSE
;
4623 irmp_tmp_address
>>= 2;
4625 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4627 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4628 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4630 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4633 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4635 irmp_protocol
= irmp_param
.protocol
;
4638 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4639 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4641 if (irmp_tmp_command
& 0x000F) // released key?
4643 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4647 irmp_tmp_command
>>= 4; // no, it's a pressed key
4649 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4650 irmp_tmp_address
&= 0x003F;
4654 irmp_address
= irmp_tmp_address
; // store address
4655 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4656 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4658 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4662 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4663 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4665 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4668 #if IRMP_SUPPORT_S100_PROTOCOL == 1
4669 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
4671 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4674 irmp_command
= irmp_tmp_command
; // store command
4676 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4677 irmp_id
= irmp_tmp_id
;
4682 if (irmp_ir_detected
)
4684 if (last_irmp_command
== irmp_tmp_command
&&
4685 last_irmp_address
== irmp_tmp_address
&&
4686 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4688 irmp_flags
|= IRMP_FLAG_REPETITION
;
4691 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4692 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4694 key_repetition_len
= 0;
4699 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4703 irmp_start_bit_detected
= 0; // and wait for next start bit
4704 irmp_tmp_command
= 0;
4705 irmp_pulse_time
= 0;
4706 irmp_pause_time
= 0;
4708 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4709 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4710 { // set pulse time here!
4711 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4713 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4718 #if defined(STELLARIS_ARM_CORTEX_M4)
4719 // Clear the timer interrupt
4720 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4723 return (irmp_ir_detected
);
4728 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4729 * main functions - for Unix/Linux + Windows only!
4733 * Compile it under linux with:
4736 * usage: ./irmp [-v|-s|-a|-l|-p] < file
4742 * -l list pulse/pauses
4744 *---------------------------------------------------------------------------------------------------------------------------------------------------
4748 print_timings (void)
4750 printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN
, sizeof (PAUSE_LEN
));
4751 printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN
);
4753 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");
4754 printf ("====================================================================================\n");
4755 printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4756 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
, SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
,
4757 SIRCS_0_PULSE_LEN_MIN
, SIRCS_0_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
,
4758 SIRCS_1_PULSE_LEN_MIN
, SIRCS_1_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
);
4760 printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4761 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
,
4762 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4763 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4765 printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4766 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
,
4767 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4768 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4770 printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4771 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
, SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
,
4772 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_0_PAUSE_LEN_MIN
, SAMSUNG_0_PAUSE_LEN_MAX
,
4773 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_1_PAUSE_LEN_MIN
, SAMSUNG_1_PAUSE_LEN_MAX
);
4775 printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4776 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
, MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
,
4777 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_0_PAUSE_LEN_MIN
, MATSUSHITA_0_PAUSE_LEN_MAX
,
4778 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_1_PAUSE_LEN_MIN
, MATSUSHITA_1_PAUSE_LEN_MAX
);
4780 printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4781 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
, KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
,
4782 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_0_PAUSE_LEN_MIN
, KASEIKYO_0_PAUSE_LEN_MAX
,
4783 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_1_PAUSE_LEN_MIN
, KASEIKYO_1_PAUSE_LEN_MAX
);
4785 printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4786 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
, RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
,
4787 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_0_PAUSE_LEN_MIN
, RECS80_0_PAUSE_LEN_MAX
,
4788 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_1_PAUSE_LEN_MIN
, RECS80_1_PAUSE_LEN_MAX
);
4790 printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",
4791 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
, RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
4792 RC5_BIT_LEN_MIN
, RC5_BIT_LEN_MAX
);
4794 printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4795 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
4796 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
,
4797 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
);
4799 printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4800 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
4801 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
,
4802 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
);
4804 printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4805 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
, RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
,
4806 RC6_BIT_PULSE_LEN_MIN
, RC6_BIT_PULSE_LEN_MAX
, RC6_BIT_PAUSE_LEN_MIN
, RC6_BIT_PAUSE_LEN_MAX
);
4808 printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4809 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
, RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
,
4810 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_0_PAUSE_LEN_MIN
, RECS80EXT_0_PAUSE_LEN_MAX
,
4811 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_1_PAUSE_LEN_MIN
, RECS80EXT_1_PAUSE_LEN_MAX
);
4813 printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4814 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
, NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
,
4815 NUBERT_0_PULSE_LEN_MIN
, NUBERT_0_PULSE_LEN_MAX
, NUBERT_0_PAUSE_LEN_MIN
, NUBERT_0_PAUSE_LEN_MAX
,
4816 NUBERT_1_PULSE_LEN_MIN
, NUBERT_1_PULSE_LEN_MAX
, NUBERT_1_PAUSE_LEN_MIN
, NUBERT_1_PAUSE_LEN_MAX
);
4818 printf ("FAN 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4819 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
, FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
,
4820 FAN_0_PULSE_LEN_MIN
, FAN_0_PULSE_LEN_MAX
, FAN_0_PAUSE_LEN_MIN
, FAN_0_PAUSE_LEN_MAX
,
4821 FAN_1_PULSE_LEN_MIN
, FAN_1_PULSE_LEN_MAX
, FAN_1_PAUSE_LEN_MIN
, FAN_1_PAUSE_LEN_MAX
);
4823 printf ("SPEAKER 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4824 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
, SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
,
4825 SPEAKER_0_PULSE_LEN_MIN
, SPEAKER_0_PULSE_LEN_MAX
, SPEAKER_0_PAUSE_LEN_MIN
, SPEAKER_0_PAUSE_LEN_MAX
,
4826 SPEAKER_1_PULSE_LEN_MIN
, SPEAKER_1_PULSE_LEN_MAX
, SPEAKER_1_PAUSE_LEN_MIN
, SPEAKER_1_PAUSE_LEN_MAX
);
4828 printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",
4829 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
4830 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
4832 printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",
4833 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
4834 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
4836 printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",
4837 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
4838 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
4840 printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",
4841 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
4842 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
4844 printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4845 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_0_PAUSE_LEN_MIN
, BANG_OLUFSEN_0_PAUSE_LEN_MAX
,
4846 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_1_PAUSE_LEN_MIN
, BANG_OLUFSEN_1_PAUSE_LEN_MAX
);
4848 printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",
4849 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
4850 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
,
4851 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
);
4853 printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4854 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
4855 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
4856 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4857 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
,
4858 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4859 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
);
4861 printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4862 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
, FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
,
4863 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_0_PAUSE_LEN_MIN
, FDC_0_PAUSE_LEN_MAX
,
4864 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_1_PAUSE_LEN_MIN
, FDC_1_PAUSE_LEN_MAX
);
4866 printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4867 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
, RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
,
4868 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_0_PAUSE_LEN_MIN
, RCCAR_0_PAUSE_LEN_MAX
,
4869 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_1_PAUSE_LEN_MIN
, RCCAR_1_PAUSE_LEN_MAX
);
4871 printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4872 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
, NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
,
4873 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_0_PAUSE_LEN_MIN
, NIKON_0_PAUSE_LEN_MAX
,
4874 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_1_PAUSE_LEN_MIN
, NIKON_1_PAUSE_LEN_MAX
);
4876 printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4877 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
, LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
,
4878 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_0_PAUSE_LEN_MIN
, LEGO_0_PAUSE_LEN_MAX
,
4879 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_1_PAUSE_LEN_MIN
, LEGO_1_PAUSE_LEN_MAX
);
4882 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE PAUSE-00 PAUSE-01 PAUSE-10 PAUSE-11\n");
4883 printf ("================================================================================================\n");
4884 printf ("RCMM 1 %3d %3d %3d %3d %3d %3d %3d\n",
4885 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PULSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PAUSE_TIME
),
4886 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_PULSE_TIME
),
4887 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_00_PAUSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_01_PAUSE_TIME
),
4888 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_10_PAUSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_11_PAUSE_TIME
));
4889 printf ("RCMM 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4890 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
, RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
,
4891 RCMM32_BIT_PULSE_LEN_MIN
, RCMM32_BIT_PULSE_LEN_MAX
, RCMM32_BIT_00_PAUSE_LEN_MIN
, RCMM32_BIT_00_PAUSE_LEN_MAX
,
4892 RCMM32_BIT_01_PAUSE_LEN_MIN
, RCMM32_BIT_01_PAUSE_LEN_MAX
, RCMM32_BIT_10_PAUSE_LEN_MIN
, RCMM32_BIT_10_PAUSE_LEN_MAX
,
4893 RCMM32_BIT_11_PAUSE_LEN_MIN
, RCMM32_BIT_11_PAUSE_LEN_MAX
);
4897 print_spectrum (char * text
, int * buf
, int is_pulse
)
4910 puts ("-----------------------------------------------------------------------------");
4911 printf ("%s:\n", text
);
4913 for (i
= 0; i
< 256; i
++)
4915 if (buf
[i
] > max_value
)
4921 for (i
= 1; i
< 200; i
++)
4926 value
= (buf
[i
] * 60) / max_value
;
4928 for (j
= 0; j
< value
; j
++)
4932 printf (" %d\n", buf
[i
]);
4943 average
= (float) sum
/ (float) counter
;
4954 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4955 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4956 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4958 tolerance
= (max
- average
);
4960 if (average
- min
> tolerance
)
4962 tolerance
= average
- min
;
4965 tolerance
= tolerance
* 100 / average
;
4966 printf ("tol: %4.1f%%\n", tolerance
);
4976 #define STATE_LEFT_SHIFT 0x01
4977 #define STATE_RIGHT_SHIFT 0x02
4978 #define STATE_LEFT_CTRL 0x04
4979 #define STATE_LEFT_ALT 0x08
4980 #define STATE_RIGHT_ALT 0x10
4982 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4983 #define KEY_MENUE 0x80 // keycode = 0x0070
4984 #define KEY_BACK 0x81 // keycode = 0x0071
4985 #define KEY_FORWARD 0x82 // keycode = 0x0072
4986 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4987 #define KEY_WINDOW 0x84 // keycode = 0x0074
4988 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4989 #define KEY_STOP 0x86 // keycode = 0x0076
4990 #define KEY_MAIL 0x87 // keycode = 0x0077
4991 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4992 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4993 #define KEY_SETUP 0x8A // keycode = 0x007a
4994 #define KEY_FONT 0x8B // keycode = 0x007b
4995 #define KEY_PRINT 0x8C // keycode = 0x007c
4996 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4998 #define KEY_INSERT 0x90 // keycode = 0x004b
4999 #define KEY_DELETE 0x91 // keycode = 0x004c
5000 #define KEY_LEFT 0x92 // keycode = 0x004f
5001 #define KEY_HOME 0x93 // keycode = 0x0050
5002 #define KEY_END 0x94 // keycode = 0x0051
5003 #define KEY_UP 0x95 // keycode = 0x0053
5004 #define KEY_DOWN 0x96 // keycode = 0x0054
5005 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
5006 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
5007 #define KEY_RIGHT 0x99 // keycode = 0x0059
5008 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
5009 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
5012 get_fdc_key (uint_fast16_t cmd
)
5014 static uint8_t key_table
[128] =
5016 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
5017 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
5018 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
5019 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
5020 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
5022 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
5023 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
5024 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
5025 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5027 static uint_fast8_t state
;
5029 uint_fast8_t key
= 0;
5033 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
5034 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
5035 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
5036 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
5037 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
5038 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
5039 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
5040 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
5041 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
5042 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
5044 case 0x006e: key
= KEY_ESCAPE
; break;
5045 case 0x004b: key
= KEY_INSERT
; break;
5046 case 0x004c: key
= KEY_DELETE
; break;
5047 case 0x004f: key
= KEY_LEFT
; break;
5048 case 0x0050: key
= KEY_HOME
; break;
5049 case 0x0051: key
= KEY_END
; break;
5050 case 0x0053: key
= KEY_UP
; break;
5051 case 0x0054: key
= KEY_DOWN
; break;
5052 case 0x0055: key
= KEY_PAGE_UP
; break;
5053 case 0x0056: key
= KEY_PAGE_DOWN
; break;
5054 case 0x0059: key
= KEY_RIGHT
; break;
5055 case 0x0400: key
= KEY_MOUSE_1
; break;
5056 case 0x0800: key
= KEY_MOUSE_2
; break;
5060 if (!(cmd
& 0x80)) // pressed key
5062 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
5064 key
= cmd
+ 0x10; // 7x -> 8x
5066 else if (cmd
< 64) // key listed in key_table
5068 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
5072 case 0x0003: key
= '²'; break;
5073 case 0x0008: key
= '{'; break;
5074 case 0x0009: key
= '['; break;
5075 case 0x000A: key
= ']'; break;
5076 case 0x000B: key
= '}'; break;
5077 case 0x000C: key
= '\\'; break;
5078 case 0x001C: key
= '~'; break;
5079 case 0x002D: key
= '|'; break;
5080 case 0x0034: key
= 0xB5; break; // Mu
5083 else if (state
& (STATE_LEFT_CTRL
))
5085 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
5087 key
= key_table
[cmd
] - 'a' + 1;
5091 key
= key_table
[cmd
];
5096 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5100 key
= key_table
[idx
];
5112 static int analyze
= FALSE
;
5113 static int list
= FALSE
;
5114 static IRMP_DATA irmp_data
;
5115 static int expected_protocol
;
5116 static int expected_address
;
5117 static int expected_command
;
5118 static int do_check_expected_values
;
5123 if (! analyze
&& ! list
)
5127 if (irmp_get_data (&irmp_data
))
5131 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5135 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5138 if (irmp_data
.protocol
== IRMP_ACP24_PROTOCOL
)
5140 uint16_t temp
= (irmp_data
.command
& 0x000F) + 15;
5142 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5143 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, temp
);
5145 else if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5147 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5149 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5150 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5152 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5154 char * p
= (char *) NULL
;
5158 case '\t' : p
= "TAB"; break;
5159 case '\r' : p
= "CR"; break;
5160 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5161 case KEY_MENUE
: p
= "MENUE"; break;
5162 case KEY_BACK
: p
= "BACK"; break;
5163 case KEY_FORWARD
: p
= "FORWARD"; break;
5164 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5165 case KEY_WINDOW
: p
= "WINDOW"; break;
5166 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5167 case KEY_STOP
: p
= "STOP"; break;
5168 case KEY_MAIL
: p
= "MAIL"; break;
5169 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5170 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5171 case KEY_SETUP
: p
= "SETUP"; break;
5172 case KEY_FONT
: p
= "FONT"; break;
5173 case KEY_PRINT
: p
= "PRINT"; break;
5174 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5176 case KEY_INSERT
: p
= "INSERT"; break;
5177 case KEY_DELETE
: p
= "DELETE"; break;
5178 case KEY_LEFT
: p
= "LEFT"; break;
5179 case KEY_HOME
: p
= "HOME"; break;
5180 case KEY_END
: p
= "END"; break;
5181 case KEY_UP
: p
= "UP"; break;
5182 case KEY_DOWN
: p
= "DOWN"; break;
5183 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5184 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5185 case KEY_RIGHT
: p
= "RIGHT"; break;
5186 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5187 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5188 default : p
= "<UNKNWON>"; break;
5191 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5192 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5196 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5197 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5202 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5203 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5206 if (do_check_expected_values
)
5208 if (irmp_data
.protocol
!= expected_protocol
||
5209 irmp_data
.address
!= expected_address
||
5210 irmp_data
.command
!= expected_command
)
5212 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5213 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5217 printf (" checked!\n");
5219 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5230 main (int argc
, char ** argv
)
5238 int start_pulses
[256];
5239 int start_pauses
[256];
5243 int first_pulse
= TRUE
;
5244 int first_pause
= TRUE
;
5248 if (! strcmp (argv
[1], "-v"))
5252 else if (! strcmp (argv
[1], "-l"))
5256 else if (! strcmp (argv
[1], "-a"))
5260 else if (! strcmp (argv
[1], "-s"))
5264 else if (! strcmp (argv
[1], "-p"))
5269 else if (! strcmp (argv
[1], "-r"))
5275 for (i
= 0; i
< 256; i
++)
5277 start_pulses
[i
] = 0;
5278 start_pauses
[i
] = 0;
5285 while ((ch
= getchar ()) != EOF
)
5287 if (ch
== '_' || ch
== '0')
5295 printf ("pause: %d\n", pause
);
5304 start_pauses
[pause
]++;
5306 first_pause
= FALSE
;
5322 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5328 printf ("pulse: %d ", pulse
);
5337 start_pulses
[pulse
]++;
5339 first_pulse
= FALSE
;
5355 else if (ch
== '\n')
5360 if (list
&& pause
> 0)
5362 printf ("pause: %d\n", pause
);
5368 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5382 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5393 puts ("----------------------------------------------------------------------");
5397 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5399 if (ch
!= '\r') // ignore CR in DOS/Windows files
5401 if (ch
== '[' && idx
== -1)
5409 do_check_expected_values
= FALSE
;
5413 expected_protocol
= atoi (buf
);
5415 if (expected_protocol
> 0)
5424 if (sscanf (p
, "%x", &expected_address
) == 1)
5426 do_check_expected_values
= TRUE
;
5433 if (do_check_expected_values
)
5435 do_check_expected_values
= FALSE
;
5443 if (sscanf (p
, "%x", &expected_command
) == 1)
5445 do_check_expected_values
= TRUE
;
5452 if (do_check_expected_values
)
5454 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5459 else if (idx
< 1024 - 2)
5479 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5480 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5481 print_spectrum ("PULSES", pulses
, TRUE
);
5482 print_spectrum ("PAUSES", pauses
, FALSE
);
5483 puts ("-----------------------------------------------------------------------------");