1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.140 2013/03/19 15:11:55 fm Exp $
10 * Supported mikrocontrollers:
15 * ATmega8, ATmega16, ATmega32
17 * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
18 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
24 *---------------------------------------------------------------------------------------------------------------------------------------------------
29 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
30 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
32 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
35 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
36 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
38 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
41 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
42 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
43 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
44 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
45 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
46 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
47 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
48 # define IRMP_SUPPORT_MANCHESTER 1
50 # define IRMP_SUPPORT_MANCHESTER 0
53 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
54 # define IRMP_SUPPORT_SERIAL 1
56 # define IRMP_SUPPORT_SERIAL 0
59 #define IRMP_KEY_REPETITION_LEN (uint16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
61 #define MIN_TOLERANCE_00 1.0 // -0%
62 #define MAX_TOLERANCE_00 1.0 // +0%
64 #define MIN_TOLERANCE_05 0.95 // -5%
65 #define MAX_TOLERANCE_05 1.05 // +5%
67 #define MIN_TOLERANCE_10 0.9 // -10%
68 #define MAX_TOLERANCE_10 1.1 // +10%
70 #define MIN_TOLERANCE_15 0.85 // -15%
71 #define MAX_TOLERANCE_15 1.15 // +15%
73 #define MIN_TOLERANCE_20 0.8 // -20%
74 #define MAX_TOLERANCE_20 1.2 // +20%
76 #define MIN_TOLERANCE_30 0.7 // -30%
77 #define MAX_TOLERANCE_30 1.3 // +30%
79 #define MIN_TOLERANCE_40 0.6 // -40%
80 #define MAX_TOLERANCE_40 1.4 // +40%
82 #define MIN_TOLERANCE_50 0.5 // -50%
83 #define MAX_TOLERANCE_50 1.5 // +50%
85 #define MIN_TOLERANCE_60 0.4 // -60%
86 #define MAX_TOLERANCE_60 1.6 // +60%
88 #define MIN_TOLERANCE_70 0.3 // -70%
89 #define MAX_TOLERANCE_70 1.7 // +70%
91 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
92 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
93 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
94 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
95 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
96 #else // only 5% + 1 to avoid conflict with RC6:
97 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
99 #define SIRCS_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
100 #define SIRCS_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
101 #define SIRCS_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
102 #define SIRCS_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
103 #define SIRCS_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
104 #define SIRCS_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
106 #define NEC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
107 #define NEC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
108 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
109 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
110 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
111 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
112 #define NEC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 #define NEC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
117 #define NEC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
118 // autodetect nec repetition frame within 50 msec:
119 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
121 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
123 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
126 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
127 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
128 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
129 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
130 #define SAMSUNG_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
131 #define SAMSUNG_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
132 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
133 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
134 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
135 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
137 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
138 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
139 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
140 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
141 #define MATSUSHITA_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
142 #define MATSUSHITA_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
143 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
144 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
145 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
146 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
148 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
149 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
150 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
151 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
152 #define KASEIKYO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
153 #define KASEIKYO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
154 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
155 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
156 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
157 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
159 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
160 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
161 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
162 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
163 #define RECS80_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
164 #define RECS80_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
165 #define RECS80_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define RECS80_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
167 #define RECS80_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
168 #define RECS80_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
171 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
172 #define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
173 #define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
175 #define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
176 #define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
179 #define RC5_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
180 #define RC5_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
182 #define DENON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
183 #define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
184 #define DENON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
185 #define DENON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
186 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
187 #define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
188 #define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
189 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define THOMSON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
192 #define THOMSON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
193 #define THOMSON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define THOMSON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
195 #define THOMSON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
196 #define THOMSON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
198 #define RC6_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define RC6_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
201 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define RC6_TOGGLE_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
203 #define RC6_TOGGLE_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
204 #define RC6_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
205 #define RC6_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
206 #define RC6_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
207 #define RC6_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
209 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
210 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
211 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
212 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
213 #define RECS80EXT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
214 #define RECS80EXT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
215 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
217 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
218 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
220 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
221 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
222 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
223 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
224 #define NUBERT_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
225 #define NUBERT_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
226 #define NUBERT_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
227 #define NUBERT_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
228 #define NUBERT_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
229 #define NUBERT_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
230 #define NUBERT_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
231 #define NUBERT_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
233 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
234 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
235 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
236 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
237 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
238 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
239 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
240 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
241 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
242 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
243 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
244 #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
245 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
246 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
247 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
248 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
249 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
250 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
251 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
252 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
253 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
254 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
255 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
256 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
257 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
258 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
260 #define IR60_TIMEOUT_LEN ((uint8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
261 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
262 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
263 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
264 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
265 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
266 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
268 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
269 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
270 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
271 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
272 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
275 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
277 #define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
278 #define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
279 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
280 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
281 #define FDC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
282 #define FDC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
283 #define FDC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
284 #define FDC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
286 #define FDC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255
288 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
290 #define FDC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
292 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
293 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
294 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
295 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
296 #define RCCAR_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
297 #define RCCAR_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
298 #define RCCAR_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
299 #define RCCAR_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
300 #define RCCAR_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
301 #define RCCAR_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
303 #define JVC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
304 #define JVC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
305 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!
306 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!
307 #define JVC_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
308 #define JVC_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
309 #define JVC_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
310 #define JVC_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
311 #define JVC_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
312 #define JVC_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
313 // autodetect JVC repetition frame within 50 msec:
314 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
316 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
317 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
318 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
319 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
320 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
321 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
322 #define NIKON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
323 #define NIKON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
324 #define NIKON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
325 #define NIKON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
326 #define NIKON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
327 #define NIKON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
328 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
330 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
331 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
332 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
333 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
334 #define KATHREIN_1_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
335 #define KATHREIN_1_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
336 #define KATHREIN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
337 #define KATHREIN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
338 #define KATHREIN_0_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
339 #define KATHREIN_0_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
340 #define KATHREIN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
341 #define KATHREIN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
342 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
343 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
345 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
346 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
347 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
348 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
349 #define NETBOX_PULSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
350 #define NETBOX_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
351 #define NETBOX_PULSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
352 #define NETBOX_PAUSE_REST_LEN ((uint8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
354 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
355 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
356 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
357 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
358 #define LEGO_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
359 #define LEGO_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
360 #define LEGO_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
361 #define LEGO_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
362 #define LEGO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
363 #define LEGO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
365 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
366 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
367 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
368 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
369 #define BOSE_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
370 #define BOSE_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
371 #define BOSE_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
372 #define BOSE_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
373 #define BOSE_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
374 #define BOSE_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
375 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
377 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
378 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
379 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
380 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
381 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
382 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
383 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
384 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
386 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
387 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
388 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
389 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
390 #define ORTEK_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
391 #define ORTEK_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
392 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
393 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
395 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
396 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
397 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
398 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
399 #define TELEFUNKEN_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
400 #define TELEFUNKEN_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
401 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
402 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
403 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
404 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
405 // autodetect TELEFUNKEN repetition frame within 50 msec:
406 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
408 #define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t!
411 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
412 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
413 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
414 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
415 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
417 static int time_counter
;
420 # define ANALYZE_PUTCHAR(a)
421 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
422 # define ANALYZE_PRINTF(...)
423 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
424 # define ANALYZE_NEWLINE()
427 #if IRMP_USE_CALLBACK == 1
428 static void (*irmp_callback_ptr
) (uint8_t);
429 #endif // IRMP_USE_CALLBACK == 1
431 /*---------------------------------------------------------------------------------------------------------------------------------------------------
433 *---------------------------------------------------------------------------------------------------------------------------------------------------
435 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
437 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] =
477 /*---------------------------------------------------------------------------------------------------------------------------------------------------
479 *---------------------------------------------------------------------------------------------------------------------------------------------------
481 #if IRMP_LOGGING == 1 // logging via UART
483 #if IRMP_EXT_LOGGING == 1 // use external logging
484 #include "irmpextlog.h"
485 #else // normal UART log (IRMP_EXT_LOGGING == 0)
487 #ifndef UNIX_OR_WINDOWS
488 #include <util/setbaud.h>
493 #define UART0_UBRRH UBRR0H
494 #define UART0_UBRRL UBRR0L
495 #define UART0_UCSRA UCSR0A
496 #define UART0_UCSRB UCSR0B
497 #define UART0_UCSRC UCSR0C
498 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
499 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
500 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
502 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
504 #define UART0_URSEL_BIT_VALUE (0)
506 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
507 #define UART0_UDR UDR0
508 #define UART0_U2X U2X0
512 #define UART0_UBRRH UBRRH
513 #define UART0_UBRRL UBRRL
514 #define UART0_UCSRA UCSRA
515 #define UART0_UCSRB UCSRB
516 #define UART0_UCSRC UCSRC
517 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
518 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
519 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
521 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
523 #define UART0_URSEL_BIT_VALUE (0)
525 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
526 #define UART0_UDR UDR
527 #define UART0_U2X U2X
530 #endif //IRMP_EXT_LOGGING
532 /*---------------------------------------------------------------------------------------------------------------------------------------------------
534 * @details Initializes UART
535 *---------------------------------------------------------------------------------------------------------------------------------------------------
538 irmp_uart_init (void)
540 #ifndef UNIX_OR_WINDOWS
541 #if (IRMP_EXT_LOGGING == 0) // use UART
542 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
543 UART0_UBRRL
= UBRRL_VALUE
;
546 UART0_UCSRA
|= (1<<UART0_U2X
);
548 UART0_UCSRA
&= ~(1<<UART0_U2X
);
551 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
552 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
553 #else // other log method
555 #endif //IRMP_EXT_LOGGING
556 #endif // UNIX_OR_WINDOWS
559 /*---------------------------------------------------------------------------------------------------------------------------------------------------
561 * @details Sends character
562 * @param ch character to be transmitted
563 *---------------------------------------------------------------------------------------------------------------------------------------------------
566 irmp_uart_putc (unsigned char ch
)
568 #ifndef UNIX_OR_WINDOWS
569 #if (IRMP_EXT_LOGGING == 0)
570 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
577 sendextlog(ch
); //Use external log
581 #endif // UNIX_OR_WINDOWS
584 /*---------------------------------------------------------------------------------------------------------------------------------------------------
586 *---------------------------------------------------------------------------------------------------------------------------------------------------
589 #define STARTCYCLES 2 // min count of zeros before start of logging
590 #define ENDBITS 1000 // number of sequenced highbits to detect end
591 #define DATALEN 700 // log buffer size
593 #if 0 // old log routine
596 irmp_log (uint8_t val
)
598 static uint8_t buf
[DATALEN
]; // logging buffer
599 static uint16_t buf_idx
; // number of written bits
600 static uint8_t startcycles
; // current number of start-zeros
601 static uint16_t cnt
; // counts sequenced highbits - to detect end
603 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
611 if (! val
|| (val
&& buf_idx
!= 0)) // start or continue logging on "0", "1" cannot init logging
613 if (buf_idx
< DATALEN
* 8) // index in range?
617 buf
[(buf_idx
/ 8)] |= (1<<(buf_idx
% 8)); // set bit
621 buf
[(buf_idx
/ 8)] &= ~(1<<(buf_idx
% 8)); // reset bit
628 { // if high received then look at log-stop condition
632 { // if stop condition is true, output on uart
635 for (i
= 0; i
< STARTCYCLES
; i
++)
637 irmp_uart_putc ('0'); // the ignored starting zeros
640 for (i
= 0; i
< (buf_idx
- ENDBITS
+ 20) / 8; i
++) // transform bitset into uart chars
645 for (j
= 0; j
< 8; j
++)
647 irmp_uart_putc ((d
& 1) + '0');
652 irmp_uart_putc ('\n');
664 #else // new log routine
667 irmp_log (uint8_t val
)
669 static uint8_t buf
[DATALEN
]; // logging buffer
670 static uint16_t buf_idx
; // index
671 static uint8_t startcycles
; // current number of start-zeros
672 static uint16_t cnt
; // counts sequenced highbits - to detect end
673 static uint8_t last_val
= 1;
675 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
683 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
689 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
690 { // if stop condition is true, output on uart
697 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
699 irmp_uart_putc ('0'); // the ignored starting zeros
702 for (i
= 0; i
< buf_idx
; i
++)
711 d
|= ((uint16_t) buf
[i
] << 8);
714 for (j
= 0; j
< d
; j
++)
719 v
= (v
== '1') ? '0' : '1';
722 for (i8
= 0; i8
< 20; i8
++)
724 irmp_uart_putc ('1');
727 irmp_uart_putc ('\n');
733 else if (buf_idx
< DATALEN
- 3)
737 buf
[buf_idx
++] = 0xff;
738 buf
[buf_idx
++] = (cnt
& 0xff);
739 buf
[buf_idx
] = (cnt
>> 8);
757 #define irmp_log(val)
758 #endif //IRMP_LOGGING
762 uint8_t protocol
; // ir protocol
763 uint8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
764 uint8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
765 uint8_t pause_1_len_min
; // minimum length of pause with bit value 1
766 uint8_t pause_1_len_max
; // maximum length of pause with bit value 1
767 uint8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
768 uint8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
769 uint8_t pause_0_len_min
; // minimum length of pause with bit value 0
770 uint8_t pause_0_len_max
; // maximum length of pause with bit value 0
771 uint8_t address_offset
; // address offset
772 uint8_t address_end
; // end of address
773 uint8_t command_offset
; // command offset
774 uint8_t command_end
; // end of command
775 uint8_t complete_len
; // complete length of frame
776 uint8_t stop_bit
; // flag: frame has stop bit
777 uint8_t lsb_first
; // flag: LSB first
778 uint8_t flags
; // some flags
781 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
783 static const PROGMEM IRMP_PARAMETER sircs_param
=
785 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
786 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
787 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
788 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
789 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
790 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
791 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
792 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
793 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
794 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
795 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
796 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
797 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
798 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
799 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
800 SIRCS_LSB
, // lsb_first: flag: LSB first
801 SIRCS_FLAGS
// flags: some flags
806 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
808 static const PROGMEM IRMP_PARAMETER nec_param
=
810 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
811 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
812 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
813 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
814 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
815 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
816 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
817 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
818 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
819 NEC_ADDRESS_OFFSET
, // address_offset: address offset
820 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
821 NEC_COMMAND_OFFSET
, // command_offset: command offset
822 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
823 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
824 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
825 NEC_LSB
, // lsb_first: flag: LSB first
826 NEC_FLAGS
// flags: some flags
829 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
831 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
832 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
833 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
834 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
835 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
836 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
837 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
838 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
839 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
840 0, // address_offset: address offset
841 0, // address_end: end of address
842 0, // command_offset: command offset
843 0, // command_end: end of command
844 0, // complete_len: complete length of frame
845 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
846 NEC_LSB
, // lsb_first: flag: LSB first
847 NEC_FLAGS
// flags: some flags
852 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
854 static const PROGMEM IRMP_PARAMETER nec42_param
=
856 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
857 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
858 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
859 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
860 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
861 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
862 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
863 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
864 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
865 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
866 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
867 NEC42_COMMAND_OFFSET
, // command_offset: command offset
868 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
869 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
870 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
871 NEC_LSB
, // lsb_first: flag: LSB first
872 NEC_FLAGS
// flags: some flags
877 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
879 static const PROGMEM IRMP_PARAMETER samsung_param
=
881 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
882 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
883 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
884 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
885 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
886 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
887 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
888 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
889 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
890 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
891 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
892 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
893 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
894 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
895 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
896 SAMSUNG_LSB
, // lsb_first: flag: LSB first
897 SAMSUNG_FLAGS
// flags: some flags
902 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
904 static const PROGMEM IRMP_PARAMETER telefunken_param
=
906 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
907 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
908 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
909 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
910 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
911 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
912 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
913 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
914 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
915 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
916 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
917 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
918 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
919 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
920 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
921 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
922 TELEFUNKEN_FLAGS
// flags: some flags
927 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
929 static const PROGMEM IRMP_PARAMETER matsushita_param
=
931 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
932 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
933 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
934 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
935 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
936 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
937 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
938 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
939 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
940 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
941 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
942 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
943 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
944 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
945 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
946 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
947 MATSUSHITA_FLAGS
// flags: some flags
952 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
954 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
956 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
957 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
958 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
959 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
960 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
961 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
962 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
963 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
964 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
965 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
966 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
967 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
968 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
969 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
970 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
971 KASEIKYO_LSB
, // lsb_first: flag: LSB first
972 KASEIKYO_FLAGS
// flags: some flags
977 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
979 static const PROGMEM IRMP_PARAMETER recs80_param
=
981 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
982 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
983 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
984 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
985 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
986 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
987 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
988 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
989 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
990 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
991 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
992 RECS80_COMMAND_OFFSET
, // command_offset: command offset
993 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
994 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
995 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
996 RECS80_LSB
, // lsb_first: flag: LSB first
997 RECS80_FLAGS
// flags: some flags
1002 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1004 static const PROGMEM IRMP_PARAMETER rc5_param
=
1006 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1007 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1008 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1009 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1010 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1011 0, // pulse_0_len_min: here: not used
1012 0, // pulse_0_len_max: here: not used
1013 0, // pause_0_len_min: here: not used
1014 0, // pause_0_len_max: here: not used
1015 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1016 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1017 RC5_COMMAND_OFFSET
, // command_offset: command offset
1018 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1019 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1020 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1021 RC5_LSB
, // lsb_first: flag: LSB first
1022 RC5_FLAGS
// flags: some flags
1027 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1029 static const PROGMEM IRMP_PARAMETER denon_param
=
1031 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1032 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1033 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1034 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1035 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1036 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1037 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1038 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1039 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1040 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1041 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1042 DENON_COMMAND_OFFSET
, // command_offset: command offset
1043 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1044 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1045 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1046 DENON_LSB
, // lsb_first: flag: LSB first
1047 DENON_FLAGS
// flags: some flags
1052 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1054 static const PROGMEM IRMP_PARAMETER rc6_param
=
1056 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1058 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1059 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1060 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1061 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1062 0, // pulse_0_len_min: here: not used
1063 0, // pulse_0_len_max: here: not used
1064 0, // pause_0_len_min: here: not used
1065 0, // pause_0_len_max: here: not used
1066 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1067 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1068 RC6_COMMAND_OFFSET
, // command_offset: command offset
1069 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1070 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1071 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1072 RC6_LSB
, // lsb_first: flag: LSB first
1073 RC6_FLAGS
// flags: some flags
1078 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1080 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1082 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1083 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1084 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1085 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1086 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1087 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1088 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1089 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1090 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1091 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1092 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1093 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1094 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1095 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1096 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1097 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1098 RECS80EXT_FLAGS
// flags: some flags
1103 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1105 static const PROGMEM IRMP_PARAMETER nubert_param
=
1107 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1108 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1109 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1110 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1111 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1112 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1113 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1114 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1115 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1116 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1117 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1118 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1119 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1120 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1121 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1122 NUBERT_LSB
, // lsb_first: flag: LSB first
1123 NUBERT_FLAGS
// flags: some flags
1128 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1130 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1132 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1133 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1134 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1135 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1136 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1137 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1138 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1139 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1140 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1141 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1142 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1143 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1144 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1145 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1146 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1147 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1148 BANG_OLUFSEN_FLAGS
// flags: some flags
1153 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1155 static uint8_t first_bit
;
1157 static const PROGMEM IRMP_PARAMETER grundig_param
=
1159 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1161 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1162 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1163 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1164 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1165 0, // pulse_0_len_min: here: not used
1166 0, // pulse_0_len_max: here: not used
1167 0, // pause_0_len_min: here: not used
1168 0, // pause_0_len_max: here: not used
1169 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1170 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1171 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1172 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1173 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1174 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1175 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1176 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1181 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1183 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1185 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1186 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1187 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1188 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1189 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1190 0, // pulse_0_len_min: here: not used
1191 0, // pulse_0_len_max: here: not used
1192 0, // pause_0_len_min: here: not used
1193 0, // pause_0_len_max: here: not used
1194 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1195 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1196 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1197 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1198 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1199 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1200 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1201 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1206 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1208 static const PROGMEM IRMP_PARAMETER fdc_param
=
1210 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1211 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1212 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1213 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1214 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1215 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1216 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1217 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1218 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1219 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1220 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1221 FDC_COMMAND_OFFSET
, // command_offset: command offset
1222 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1223 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1224 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1225 FDC_LSB
, // lsb_first: flag: LSB first
1226 FDC_FLAGS
// flags: some flags
1231 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1233 static const PROGMEM IRMP_PARAMETER rccar_param
=
1235 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1236 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1237 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1238 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1239 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1240 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1241 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1242 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1243 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1244 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1245 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1246 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1247 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1248 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1249 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1250 RCCAR_LSB
, // lsb_first: flag: LSB first
1251 RCCAR_FLAGS
// flags: some flags
1256 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1258 static const PROGMEM IRMP_PARAMETER nikon_param
=
1260 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1261 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1262 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1263 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1264 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1265 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1266 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1267 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1268 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1269 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1270 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1271 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1272 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1273 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1274 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1275 NIKON_LSB
, // lsb_first: flag: LSB first
1276 NIKON_FLAGS
// flags: some flags
1281 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1283 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1285 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1286 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1287 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1288 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1289 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1290 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1291 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1292 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1293 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1294 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1295 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1296 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1297 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1298 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1299 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1300 KATHREIN_LSB
, // lsb_first: flag: LSB first
1301 KATHREIN_FLAGS
// flags: some flags
1306 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1308 static const PROGMEM IRMP_PARAMETER netbox_param
=
1310 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1311 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1312 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1313 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1314 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1315 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1316 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1317 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1318 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1319 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1320 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1321 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1322 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1323 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1324 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1325 NETBOX_LSB
, // lsb_first: flag: LSB first
1326 NETBOX_FLAGS
// flags: some flags
1331 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1333 static const PROGMEM IRMP_PARAMETER lego_param
=
1335 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1336 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1337 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1338 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1339 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1340 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1341 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1342 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1343 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1344 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1345 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1346 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1347 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1348 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1349 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1350 LEGO_LSB
, // lsb_first: flag: LSB first
1351 LEGO_FLAGS
// flags: some flags
1356 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1358 static const PROGMEM IRMP_PARAMETER thomson_param
=
1360 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1361 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1362 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1363 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1364 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1365 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1366 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1367 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1368 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1369 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1370 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1371 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1372 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1373 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1374 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1375 THOMSON_LSB
, // lsb_first: flag: LSB first
1376 THOMSON_FLAGS
// flags: some flags
1381 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1383 static const PROGMEM IRMP_PARAMETER bose_param
=
1385 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1386 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1387 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1388 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1389 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1390 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1391 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1392 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1393 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1394 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1395 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1396 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1397 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1398 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1399 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1400 BOSE_LSB
, // lsb_first: flag: LSB first
1401 BOSE_FLAGS
// flags: some flags
1406 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1408 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1410 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1412 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1413 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1414 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1415 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1416 0, // pulse_0_len_min: here: not used
1417 0, // pulse_0_len_max: here: not used
1418 0, // pause_0_len_min: here: not used
1419 0, // pause_0_len_max: here: not used
1420 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1421 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1422 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1423 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1424 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1425 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1426 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1427 A1TVBOX_FLAGS
// flags: some flags
1432 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1434 static const PROGMEM IRMP_PARAMETER ortek_param
=
1436 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1438 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1439 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1440 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1441 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1442 0, // pulse_0_len_min: here: not used
1443 0, // pulse_0_len_max: here: not used
1444 0, // pause_0_len_min: here: not used
1445 0, // pause_0_len_max: here: not used
1446 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1447 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1448 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1449 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1450 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1451 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1452 ORTEK_LSB
, // lsb_first: flag: LSB first
1453 ORTEK_FLAGS
// flags: some flags
1458 static uint8_t irmp_bit
; // current bit position
1459 static IRMP_PARAMETER irmp_param
;
1461 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1462 static IRMP_PARAMETER irmp_param2
;
1465 static volatile uint8_t irmp_ir_detected
;
1466 static volatile uint8_t irmp_protocol
;
1467 static volatile uint16_t irmp_address
;
1468 static volatile uint16_t irmp_command
;
1469 static volatile uint16_t irmp_id
; // only used for SAMSUNG protocol
1470 static volatile uint8_t irmp_flags
;
1471 // static volatile uint8_t irmp_busy_flag;
1474 #define input(x) (x)
1475 static uint8_t IRMP_PIN
;
1478 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1479 * Initialize IRMP decoder
1480 * @details Configures IRMP input pin
1481 *---------------------------------------------------------------------------------------------------------------------------------------------------
1487 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
1488 #elif defined (ARM_STM32) // STM32
1489 GPIO_InitTypeDef GPIO_InitStructure
;
1491 /* GPIOx clock enable */
1492 #if defined (ARM_STM32L1XX)
1493 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1494 #elif defined (ARM_STM32F10X)
1495 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1496 #elif defined (ARM_STM32F4XX)
1497 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1500 /* GPIO Configuration */
1501 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
1502 #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
1503 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
1504 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1505 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
1506 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
1507 #elif defined (ARM_STM32F10X)
1508 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1509 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
1511 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
1512 #elif defined(STELLARIS_ARM_CORTEX_M4)
1513 // Enable the GPIO port
1514 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
1517 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
1518 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
,
1520 GPIO_PIN_TYPE_STD_WPU
);
1522 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
1523 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
1526 #if IRMP_LOGGING == 1
1531 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1533 * @details gets decoded IRMP data
1534 * @param pointer in order to store IRMP data
1535 * @return TRUE: successful, FALSE: failed
1536 *---------------------------------------------------------------------------------------------------------------------------------------------------
1539 irmp_get_data (IRMP_DATA
* irmp_data_p
)
1541 uint8_t rtc
= FALSE
;
1543 if (irmp_ir_detected
)
1545 switch (irmp_protocol
)
1547 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1548 case IRMP_SAMSUNG_PROTOCOL
:
1549 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1551 irmp_command
&= 0xff;
1552 irmp_command
|= irmp_id
<< 8;
1557 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1558 case IRMP_NEC_PROTOCOL
:
1559 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1561 irmp_command
&= 0xff;
1564 else if (irmp_address
== 0x87EE)
1566 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
1567 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
1568 irmp_address
= (irmp_command
& 0xFF00) >> 8;
1569 irmp_command
&= 0x00FF;
1574 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1575 case IRMP_BOSE_PROTOCOL
:
1576 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
1578 irmp_command
&= 0xff;
1583 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1584 case IRMP_SIEMENS_PROTOCOL
:
1585 case IRMP_RUWIDO_PROTOCOL
:
1586 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
1593 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1594 case IRMP_KATHREIN_PROTOCOL
:
1595 if (irmp_command
!= 0x0000)
1601 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1602 case IRMP_RC5_PROTOCOL
:
1603 irmp_address
&= ~0x20; // clear toggle bit
1607 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
1608 case IRMP_IR60_PROTOCOL
:
1609 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
1615 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
1619 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1620 case IRMP_RCCAR_PROTOCOL
:
1621 // frame in irmp_data:
1622 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
1623 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
1624 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
1625 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
1626 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
1627 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
1628 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
1632 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
1633 case IRMP_NETBOX_PROTOCOL
:
1634 if (irmp_command
& 0x1000) // last bit set?
1636 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
1639 irmp_command
&= 0x7F;
1642 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
1645 irmp_command
|= 0x80;
1650 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
1655 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
1659 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1660 case IRMP_LEGO_PROTOCOL
:
1662 uint8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
1664 if ((irmp_command
& 0x000F) == crc
)
1671 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
1672 // rtc = TRUE; // don't accept codes with CRC errors
1686 irmp_data_p
->protocol
= irmp_protocol
;
1687 irmp_data_p
->address
= irmp_address
;
1688 irmp_data_p
->command
= irmp_command
;
1689 irmp_data_p
->flags
= irmp_flags
;
1695 irmp_ir_detected
= FALSE
;
1702 // irmp_is_busy (void)
1704 // return irmp_busy_flag;
1707 #if IRMP_USE_CALLBACK == 1
1709 irmp_set_callback_ptr (void (*cb
)(uint8_t))
1711 irmp_callback_ptr
= cb
;
1713 #endif // IRMP_USE_CALLBACK == 1
1715 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
1716 static uint16_t irmp_tmp_address
; // ir address
1717 static uint16_t irmp_tmp_command
; // ir command
1719 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
1720 static uint16_t irmp_tmp_address2
; // ir address
1721 static uint16_t irmp_tmp_command2
; // ir command
1724 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1725 static uint16_t irmp_tmp_id
; // ir id (only SAMSUNG)
1727 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1728 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
1729 static uint8_t genre2
; // save genre2 bits here, later copied to MSB in flags
1732 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1734 * @details store bit in temp address or temp command
1735 * @param value to store: 0 or 1
1736 *---------------------------------------------------------------------------------------------------------------------------------------------------
1738 // verhindert, dass irmp_store_bit() inline compiliert wird:
1739 // static void irmp_store_bit (uint8_t) __attribute__ ((noinline));
1742 irmp_store_bit (uint8_t value
)
1744 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1745 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
1752 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
1754 if (irmp_param
.lsb_first
)
1756 irmp_tmp_address
|= (((uint16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
1760 irmp_tmp_address
<<= 1;
1761 irmp_tmp_address
|= value
;
1764 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
1766 if (irmp_param
.lsb_first
)
1768 irmp_tmp_command
|= (((uint16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
1772 irmp_tmp_command
<<= 1;
1773 irmp_tmp_command
|= value
;
1777 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1778 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
1780 irmp_tmp_address2
|= (((uint16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
1785 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1786 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
1788 irmp_tmp_id
|= (((uint16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
1793 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1794 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
1796 if (irmp_bit
>= 20 && irmp_bit
< 24)
1798 irmp_tmp_command
|= (((uint16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
1800 else if (irmp_bit
>= 24 && irmp_bit
< 28)
1802 genre2
|= (((uint8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
1805 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
1809 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
1813 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
1826 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1828 * @details store bit in temp address or temp command
1829 * @param value to store: 0 or 1
1830 *---------------------------------------------------------------------------------------------------------------------------------------------------
1832 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1834 irmp_store_bit2 (uint8_t value
)
1838 if (irmp_param
.protocol
)
1840 irmp_bit2
= irmp_bit
- 2;
1844 irmp_bit2
= irmp_bit
- 1;
1847 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
1849 irmp_tmp_address2
|= (((uint16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
1851 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
1853 irmp_tmp_command2
|= (((uint16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
1856 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1858 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1860 * @details ISR routine, called 10000 times per second
1861 *---------------------------------------------------------------------------------------------------------------------------------------------------
1866 static uint8_t irmp_start_bit_detected
; // flag: start bit detected
1867 static uint8_t wait_for_space
; // flag: wait for data bit space
1868 static uint8_t wait_for_start_space
; // flag: wait for start bit space
1869 static uint8_t irmp_pulse_time
; // count bit time for pulse
1870 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
1871 static uint16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
1872 static uint16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
1873 static uint16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
1874 static uint8_t repetition_frame_number
;
1875 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1876 static uint16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
1877 static uint16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
1879 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1880 static uint8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
1882 #if IRMP_SUPPORT_MANCHESTER == 1
1883 static PAUSE_LEN last_pause
; // last pause value
1885 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1886 static uint8_t last_value
; // last bit value
1888 uint8_t irmp_input
; // input value
1894 irmp_input
= input(IRMP_PIN
);
1896 #if IRMP_USE_CALLBACK == 1
1897 if (irmp_callback_ptr
)
1899 static uint8_t last_inverted_input
;
1901 if (last_inverted_input
!= !irmp_input
)
1903 (*irmp_callback_ptr
) (! irmp_input
);
1904 last_inverted_input
= !irmp_input
;
1907 #endif // IRMP_USE_CALLBACK == 1
1909 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
1911 if (! irmp_ir_detected
) // ir code already detected?
1913 if (! irmp_start_bit_detected
) // start bit detected?
1915 if (! irmp_input
) // receiving burst?
1917 // irmp_busy_flag = TRUE;
1919 if (! irmp_pulse_time
)
1921 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
1924 irmp_pulse_time
++; // increment counter
1928 if (irmp_pulse_time
) // it's dark....
1929 { // set flags for counting the time of darkness...
1930 irmp_start_bit_detected
= 1;
1931 wait_for_start_space
= 1;
1933 irmp_tmp_command
= 0;
1934 irmp_tmp_address
= 0;
1935 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1939 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
1940 irmp_tmp_command2
= 0;
1941 irmp_tmp_address2
= 0;
1945 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
1946 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1947 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
1952 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
1954 key_repetition_len
++;
1956 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1957 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
1959 denon_repetition_len
++;
1961 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
1963 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
1964 (double) (time_counter
* 1000) / F_INTERRUPTS
);
1965 last_irmp_denon_command
= 0;
1966 denon_repetition_len
= 0xFFFF;
1969 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
1976 if (wait_for_start_space
) // we have received start bit...
1977 { // ...and are counting the time of darkness
1978 if (irmp_input
) // still dark?
1980 irmp_pause_time
++; // increment counter
1982 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1983 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
) ||
1984 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
1986 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
1989 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
1990 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
1995 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
1997 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
);
1998 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2000 // irmp_busy_flag = FALSE;
2001 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2002 irmp_pulse_time
= 0;
2003 irmp_pause_time
= 0;
2007 { // receiving first data pulse!
2008 IRMP_PARAMETER
* irmp_param_p
= (IRMP_PARAMETER
*) 0;
2010 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2011 irmp_param2
.protocol
= 0;
2014 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2016 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2017 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2018 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2020 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2021 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2022 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2023 irmp_param_p
= (IRMP_PARAMETER
*) (IRMP_PARAMETER
*) &sircs_param
;
2026 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2028 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2029 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2030 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2031 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2033 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2034 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2035 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2036 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2039 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2041 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2042 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2043 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2045 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2046 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2047 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2048 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2049 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2051 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2052 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2053 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2054 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2058 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2059 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2061 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2062 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2063 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2064 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2065 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2066 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2067 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2070 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2072 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2073 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2074 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2076 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2081 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2082 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2083 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2084 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2085 { // it's JVC repetition type 3
2086 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2087 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2088 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2089 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2092 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2094 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2096 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2097 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2098 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2100 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2101 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2102 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2103 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2106 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2108 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2109 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2110 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2112 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2113 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2114 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2115 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2118 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2120 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2121 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2122 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2124 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2125 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2126 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2127 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2130 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2132 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2133 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2134 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2135 { // it's MATSUSHITA
2136 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2137 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2138 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2139 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2142 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2144 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2145 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2146 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2148 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2149 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2150 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2151 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2154 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2156 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2157 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2158 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2160 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2161 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2162 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2163 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2166 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2168 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2169 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
2170 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
2171 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
2172 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
2174 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2175 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2176 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2178 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
2179 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2180 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2181 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2182 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2183 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2184 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2185 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
2188 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2190 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2191 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2192 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2194 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
2195 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2196 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2197 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2198 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2199 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2200 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2201 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
2204 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2206 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2207 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2208 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
2209 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2210 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
2213 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
2214 last_pause
= irmp_pause_time
;
2216 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
2217 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
2220 rc5_cmd_bit6
= 1<<6;
2228 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
2230 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2231 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
2232 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
2233 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
2235 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2236 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
2237 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
2238 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
2239 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
2242 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2244 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2245 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
2246 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
2247 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
2249 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2250 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
2251 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
2252 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
2253 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
2256 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2258 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2259 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
2260 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
2262 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2263 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
2264 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
2265 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
2268 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
2270 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2271 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
2272 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
2274 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2275 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
2276 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
2277 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
2282 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2284 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2285 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
2286 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
2288 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2289 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
2290 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
2291 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
2294 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2296 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2297 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
2298 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
2300 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2301 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
2302 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
2303 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
2306 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2308 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2309 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
2310 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
2311 { // it's BANG_OLUFSEN
2312 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
2313 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2314 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
2315 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
2316 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2317 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
2318 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
2319 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2320 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
2321 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
2322 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2323 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
2324 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
2325 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
2329 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2331 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2332 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
2333 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
2335 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2336 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
2337 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
2338 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
2339 last_pause
= irmp_pause_time
;
2343 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2345 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2346 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
2347 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
2348 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
2349 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
2350 { // it's RUWIDO or SIEMENS
2351 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2352 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2353 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
2354 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
2355 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
2356 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
2357 last_pause
= irmp_pause_time
;
2361 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2363 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2364 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2365 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2367 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2368 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2369 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2370 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
2373 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2375 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2376 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2377 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2379 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2380 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2381 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2382 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
2385 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2387 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2388 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
2389 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
2391 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2392 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
2393 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
2394 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
2397 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2399 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2400 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
2401 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
2403 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2404 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
2405 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
2406 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
2409 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
2411 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2412 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
2413 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
2415 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2416 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
2417 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
2418 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
2421 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
2423 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2424 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
2425 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
2427 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2428 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
2429 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
2430 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
2435 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2437 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2438 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
2439 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
2440 { // it's ORTEK (Hama)
2441 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2442 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
2443 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
2444 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
2449 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2452 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
2453 // irmp_busy_flag = FALSE;
2454 irmp_start_bit_detected
= 0; // wait for another start bit...
2457 if (irmp_start_bit_detected
)
2459 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
2462 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
2464 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
2465 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
2469 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
2470 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
2471 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
2472 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
2475 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2476 if (irmp_param2
.protocol
)
2478 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
2479 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
2480 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
2481 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
2486 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2487 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
2489 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
2493 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
2495 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
2496 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
2500 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
2501 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
2502 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
2503 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
2506 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2507 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
2509 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
2510 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
2514 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
2515 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
2516 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
2517 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
2523 #if IRMP_SUPPORT_MANCHESTER == 1
2524 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
2525 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
2526 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
2528 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
2530 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
2531 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
2533 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
2535 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
2537 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
2539 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
2541 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
2545 #endif // IRMP_SUPPORT_MANCHESTER == 1
2547 #if IRMP_SUPPORT_SERIAL == 1
2548 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
2553 #endif // IRMP_SUPPORT_SERIAL == 1
2556 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2557 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
2559 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
2561 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
2562 { // pause timings correct for "1"?
2563 ANALYZE_PUTCHAR ('1'); // yes, store 1
2567 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
2568 { // pause timings correct for "0"?
2569 ANALYZE_PUTCHAR ('0'); // yes, store 0
2575 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2576 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2577 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
2579 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
2581 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
2582 { // pause timings correct for "1"?
2583 ANALYZE_PUTCHAR ('1'); // yes, store 1
2587 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
2588 { // pause timings correct for "0"?
2589 ANALYZE_PUTCHAR ('0'); // yes, store 0
2595 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2597 ; // else do nothing
2600 irmp_pulse_time
= 1; // set counter to 1, not 0
2601 irmp_pause_time
= 0;
2602 wait_for_start_space
= 0;
2605 else if (wait_for_space
) // the data section....
2606 { // counting the time of darkness....
2607 uint8_t got_light
= FALSE
;
2609 if (irmp_input
) // still dark?
2611 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
2614 #if IRMP_SUPPORT_MANCHESTER == 1
2615 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
2617 #if IRMP_SUPPORT_SERIAL == 1
2618 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
2620 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
2623 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
2625 ANALYZE_PRINTF ("stop bit detected\n");
2628 irmp_param
.stop_bit
= 0;
2632 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",
2633 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
2635 // irmp_busy_flag = FALSE;
2636 irmp_start_bit_detected
= 0; // wait for another start bit...
2637 irmp_pulse_time
= 0;
2638 irmp_pause_time
= 0;
2643 irmp_pause_time
++; // increment counter
2645 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2646 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
2647 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
2648 irmp_bit
>= 12 - 1) // pause too long?
2649 { // yes, break and close this frame
2650 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
2651 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
2652 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
2653 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
2654 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
2658 #if IRMP_SUPPORT_SERIAL == 1
2659 // NETBOX generates no stop bit, here is the timeout condition:
2660 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
2661 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
2663 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
2667 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2668 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
2670 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
2672 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
2673 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
2674 irmp_param
.stop_bit
= TRUE
; // set flag
2676 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
2677 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
2678 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
2679 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
2680 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
2681 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
2683 irmp_tmp_command
<<= 1;
2684 irmp_tmp_command
|= first_bit
;
2686 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
2687 { // special manchester decoder
2688 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
2689 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
2690 irmp_param
.stop_bit
= TRUE
; // set flag
2692 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
2694 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");
2695 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
2696 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
2697 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
2698 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
2699 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
2701 if (irmp_tmp_command
& 0x300)
2703 irmp_tmp_address
= (irmp_tmp_command
>> 8);
2704 irmp_tmp_command
&= 0xFF;
2710 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2711 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
2713 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
2714 { // special manchester decoder
2715 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
2716 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
2717 irmp_param
.stop_bit
= TRUE
; // set flag
2719 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
2721 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
2722 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
2723 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
2724 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
2725 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
2726 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
2729 // RUWIDO: AAAAAAAAACCCCCCCp
2730 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
2731 irmp_tmp_address
<<= 2;
2732 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
2733 irmp_tmp_command
&= 0x003F;
2734 irmp_tmp_command
<<= 4;
2735 irmp_tmp_command
|= last_value
;
2740 #if IRMP_SUPPORT_MANCHESTER == 1
2741 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
2742 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
2743 { // special manchester decoder
2744 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
2745 irmp_param
.stop_bit
= TRUE
; // set flag
2748 #endif // IRMP_SUPPORT_MANCHESTER == 1
2749 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2751 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
2755 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2756 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
2758 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
2759 irmp_param
.stop_bit
= TRUE
; // set flag
2760 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
2761 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
2762 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
2763 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
2764 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
2766 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2768 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2769 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2770 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
2772 ANALYZE_PRINTF ("Switching to NEC protocol\n");
2773 irmp_param
.stop_bit
= TRUE
; // set flag
2774 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
2775 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
2777 // 0123456789ABC0123456789ABC0123456701234567
2778 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
2779 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
2780 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
2781 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
2783 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2784 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2785 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
2787 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
2788 irmp_param
.stop_bit
= TRUE
; // set flag
2789 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
2790 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
2792 // 0123456789ABC0123456789ABC0123456701234567
2793 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
2794 // JVC: AAAACCCCCCCCCCCC
2795 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
2796 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
2798 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2799 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
2802 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
2803 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2805 // irmp_busy_flag = FALSE;
2806 irmp_start_bit_detected
= 0; // wait for another start bit...
2807 irmp_pulse_time
= 0;
2808 irmp_pause_time
= 0;
2820 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
2822 #if IRMP_SUPPORT_MANCHESTER == 1
2823 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
2826 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
2827 #else // better, but some IR-RCs use asymmetric timings :-/
2828 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
2829 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
2832 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2833 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
2835 ANALYZE_PUTCHAR ('T');
2836 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
2849 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2851 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
2852 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
2854 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2855 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
2857 ANALYZE_PUTCHAR ('T');
2860 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
2871 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2873 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
2874 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
2875 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2876 if (! irmp_param2
.protocol
)
2881 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
2885 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
2886 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
2888 uint8_t manchester_value
;
2890 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
2892 manchester_value
= last_value
? 0 : 1;
2893 last_value
= manchester_value
;
2897 manchester_value
= last_value
;
2900 ANALYZE_PUTCHAR (manchester_value
+ '0');
2902 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2903 if (! irmp_param2
.protocol
)
2909 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2910 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
2912 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
2913 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
2914 irmp_param
.address_offset
= 5;
2915 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
2916 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
2917 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
2918 irmp_tmp_address
= 0;
2920 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2922 irmp_store_bit (manchester_value
);
2926 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
2927 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
2928 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
2929 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
2930 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
2932 ANALYZE_PUTCHAR ('?');
2933 irmp_param
.protocol
= 0; // switch to FDC, see below
2936 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2937 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2938 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
2939 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
2940 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
2941 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
2943 ANALYZE_PUTCHAR ('?');
2944 irmp_param
.protocol
= 0; // switch to RCCAR, see below
2947 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2949 ANALYZE_PUTCHAR ('?');
2951 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
2952 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2953 // irmp_busy_flag = FALSE;
2954 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
2955 irmp_pause_time
= 0;
2959 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
2960 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
2962 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
2964 ANALYZE_PRINTF (" 1 (FDC)\n");
2965 irmp_store_bit2 (1);
2967 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
2969 ANALYZE_PRINTF (" 0 (FDC)\n");
2970 irmp_store_bit2 (0);
2973 if (! irmp_param
.protocol
)
2975 ANALYZE_PRINTF ("Switching to FDC protocol\n");
2976 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
2977 irmp_param2
.protocol
= 0;
2978 irmp_tmp_address
= irmp_tmp_address2
;
2979 irmp_tmp_command
= irmp_tmp_command2
;
2982 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2983 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2984 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
2986 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
2988 ANALYZE_PRINTF (" 1 (RCCAR)\n");
2989 irmp_store_bit2 (1);
2991 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
2993 ANALYZE_PRINTF (" 0 (RCCAR)\n");
2994 irmp_store_bit2 (0);
2997 if (! irmp_param
.protocol
)
2999 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
3000 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3001 irmp_param2
.protocol
= 0;
3002 irmp_tmp_address
= irmp_tmp_address2
;
3003 irmp_tmp_command
= irmp_tmp_command2
;
3006 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3008 last_pause
= irmp_pause_time
;
3012 #endif // IRMP_SUPPORT_MANCHESTER == 1
3014 #if IRMP_SUPPORT_SERIAL == 1
3015 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3017 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
3019 ANALYZE_PUTCHAR ('1');
3022 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
3024 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
3028 irmp_pulse_time
= 0;
3032 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
3034 ANALYZE_PUTCHAR ('0');
3037 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
3039 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
3043 irmp_pause_time
= 0;
3050 #endif // IRMP_SUPPORT_SERIAL == 1
3052 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3053 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
3055 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
3056 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3058 ANALYZE_PRINTF ("SYNC\n");
3063 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
3065 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3066 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3067 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3068 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3070 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
3072 ANALYZE_PUTCHAR ('1');
3079 ANALYZE_PUTCHAR ('0');
3085 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3088 { // timing incorrect!
3089 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3090 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3091 // irmp_busy_flag = FALSE;
3092 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3093 irmp_pause_time
= 0;
3097 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
3099 #if IRMP_SUPPORT_NEC16_PROTOCOL
3100 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3101 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
3102 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
3103 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
3104 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3105 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
3107 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
3108 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
3109 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
3110 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
3111 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
3112 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
3113 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
3117 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
3119 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3120 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3122 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
3124 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
3126 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
3128 ANALYZE_PRINTF ("3rd start bit\n");
3133 { // timing incorrect!
3134 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
);
3135 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3136 // irmp_busy_flag = FALSE;
3137 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3138 irmp_pause_time
= 0;
3141 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
3143 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
3145 ANALYZE_PRINTF ("trailer bit\n");
3150 { // timing incorrect!
3151 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
);
3152 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3153 // irmp_busy_flag = FALSE;
3154 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3155 irmp_pause_time
= 0;
3160 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
3161 { // pulse & pause timings correct for "1"?
3162 ANALYZE_PUTCHAR ('1');
3168 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
3169 { // pulse & pause timings correct for "0"?
3170 ANALYZE_PUTCHAR ('0');
3176 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
3178 ANALYZE_PUTCHAR (last_value
+ '0');
3180 irmp_store_bit (last_value
);
3184 { // timing incorrect!
3185 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
);
3186 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3187 // irmp_busy_flag = FALSE;
3188 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3189 irmp_pause_time
= 0;
3194 { // timing incorrect!
3195 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
);
3196 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3197 // irmp_busy_flag = FALSE;
3198 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3199 irmp_pause_time
= 0;
3203 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
3205 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
3206 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
3207 { // pulse & pause timings correct for "1"?
3208 ANALYZE_PUTCHAR ('1');
3213 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
3214 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
3215 { // pulse & pause timings correct for "0"?
3216 ANALYZE_PUTCHAR ('0');
3222 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
3224 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
3225 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
3226 (((irmp_bit
== 8 || irmp_bit
== 6) &&
3227 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
3229 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
3235 ANALYZE_PUTCHAR ('S');
3237 irmp_tmp_command
<<= 1;
3241 ANALYZE_PUTCHAR ('S');
3248 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
3249 { // timing incorrect!
3250 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3251 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3252 // irmp_busy_flag = FALSE;
3253 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3254 irmp_pause_time
= 0;
3257 irmp_pulse_time
= 1; // set counter to 1, not 0
3261 { // counting the pulse length ...
3262 if (! irmp_input
) // still light?
3264 irmp_pulse_time
++; // increment counter
3268 wait_for_space
= 1; // let's count the time (see above)
3269 irmp_pause_time
= 1; // set pause counter to 1, not 0
3273 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
3275 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
3277 repetition_frame_number
++;
3281 repetition_frame_number
= 0;
3284 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3285 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
3286 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
3288 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
3289 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
3290 key_repetition_len
= 0;
3295 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3296 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
3297 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
3299 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
3300 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
3301 key_repetition_len
= 0;
3306 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3307 // if SAMSUNG32 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
3308 if (irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
&& (repetition_frame_number
& 0x01))
3310 ANALYZE_PRINTF ("code skipped: SAMSUNG32 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
3311 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
3312 key_repetition_len
= 0;
3317 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3318 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
3319 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
3321 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
3322 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
3323 key_repetition_len
= 0;
3329 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
3330 irmp_ir_detected
= TRUE
;
3332 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3333 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3334 { // check for repetition frame
3335 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
3337 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
3338 last_irmp_denon_command
= 0;
3340 irmp_protocol
= irmp_param
.protocol
; // store protocol
3341 irmp_address
= irmp_tmp_address
; // store address
3342 irmp_command
= irmp_tmp_command
; // store command
3346 if ((irmp_tmp_command
& 0x01) == 0x00)
3348 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
3349 last_irmp_denon_command
= irmp_tmp_command
;
3350 denon_repetition_len
= 0;
3351 irmp_ir_detected
= FALSE
;
3355 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
3356 last_irmp_denon_command
= 0;
3357 irmp_ir_detected
= FALSE
;
3362 #endif // IRMP_SUPPORT_DENON_PROTOCOL
3364 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
3365 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
3366 { // Grundig start frame?
3367 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
3368 irmp_ir_detected
= FALSE
;
3371 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
3373 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
3374 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
3375 { // Nokia start frame?
3376 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
3377 irmp_ir_detected
= FALSE
;
3380 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
3382 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3383 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
3385 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
3387 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
3388 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
3389 irmp_tmp_address
= last_irmp_address
; // address is last address
3390 irmp_tmp_command
= last_irmp_command
; // command is last command
3391 irmp_flags
|= IRMP_FLAG_REPETITION
;
3392 key_repetition_len
= 0;
3396 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
3397 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
3398 irmp_ir_detected
= FALSE
;
3401 #endif // IRMP_SUPPORT_NEC_PROTOCOL
3403 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3404 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
3407 // ANALYZE_PRINTF ("0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
3408 // xor_check[0], xor_check[1], xor_check[2], xor_check[3], xor_check[4], xor_check[5]);
3410 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
3412 if (xor_value
!= (xor_check
[2] & 0x0F))
3414 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
3415 irmp_ir_detected
= FALSE
;
3418 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
3420 if (xor_value
!= xor_check
[5])
3422 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
3423 irmp_ir_detected
= FALSE
;
3426 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
3428 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3430 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3431 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
3433 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
3436 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3438 irmp_protocol
= irmp_param
.protocol
;
3441 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3442 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
3444 if (irmp_tmp_command
& 0x000F) // released key?
3446 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
3450 irmp_tmp_command
>>= 4; // no, it's a pressed key
3452 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
3453 irmp_tmp_address
&= 0x003F;
3457 irmp_address
= irmp_tmp_address
; // store address
3458 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3459 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
3461 last_irmp_address
= irmp_tmp_address
; // store as last address, too
3465 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3466 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
3468 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
3471 irmp_command
= irmp_tmp_command
; // store command
3473 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3474 irmp_id
= irmp_tmp_id
;
3479 if (irmp_ir_detected
)
3481 if (last_irmp_command
== irmp_tmp_command
&&
3482 last_irmp_address
== irmp_tmp_address
&&
3483 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
3485 irmp_flags
|= IRMP_FLAG_REPETITION
;
3488 last_irmp_address
= irmp_tmp_address
; // store as last address, too
3489 last_irmp_command
= irmp_tmp_command
; // store as last command, too
3491 key_repetition_len
= 0;
3495 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3498 // irmp_busy_flag = FALSE;
3499 irmp_start_bit_detected
= 0; // and wait for next start bit
3500 irmp_tmp_command
= 0;
3501 irmp_pulse_time
= 0;
3502 irmp_pause_time
= 0;
3504 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3505 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
3506 { // set pulse time here!
3507 irmp_pulse_time
= ((uint8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
3509 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3514 #if defined(STELLARIS_ARM_CORTEX_M4)
3515 // Clear the timer interrupt
3516 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
3519 return (irmp_ir_detected
);
3524 /*---------------------------------------------------------------------------------------------------------------------------------------------------
3525 * main functions - for Unix/Linux + Windows only!
3529 * Compile it under linux with:
3532 * usage: ./irmp [-v|-s|-a|-l|-p] < file
3538 * -l list pulse/pauses
3540 *---------------------------------------------------------------------------------------------------------------------------------------------------
3544 print_timings (void)
3546 printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN
, sizeof (PAUSE_LEN
));
3547 printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN
);
3549 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");
3550 printf ("====================================================================================\n");
3551 printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3552 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
, SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
,
3553 SIRCS_0_PULSE_LEN_MIN
, SIRCS_0_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
,
3554 SIRCS_1_PULSE_LEN_MIN
, SIRCS_1_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
);
3556 printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3557 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
,
3558 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
3559 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
3561 printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3562 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
,
3563 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
3564 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
3566 printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3567 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
, SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
,
3568 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_0_PAUSE_LEN_MIN
, SAMSUNG_0_PAUSE_LEN_MAX
,
3569 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_1_PAUSE_LEN_MIN
, SAMSUNG_1_PAUSE_LEN_MAX
);
3571 printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3572 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
, MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
,
3573 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_0_PAUSE_LEN_MIN
, MATSUSHITA_0_PAUSE_LEN_MAX
,
3574 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_1_PAUSE_LEN_MIN
, MATSUSHITA_1_PAUSE_LEN_MAX
);
3576 printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3577 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
, KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
,
3578 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_0_PAUSE_LEN_MIN
, KASEIKYO_0_PAUSE_LEN_MAX
,
3579 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_1_PAUSE_LEN_MIN
, KASEIKYO_1_PAUSE_LEN_MAX
);
3581 printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3582 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
, RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
,
3583 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_0_PAUSE_LEN_MIN
, RECS80_0_PAUSE_LEN_MAX
,
3584 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_1_PAUSE_LEN_MIN
, RECS80_1_PAUSE_LEN_MAX
);
3586 printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",
3587 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
, RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3588 RC5_BIT_LEN_MIN
, RC5_BIT_LEN_MAX
);
3590 printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3591 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
3592 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
,
3593 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
);
3595 printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3596 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3597 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
,
3598 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
);
3600 printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3601 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
, RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
,
3602 RC6_BIT_PULSE_LEN_MIN
, RC6_BIT_PULSE_LEN_MAX
, RC6_BIT_PAUSE_LEN_MIN
, RC6_BIT_PAUSE_LEN_MAX
);
3604 printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3605 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
, RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
,
3606 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_0_PAUSE_LEN_MIN
, RECS80EXT_0_PAUSE_LEN_MAX
,
3607 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_1_PAUSE_LEN_MIN
, RECS80EXT_1_PAUSE_LEN_MAX
);
3609 printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3610 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
, NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
,
3611 NUBERT_0_PULSE_LEN_MIN
, NUBERT_0_PULSE_LEN_MAX
, NUBERT_0_PAUSE_LEN_MIN
, NUBERT_0_PAUSE_LEN_MAX
,
3612 NUBERT_1_PULSE_LEN_MIN
, NUBERT_1_PULSE_LEN_MAX
, NUBERT_1_PAUSE_LEN_MIN
, NUBERT_1_PAUSE_LEN_MAX
);
3614 printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",
3615 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3616 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3618 printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",
3619 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3620 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3622 printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",
3623 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3624 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3626 printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",
3627 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3628 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3630 printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3631 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_0_PAUSE_LEN_MIN
, BANG_OLUFSEN_0_PAUSE_LEN_MAX
,
3632 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_1_PAUSE_LEN_MIN
, BANG_OLUFSEN_1_PAUSE_LEN_MAX
);
3634 printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",
3635 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3636 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
,
3637 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
);
3639 printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3640 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3641 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3642 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
3643 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
,
3644 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
3645 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
);
3647 printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3648 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
, FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
,
3649 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_0_PAUSE_LEN_MIN
, FDC_0_PAUSE_LEN_MAX
,
3650 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_1_PAUSE_LEN_MIN
, FDC_1_PAUSE_LEN_MAX
);
3652 printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3653 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
, RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
,
3654 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_0_PAUSE_LEN_MIN
, RCCAR_0_PAUSE_LEN_MAX
,
3655 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_1_PAUSE_LEN_MIN
, RCCAR_1_PAUSE_LEN_MAX
);
3657 printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3658 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
, NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
,
3659 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_0_PAUSE_LEN_MIN
, NIKON_0_PAUSE_LEN_MAX
,
3660 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_1_PAUSE_LEN_MIN
, NIKON_1_PAUSE_LEN_MAX
);
3662 printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
3663 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
, LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
,
3664 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_0_PAUSE_LEN_MIN
, LEGO_0_PAUSE_LEN_MAX
,
3665 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_1_PAUSE_LEN_MIN
, LEGO_1_PAUSE_LEN_MAX
);
3670 print_spectrum (char * text
, int * buf
, int is_pulse
)
3683 puts ("-------------------------------------------------------------------------------");
3684 printf ("%s:\n", text
);
3686 for (i
= 0; i
< 256; i
++)
3688 if (buf
[i
] > max_value
)
3694 for (i
= 1; i
< 100; i
++)
3699 value
= (buf
[i
] * 60) / max_value
;
3701 for (j
= 0; j
< value
; j
++)
3705 printf (" %d\n", buf
[i
]);
3716 average
= (float) sum
/ (float) counter
;
3727 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
3728 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
3729 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
3731 tolerance
= (max
- average
);
3733 if (average
- min
> tolerance
)
3735 tolerance
= average
- min
;
3738 tolerance
= tolerance
* 100 / average
;
3739 printf ("tol: %4.1f%%\n", tolerance
);
3749 #define STATE_LEFT_SHIFT 0x01
3750 #define STATE_RIGHT_SHIFT 0x02
3751 #define STATE_LEFT_CTRL 0x04
3752 #define STATE_LEFT_ALT 0x08
3753 #define STATE_RIGHT_ALT 0x10
3755 #define KEY_ESCAPE 0x1B // keycode = 0x006e
3756 #define KEY_MENUE 0x80 // keycode = 0x0070
3757 #define KEY_BACK 0x81 // keycode = 0x0071
3758 #define KEY_FORWARD 0x82 // keycode = 0x0072
3759 #define KEY_ADDRESS 0x83 // keycode = 0x0073
3760 #define KEY_WINDOW 0x84 // keycode = 0x0074
3761 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
3762 #define KEY_STOP 0x86 // keycode = 0x0076
3763 #define KEY_MAIL 0x87 // keycode = 0x0077
3764 #define KEY_FAVORITES 0x88 // keycode = 0x0078
3765 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
3766 #define KEY_SETUP 0x8A // keycode = 0x007a
3767 #define KEY_FONT 0x8B // keycode = 0x007b
3768 #define KEY_PRINT 0x8C // keycode = 0x007c
3769 #define KEY_ON_OFF 0x8E // keycode = 0x007c
3771 #define KEY_INSERT 0x90 // keycode = 0x004b
3772 #define KEY_DELETE 0x91 // keycode = 0x004c
3773 #define KEY_LEFT 0x92 // keycode = 0x004f
3774 #define KEY_HOME 0x93 // keycode = 0x0050
3775 #define KEY_END 0x94 // keycode = 0x0051
3776 #define KEY_UP 0x95 // keycode = 0x0053
3777 #define KEY_DOWN 0x96 // keycode = 0x0054
3778 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
3779 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
3780 #define KEY_RIGHT 0x99 // keycode = 0x0059
3781 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
3782 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
3785 get_fdc_key (uint16_t cmd
)
3787 static uint8_t key_table
[128] =
3789 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
3790 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
3791 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
3792 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
3793 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
3795 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
3796 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
3797 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
3798 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
3800 static uint8_t state
;
3806 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
3807 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
3808 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
3809 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
3810 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
3811 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
3812 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
3813 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
3814 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
3815 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
3817 case 0x006e: key
= KEY_ESCAPE
; break;
3818 case 0x004b: key
= KEY_INSERT
; break;
3819 case 0x004c: key
= KEY_DELETE
; break;
3820 case 0x004f: key
= KEY_LEFT
; break;
3821 case 0x0050: key
= KEY_HOME
; break;
3822 case 0x0051: key
= KEY_END
; break;
3823 case 0x0053: key
= KEY_UP
; break;
3824 case 0x0054: key
= KEY_DOWN
; break;
3825 case 0x0055: key
= KEY_PAGE_UP
; break;
3826 case 0x0056: key
= KEY_PAGE_DOWN
; break;
3827 case 0x0059: key
= KEY_RIGHT
; break;
3828 case 0x0400: key
= KEY_MOUSE_1
; break;
3829 case 0x0800: key
= KEY_MOUSE_2
; break;
3833 if (!(cmd
& 0x80)) // pressed key
3835 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
3837 key
= cmd
+ 0x10; // 7x -> 8x
3839 else if (cmd
< 64) // key listed in key_table
3841 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
3845 case 0x0003: key
= '²'; break;
3846 case 0x0008: key
= '{'; break;
3847 case 0x0009: key
= '['; break;
3848 case 0x000A: key
= ']'; break;
3849 case 0x000B: key
= '}'; break;
3850 case 0x000C: key
= '\\'; break;
3851 case 0x001C: key
= '~'; break;
3852 case 0x002D: key
= '|'; break;
3853 case 0x0034: key
= 0xB5; break; // Mu
3856 else if (state
& (STATE_LEFT_CTRL
))
3858 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
3860 key
= key_table
[cmd
] - 'a' + 1;
3864 key
= key_table
[cmd
];
3869 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
3873 key
= key_table
[idx
];
3885 static int analyze
= FALSE
;
3886 static int list
= FALSE
;
3887 static IRMP_DATA irmp_data
;
3888 static int expected_protocol
;
3889 static int expected_address
;
3890 static int expected_command
;
3891 static int do_check_expected_values
;
3896 if (! analyze
&& ! list
)
3900 if (irmp_get_data (&irmp_data
))
3904 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
3908 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
3911 if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
3913 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
3915 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
3916 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
3918 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
3920 char * p
= (char *) NULL
;
3924 case '\t' : p
= "TAB"; break;
3925 case '\r' : p
= "CR"; break;
3926 case KEY_ESCAPE
: p
= "ESCAPE"; break;
3927 case KEY_MENUE
: p
= "MENUE"; break;
3928 case KEY_BACK
: p
= "BACK"; break;
3929 case KEY_FORWARD
: p
= "FORWARD"; break;
3930 case KEY_ADDRESS
: p
= "ADDRESS"; break;
3931 case KEY_WINDOW
: p
= "WINDOW"; break;
3932 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
3933 case KEY_STOP
: p
= "STOP"; break;
3934 case KEY_MAIL
: p
= "MAIL"; break;
3935 case KEY_FAVORITES
: p
= "FAVORITES"; break;
3936 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
3937 case KEY_SETUP
: p
= "SETUP"; break;
3938 case KEY_FONT
: p
= "FONT"; break;
3939 case KEY_PRINT
: p
= "PRINT"; break;
3940 case KEY_ON_OFF
: p
= "ON_OFF"; break;
3942 case KEY_INSERT
: p
= "INSERT"; break;
3943 case KEY_DELETE
: p
= "DELETE"; break;
3944 case KEY_LEFT
: p
= "LEFT"; break;
3945 case KEY_HOME
: p
= "HOME"; break;
3946 case KEY_END
: p
= "END"; break;
3947 case KEY_UP
: p
= "UP"; break;
3948 case KEY_DOWN
: p
= "DOWN"; break;
3949 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
3950 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
3951 case KEY_RIGHT
: p
= "RIGHT"; break;
3952 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
3953 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
3954 default : p
= "<UNKNWON>"; break;
3957 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
3958 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
3962 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
3963 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
3968 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
3969 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
3972 if (do_check_expected_values
)
3974 if (irmp_data
.protocol
!= expected_protocol
||
3975 irmp_data
.address
!= expected_address
||
3976 irmp_data
.command
!= expected_command
)
3978 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
3979 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
3983 printf (" checked!\n");
3985 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
3996 main (int argc
, char ** argv
)
4004 int start_pulses
[256];
4005 int start_pauses
[256];
4009 int first_pulse
= TRUE
;
4010 int first_pause
= TRUE
;
4014 if (! strcmp (argv
[1], "-v"))
4018 else if (! strcmp (argv
[1], "-l"))
4022 else if (! strcmp (argv
[1], "-a"))
4026 else if (! strcmp (argv
[1], "-s"))
4030 else if (! strcmp (argv
[1], "-p"))
4037 for (i
= 0; i
< 256; i
++)
4039 start_pulses
[i
] = 0;
4040 start_pauses
[i
] = 0;
4047 while ((ch
= getchar ()) != EOF
)
4049 if (ch
== '_' || ch
== '0')
4057 printf ("pause: %d\n", pause
);
4066 start_pauses
[pause
]++;
4068 first_pause
= FALSE
;
4084 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
4090 printf ("pulse: %d ", pulse
);
4099 start_pulses
[pulse
]++;
4101 first_pulse
= FALSE
;
4117 else if (ch
== '\n')
4122 if (list
&& pause
> 0)
4124 printf ("pause: %d\n", pause
);
4130 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
4144 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
4155 puts ("-------------------------------------------------------------------");
4159 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
4161 if (ch
!= '\r') // ignore CR in DOS/Windows files
4163 if (ch
== '[' && idx
== -1)
4171 do_check_expected_values
= FALSE
;
4175 expected_protocol
= atoi (buf
);
4177 if (expected_protocol
> 0)
4186 if (sscanf (p
, "%x", &expected_address
) == 1)
4188 do_check_expected_values
= TRUE
;
4195 if (do_check_expected_values
)
4197 do_check_expected_values
= FALSE
;
4205 if (sscanf (p
, "%x", &expected_command
) == 1)
4207 do_check_expected_values
= TRUE
;
4214 if (do_check_expected_values
)
4216 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
4221 else if (idx
< 1024 - 2)
4241 print_spectrum ("START PULSES", start_pulses
, TRUE
);
4242 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
4243 print_spectrum ("PULSES", pulses
, TRUE
);
4244 print_spectrum ("PAUSES", pauses
, FALSE
);
4245 puts ("-------------------------------------------------------------------------------");