/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* irmp.c - infrared multi-protocol decoder, supports several remote control protocols\r
*\r
- * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irmp.c,v 1.174 2015/05/28 06:48:19 fm Exp $\r
+ * $Id: irmp.c,v 1.190 2016/12/16 09:18:11 fm Exp $\r
*\r
* Supported AVR mikrocontrollers:\r
*\r
#endif\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_S100_PROTOCOL == 1 || \\r
IRMP_SUPPORT_RC6_PROTOCOL == 1 || \\r
IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \\r
IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \\r
#define MIN_TOLERANCE_00 1.0 // -0%\r
#define MAX_TOLERANCE_00 1.0 // +0%\r
\r
+#define MIN_TOLERANCE_02 0.98 // -2%\r
+#define MAX_TOLERANCE_02 1.02 // +2%\r
+\r
+#define MIN_TOLERANCE_03 0.97 // -3%\r
+#define MAX_TOLERANCE_03 1.03 // +3%\r
+\r
#define MIN_TOLERANCE_05 0.95 // -5%\r
#define MAX_TOLERANCE_05 1.05 // +5%\r
\r
#define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
#define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
#define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
-#define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)\r
-#define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)\r
-#define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r
-#define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r
-#define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)\r
-#define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)\r
+#define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+#define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+\r
+#define MITSU_HEAVY_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define MITSU_HEAVY_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define MITSU_HEAVY_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define MITSU_HEAVY_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define MITSU_HEAVY_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define MITSU_HEAVY_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+#define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+\r
+#define VINCENT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define VINCENT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define VINCENT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define VINCENT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define VINCENT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define VINCENT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define VINCENT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define VINCENT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+#define VINCENT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define VINCENT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+\r
+#define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r
+#define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r
+#define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
+#define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
+#define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
\r
#define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
#define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
#define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
+#if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:\r
+#define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r
+#define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r
+#else\r
+#define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#endif\r
+\r
+#define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+\r
#define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
#define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
#define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
\r
+#define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r
+#define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r
+#define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r
+#define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r
+#define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r
+#define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r
+#define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r
+#define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r
+#define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r
+#define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r
+\r
#define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
static const char proto_merlin[] PROGMEM = "MERLIN";\r
static const char proto_pentax[] PROGMEM = "PENTAX";\r
static const char proto_fan[] PROGMEM = "FAN";\r
+static const char proto_s100[] PROGMEM = "S100";\r
+static const char proto_acp24[] PROGMEM = "ACP24";\r
+static const char proto_technics[] PROGMEM = "TECHNICS";\r
+static const char proto_panasonic[] PROGMEM = "PANASONIC";\r
+static const char proto_mitsu_heavy[] PROGMEM = "MITSU_HEAVY";\r
+static const char proto_vincent[] PROGMEM = "VINCENT";\r
\r
static const char proto_radio1[] PROGMEM = "RADIO1";\r
\r
proto_merlin,\r
proto_pentax,\r
proto_fan,\r
+ proto_s100,\r
+ proto_acp24,\r
+ proto_technics,\r
+ proto_panasonic,\r
+ proto_mitsu_heavy,\r
+ proto_vincent,\r
proto_radio1\r
};\r
\r
# include "stm32f4xx_usart.h"\r
#elif defined(ARM_STM32F10X)\r
# define STM32_UART_COM USART3 // UART3 on PB10\r
+#elif defined(ARDUINO) // Arduino Serial implementation\r
+# if defined(USB_SERIAL)\r
+# include "usb_serial.h"\r
+# else\r
+# error USB_SERIAL not defined in ARDUINO Environment\r
+# endif\r
#else\r
# if IRMP_EXT_LOGGING == 1 // use external logging\r
# include "irmpextlog.h"\r
// Oversampling\r
USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);\r
\r
- // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS\r
+ // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS\r
USART_InitStructure.USART_BaudRate = STM32_UART_BAUD;\r
USART_InitStructure.USART_WordLength = USART_WordLength_8b;\r
USART_InitStructure.USART_StopBits = USART_StopBits_1;\r
// Oversampling\r
USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);\r
\r
- // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS\r
+ // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS\r
USART_InitStructure.USART_BaudRate = 115200;\r
USART_InitStructure.USART_WordLength = USART_WordLength_8b;\r
USART_InitStructure.USART_StopBits = USART_StopBits_1;\r
// UART enable\r
USART_Cmd(STM32_UART_COM, ENABLE);\r
\r
+#elif defined(ARDUINO)\r
+ // we use the Arduino Serial Imlementation\r
+ // you have to call Serial.begin(SER_BAUD); in Arduino setup() function\r
+\r
#elif defined (__AVR_XMEGA__)\r
\r
- PMIC.CTRL |= PMIC_HILVLEN_bm;\r
+ PMIC.CTRL |= PMIC_HILVLEN_bm;\r
+\r
+ USARTC1.BAUDCTRLB = 0;\r
+ USARTC1.BAUDCTRLA = F_CPU / 153600 - 1;\r
+ USARTC1.CTRLA = USART_RXCINTLVL_HI_gc; // high INT level (receive)\r
+ USARTC1.CTRLB = USART_TXEN_bm | USART_RXEN_bm; // activated RX and TX\r
+ USARTC1.CTRLC = USART_CHSIZE_8BIT_gc; // 8 Bit\r
+ PORTC.DIR |= (1<<7); // TXD is output\r
+ PORTC.DIR &= ~(1<<6);\r
\r
- USARTC1.BAUDCTRLB = 0;\r
- USARTC1.BAUDCTRLA = F_CPU /153600-1;\r
- USARTC1.CTRLA = USART_RXCINTLVL_HI_gc; // High Level (Empfangen)\r
- USARTC1.CTRLB = USART_TXEN_bm | USART_RXEN_bm; //Aktiviert Senden und Empfangen\r
- USARTC1.CTRLC = USART_CHSIZE_8BIT_gc; //Größe der Zeichen: 8 Bit\r
- PORTC.DIR |= (1<<7); //TXD als Ausgang setzen\r
- PORTC.DIR &= ~(1<<6);\r
- \r
#else\r
\r
#if (IRMP_EXT_LOGGING == 0) // use UART\r
USART_SendData(STM32_UART_COM, '\r');\r
}\r
\r
+#elif defined(ARDUINO)\r
+ // we use the Arduino Serial Imlementation\r
+ usb_serial_putchar(ch);\r
+\r
#else\r
#if (IRMP_EXT_LOGGING == 0)\r
\r
\r
#endif\r
\r
+#if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER panasonic_param =\r
+{\r
+ IRMP_PANASONIC_PROTOCOL, // protocol: ir protocol\r
+ PANASONIC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ PANASONIC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ PANASONIC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ PANASONIC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ PANASONIC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ PANASONIC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ PANASONIC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ PANASONIC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ PANASONIC_ADDRESS_OFFSET, // address_offset: address offset\r
+ PANASONIC_ADDRESS_OFFSET + PANASONIC_ADDRESS_LEN, // address_end: end of address\r
+ PANASONIC_COMMAND_OFFSET, // command_offset: command offset\r
+ PANASONIC_COMMAND_OFFSET + PANASONIC_COMMAND_LEN, // command_end: end of command\r
+ PANASONIC_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ PANASONIC_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ PANASONIC_LSB, // lsb_first: flag: LSB first\r
+ PANASONIC_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
+#if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER mitsu_heavy_param =\r
+{\r
+ IRMP_MITSU_HEAVY_PROTOCOL, // protocol: ir protocol\r
+ MITSU_HEAVY_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ MITSU_HEAVY_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ MITSU_HEAVY_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ MITSU_HEAVY_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ MITSU_HEAVY_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ MITSU_HEAVY_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ MITSU_HEAVY_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ MITSU_HEAVY_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ MITSU_HEAVY_ADDRESS_OFFSET, // address_offset: address offset\r
+ MITSU_HEAVY_ADDRESS_OFFSET + MITSU_HEAVY_ADDRESS_LEN, // address_end: end of address\r
+ MITSU_HEAVY_COMMAND_OFFSET, // command_offset: command offset\r
+ MITSU_HEAVY_COMMAND_OFFSET + MITSU_HEAVY_COMMAND_LEN, // command_end: end of command\r
+ MITSU_HEAVY_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ MITSU_HEAVY_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ MITSU_HEAVY_LSB, // lsb_first: flag: LSB first\r
+ MITSU_HEAVY_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
+#if IRMP_SUPPORT_VINCENT_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER vincent_param =\r
+{\r
+ IRMP_VINCENT_PROTOCOL, // protocol: ir protocol\r
+ VINCENT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ VINCENT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ VINCENT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ VINCENT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ VINCENT_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ VINCENT_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ VINCENT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ VINCENT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ VINCENT_ADDRESS_OFFSET, // address_offset: address offset\r
+ VINCENT_ADDRESS_OFFSET + VINCENT_ADDRESS_LEN, // address_end: end of address\r
+ VINCENT_COMMAND_OFFSET, // command_offset: command offset\r
+ VINCENT_COMMAND_OFFSET + VINCENT_COMMAND_LEN, // command_end: end of command\r
+ VINCENT_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ VINCENT_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ VINCENT_LSB, // lsb_first: flag: LSB first\r
+ VINCENT_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
#if IRMP_SUPPORT_RECS80_PROTOCOL == 1\r
\r
static const PROGMEM IRMP_PARAMETER recs80_param =\r
\r
#endif\r
\r
+#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER s100_param =\r
+{\r
+ IRMP_S100_PROTOCOL, // protocol: ir protocol\r
+ S100_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
+ S100_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
+ S100_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
+ S100_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
+ 0, // pulse_0_len_min: here: not used\r
+ 0, // pulse_0_len_max: here: not used\r
+ 0, // pause_0_len_min: here: not used\r
+ 0, // pause_0_len_max: here: not used\r
+ S100_ADDRESS_OFFSET, // address_offset: address offset\r
+ S100_ADDRESS_OFFSET + S100_ADDRESS_LEN, // address_end: end of address\r
+ S100_COMMAND_OFFSET, // command_offset: command offset\r
+ S100_COMMAND_OFFSET + S100_COMMAND_LEN, // command_end: end of command\r
+ S100_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ S100_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ S100_LSB, // lsb_first: flag: LSB first\r
+ S100_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
#if IRMP_SUPPORT_DENON_PROTOCOL == 1\r
\r
static const PROGMEM IRMP_PARAMETER denon_param =\r
\r
#endif\r
\r
+#if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r
+\r
+static const PROGMEM IRMP_PARAMETER acp24_param =\r
+{\r
+ IRMP_ACP24_PROTOCOL, // protocol: ir protocol\r
+ ACP24_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r
+ ACP24_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r
+ ACP24_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r
+ ACP24_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r
+ ACP24_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r
+ ACP24_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r
+ ACP24_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r
+ ACP24_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r
+ ACP24_ADDRESS_OFFSET, // address_offset: address offset\r
+ ACP24_ADDRESS_OFFSET + ACP24_ADDRESS_LEN, // address_end: end of address\r
+ ACP24_COMMAND_OFFSET, // command_offset: command offset\r
+ ACP24_COMMAND_OFFSET + ACP24_COMMAND_LEN, // command_end: end of command\r
+ ACP24_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
+ ACP24_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ ACP24_LSB, // lsb_first: flag: LSB first\r
+ ACP24_FLAGS // flags: some flags\r
+};\r
+\r
+#endif\r
+\r
#if IRMP_SUPPORT_RADIO1_PROTOCOL == 1\r
\r
static const PROGMEM IRMP_PARAMETER radio1_param =\r
\r
#endif\r
\r
-static uint_fast8_t irmp_bit; // current bit position\r
-static IRMP_PARAMETER irmp_param;\r
+static uint_fast8_t irmp_bit; // current bit position\r
+static IRMP_PARAMETER irmp_param;\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
-static IRMP_PARAMETER irmp_param2;\r
+static IRMP_PARAMETER irmp_param2;\r
+#endif\r
+\r
+static volatile uint_fast8_t irmp_ir_detected = FALSE;\r
+static volatile uint_fast8_t irmp_protocol;\r
+static volatile uint_fast16_t irmp_address;\r
+static volatile uint_fast16_t irmp_command;\r
+static volatile uint_fast16_t irmp_id; // only used for SAMSUNG protocol\r
+static volatile uint_fast8_t irmp_flags;\r
+// static volatile uint_fast8_t irmp_busy_flag;\r
+\r
+#if defined(__MBED__)\r
+// DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp\r
+gpio_t gpioIRin; // use low level c function instead\r
#endif\r
\r
-static volatile uint_fast8_t irmp_ir_detected = FALSE;\r
-static volatile uint_fast8_t irmp_protocol;\r
-static volatile uint_fast16_t irmp_address;\r
-static volatile uint_fast16_t irmp_command;\r
-static volatile uint_fast16_t irmp_id; // only used for SAMSUNG protocol\r
-static volatile uint_fast8_t irmp_flags;\r
-// static volatile uint_fast8_t irmp_busy_flag;\r
\r
#ifdef ANALYZE\r
-#define input(x) (x)\r
-static uint_fast8_t IRMP_PIN;\r
-static uint_fast8_t radio;\r
+#define input(x) (x)\r
+static uint_fast8_t IRMP_PIN;\r
+static uint_fast8_t radio;\r
#endif\r
\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
{\r
#if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing\r
#elif defined (ARM_STM32) // STM32\r
- GPIO_InitTypeDef GPIO_InitStructure;\r
-\r
- /* GPIOx clock enable */\r
- #if defined (ARM_STM32L1XX)\r
- RCC_AHBPeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
- #elif defined (ARM_STM32F10X)\r
- RCC_APB2PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
- #elif defined (ARM_STM32F4XX)\r
- RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
- #endif\r
-\r
- /* GPIO Configuration */\r
- GPIO_InitStructure.GPIO_Pin = IRMP_BIT;\r
- #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)\r
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;\r
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
- GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r
- GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\r
- #elif defined (ARM_STM32F10X)\r
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;\r
- #endif\r
- GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r
+ GPIO_InitTypeDef GPIO_InitStructure;\r
+\r
+ /* GPIOx clock enable */\r
+# if defined (ARM_STM32L1XX)\r
+ RCC_AHBPeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
+# elif defined (ARM_STM32F10X)\r
+ RCC_APB2PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
+# elif defined (ARM_STM32F4XX)\r
+ RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r
+# endif\r
+\r
+ /* GPIO Configuration */\r
+ GPIO_InitStructure.GPIO_Pin = IRMP_BIT;\r
+# if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)\r
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;\r
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
+ GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r
+ GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\r
+# elif defined (ARM_STM32F10X)\r
+ GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;\r
+# endif\r
+ GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r
+\r
#elif defined(STELLARIS_ARM_CORTEX_M4)\r
- // Enable the GPIO port\r
- ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH);\r
-\r
- // Set as an input\r
- ROM_GPIODirModeSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_DIR_MODE_IN);\r
- ROM_GPIOPadConfigSet(IRMP_PORT_BASE, IRMP_PORT_PIN,\r
- GPIO_STRENGTH_2MA,\r
- GPIO_PIN_TYPE_STD_WPU);\r
+ // Enable the GPIO port\r
+ ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH);\r
+\r
+ // Set as an input\r
+ ROM_GPIODirModeSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_DIR_MODE_IN);\r
+ ROM_GPIOPadConfigSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);\r
+\r
+#elif defined(__SDCC_stm8) // STM8\r
+ IRMP_GPIO_STRUCT->DDR &= ~(1<<IRMP_BIT); // pin is input\r
+ IRMP_GPIO_STRUCT->CR1 |= (1<<IRMP_BIT); // activate pullup\r
+\r
+#elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r
+ pinMode(IRMP_PIN, INPUT);\r
+\r
+#elif defined(__xtensa__) // ESP8266\r
+ // select pin function\r
+# if (IRMP_BIT_NUMBER == 12)\r
+ PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);\r
+// doesn't work for me:\r
+// # elif (IRMP_BIT_NUMBER == 13)\r
+// PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);\r
+# else\r
+# warning Please add PIN_FUNC_SELECT when necessary.\r
+# endif\r
+ GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER);\r
+\r
+#elif defined(__MBED__)\r
+ gpio_init_in_ex(&gpioIRin, IRMP_PIN, IRMP_PINMODE); // initialize input for IR diode\r
+\r
#else // AVR\r
IRMP_PORT &= ~(1<<IRMP_BIT); // deactivate pullup\r
IRMP_DDR &= ~(1<<IRMP_BIT); // set pin to input\r
}\r
break;\r
#endif\r
+\r
+\r
+#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
+ case IRMP_VINCENT_PROTOCOL:\r
+ if ((irmp_command >> 8) == (irmp_command & 0x00FF))\r
+ {\r
+ irmp_command &= 0xff;\r
+ rtc = TRUE;\r
+ }\r
+ break;\r
+#endif\r
+\r
#if IRMP_SUPPORT_BOSE_PROTOCOL == 1\r
case IRMP_BOSE_PROTOCOL:\r
if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r
rtc = TRUE;\r
break;\r
#endif\r
+#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
+ case IRMP_S100_PROTOCOL:\r
+ irmp_address &= ~0x20; // clear toggle bit\r
+ rtc = TRUE;\r
+ break;\r
+#endif\r
#if IRMP_SUPPORT_IR60_PROTOCOL == 1\r
case IRMP_IR60_PROTOCOL:\r
if (irmp_command != 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame\r
static uint_fast8_t parity; // number of '1' of the first 14 bits, check if even.\r
#endif\r
\r
+#if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+static uint_fast8_t check; // number of '1' of the first 14 bits, check if even.\r
+static uint_fast8_t mitsu_parity; // number of '1' of the first 14 bits, check if even.\r
+#endif\r
+\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* store bit\r
* @details store bit in temp address or temp command\r
static void\r
irmp_store_bit (uint_fast8_t value)\r
{\r
+#if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_ACP24_PROTOCOL) // squeeze 64 bits into 16 bits:\r
+ {\r
+ if (value)\r
+ {\r
+ // ACP24-Frame:\r
+ // 1 2 3 4 5 6\r
+ // 0123456789012345678901234567890123456789012345678901234567890123456789\r
+ // N VVMMM ? ??? t vmA x y TTTT\r
+ //\r
+ // irmp_data_p->command:\r
+ //\r
+ // 5432109876543210\r
+ // NAVVvMMMmtxyTTTT\r
+\r
+ switch (irmp_bit)\r
+ {\r
+ case 0: irmp_tmp_command |= (1<<15); break; // N\r
+ case 2: irmp_tmp_command |= (1<<13); break; // V\r
+ case 3: irmp_tmp_command |= (1<<12); break; // V\r
+ case 4: irmp_tmp_command |= (1<<10); break; // M\r
+ case 5: irmp_tmp_command |= (1<< 9); break; // M\r
+ case 6: irmp_tmp_command |= (1<< 8); break; // M\r
+ case 20: irmp_tmp_command |= (1<< 6); break; // t\r
+ case 22: irmp_tmp_command |= (1<<11); break; // v\r
+ case 23: irmp_tmp_command |= (1<< 7); break; // m\r
+ case 24: irmp_tmp_command |= (1<<14); break; // A\r
+ case 26: irmp_tmp_command |= (1<< 5); break; // x\r
+ case 44: irmp_tmp_command |= (1<< 4); break; // y\r
+ case 66: irmp_tmp_command |= (1<< 3); break; // T\r
+ case 67: irmp_tmp_command |= (1<< 2); break; // T\r
+ case 68: irmp_tmp_command |= (1<< 1); break; // T\r
+ case 69: irmp_tmp_command |= (1<< 0); break; // T\r
+ }\r
+ }\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_ACP24_PROTOCOL\r
+\r
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)\r
{\r
}\r
}\r
}\r
+ else\r
#endif\r
+ {\r
+ ;\r
+ }\r
\r
#if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r
if (irmp_bit == 0 && irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL)\r
{\r
if (irmp_bit >= 20 && irmp_bit < 24)\r
{\r
- irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first\r
+ irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first\r
}\r
else if (irmp_bit >= 24 && irmp_bit < 28)\r
{\r
- genre2 |= (((uint_fast8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first\r
+ genre2 |= (((uint_fast8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first\r
}\r
\r
if (irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)\r
}\r
else\r
#endif\r
+\r
+#if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_MITSU_HEAVY_PROTOCOL) // squeeze 64 bits into 16 bits:\r
+ {\r
+ if (irmp_bit == 72 )\r
+ { // irmp_tmp_address, irmp_tmp_command received: check parity & compress\r
+ mitsu_parity = PARITY_CHECK_OK;\r
+\r
+ check = irmp_tmp_address >> 8; // inverted upper byte == lower byte?\r
+ check = ~ check;\r
+\r
+ if (check == (irmp_tmp_address & 0xFF))\r
+ { // ok:\r
+ irmp_tmp_address <<= 8; // throw away upper byte\r
+ }\r
+ else\r
+ {\r
+ mitsu_parity = PARITY_CHECK_FAILED;\r
+ }\r
+\r
+ check = irmp_tmp_command >> 8; // inverted upper byte == lower byte?\r
+ check = ~ check;\r
+ if (check == (irmp_tmp_command & 0xFF))\r
+ { // ok: pack together\r
+ irmp_tmp_address |= irmp_tmp_command & 0xFF; // byte 1, byte2 in irmp_tmp_address, irmp_tmp_command can be used for byte 3\r
+ }\r
+ else\r
+ {\r
+ mitsu_parity = PARITY_CHECK_FAILED;\r
+ }\r
+ irmp_tmp_command = 0;\r
+ }\r
+\r
+ if (irmp_bit >= 72 )\r
+ { // receive 3. word in irmp_tmp_command\r
+ irmp_tmp_command <<= 1;\r
+ irmp_tmp_command |= value;\r
+ }\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL\r
{\r
;\r
}\r
static uint_fast16_t last_irmp_denon_command; // save last irmp command to recognize DENON frame repetition\r
static uint_fast16_t denon_repetition_len = 0xFFFF; // denon repetition len of 2nd auto generated frame\r
#endif\r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1\r
static uint_fast8_t rc5_cmd_bit6; // bit 6 of RC5 command is the inverted 2nd start bit\r
#endif\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
time_counter++;\r
#endif // ANALYZE\r
\r
+#if defined(__SDCC_stm8)\r
+ irmp_input = input(IRMP_GPIO_STRUCT->IDR)\r
+#elif defined(__MBED__)\r
+ //irmp_input = inputPin;\r
+ irmp_input = gpio_read (&gpioIRin);\r
+#else\r
irmp_input = input(IRMP_PIN);\r
+#endif\r
\r
#if IRMP_USE_CALLBACK == 1\r
if (irmp_callback_ptr)\r
#endif\r
irmp_bit = 0xff;\r
irmp_pause_time = 1; // 1st pause: set to 1, not to 0!\r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1\r
rc5_cmd_bit6 = 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!\r
#endif\r
}\r
else\r
#endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
\r
+#if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r
+ if (irmp_pulse_time >= ACP24_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ACP24_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= ACP24_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ACP24_START_BIT_PAUSE_LEN_MAX)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ ACP24_START_BIT_PULSE_LEN_MIN, ACP24_START_BIT_PULSE_LEN_MAX,\r
+ ACP24_START_BIT_PAUSE_LEN_MIN, ACP24_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &acp24_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_PENTAX_PROTOCOL == 1\r
if (irmp_pulse_time >= PENTAX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PENTAX_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= PENTAX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PENTAX_START_BIT_PAUSE_LEN_MAX)\r
else\r
#endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
\r
+#if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r
+ if (irmp_pulse_time >= PANASONIC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PANASONIC_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= PANASONIC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PANASONIC_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's PANASONIC\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ PANASONIC_START_BIT_PULSE_LEN_MIN, PANASONIC_START_BIT_PULSE_LEN_MAX,\r
+ PANASONIC_START_BIT_PAUSE_LEN_MIN, PANASONIC_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &panasonic_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+ if (irmp_pulse_time >= MITSU_HEAVY_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MITSU_HEAVY_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's MITSU_HEAVY\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = MITSU_HEAVY, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ MITSU_HEAVY_START_BIT_PULSE_LEN_MIN, MITSU_HEAVY_START_BIT_PULSE_LEN_MAX,\r
+ MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN, MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &mitsu_heavy_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_VINCENT_PROTOCOL == 1\r
+ if (irmp_pulse_time >= VINCENT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= VINCENT_START_BIT_PULSE_LEN_MAX &&\r
+ irmp_pause_time >= VINCENT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= VINCENT_START_BIT_PAUSE_LEN_MAX)\r
+ { // it's VINCENT\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = VINCENT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ VINCENT_START_BIT_PULSE_LEN_MIN, VINCENT_START_BIT_PULSE_LEN_MAX,\r
+ VINCENT_START_BIT_PAUSE_LEN_MIN, VINCENT_START_BIT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_param_p = (IRMP_PARAMETER *) &vincent_param;\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_VINCENT_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RADIO1_PROTOCOL == 1\r
if (irmp_pulse_time >= RADIO1_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RADIO1_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= RADIO1_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RADIO1_START_BIT_PAUSE_LEN_MAX)\r
else\r
#endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1\r
\r
+#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
+ if (((irmp_pulse_time >= S100_START_BIT_LEN_MIN && irmp_pulse_time <= S100_START_BIT_LEN_MAX) ||\r
+ (irmp_pulse_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX)) &&\r
+ ((irmp_pause_time >= S100_START_BIT_LEN_MIN && irmp_pause_time <= S100_START_BIT_LEN_MAX) ||\r
+ (irmp_pause_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX)))\r
+ { // it's S100\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",\r
+ S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r
+ 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX,\r
+ S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r
+ 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX);\r
+#endif // ANALYZE\r
+\r
+ irmp_param_p = (IRMP_PARAMETER *) &s100_param;\r
+ last_pause = irmp_pause_time;\r
+\r
+ if ((irmp_pulse_time > S100_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX) ||\r
+ (irmp_pause_time > S100_START_BIT_LEN_MAX && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX))\r
+ {\r
+ last_value = 0;\r
+ rc5_cmd_bit6 = 1<<6;\r
+ }\r
+ else\r
+ {\r
+ last_value = 1;\r
+ }\r
+ }\r
+ else\r
+#endif // IRMP_SUPPORT_S100_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1\r
if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||\r
(irmp_pulse_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX)) &&\r
else if (irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN)\r
{\r
#ifdef ANALYZE\r
- ANALYZE_PRINTF ("Switching to NOKIA protocol\n");\r
+ ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit);\r
#endif // ANALYZE\r
irmp_param.protocol = IRMP_NOKIA_PROTOCOL; // change protocol\r
irmp_param.address_offset = NOKIA_ADDRESS_OFFSET;\r
{\r
irmp_bit++;\r
}\r
+#if IRMP_SUPPORT_NEC_PROTOCOL == 1\r
+ else if ((irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL) && irmp_bit == 0)\r
+ { // it was a non-standard repetition frame\r
+#ifdef ANALYZE // with 4500µs pause instead of 2250µs\r
+ ANALYZE_PRINTF ("Detected non-standard repetition frame, switching to NEC repetition\n");\r
+#endif // ANALYZE\r
+ if (key_repetition_len < NEC_FRAME_REPEAT_PAUSE_LEN_MAX)\r
+ {\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ irmp_param.protocol = IRMP_NEC_PROTOCOL; // switch protocol\r
+ irmp_param.complete_len = irmp_bit; // patch length: 16 or 17\r
+ irmp_tmp_address = last_irmp_address; // address is last address\r
+ irmp_tmp_command = last_irmp_command; // command is last command\r
+ irmp_flags |= IRMP_FLAG_REPETITION;\r
+ key_repetition_len = 0;\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("ignoring NEC repetition frame: timeout occured, key_repetition_len = %d > %d\n",\r
+ key_repetition_len, NEC_FRAME_REPEAT_PAUSE_LEN_MAX);\r
+#endif // ANALYZE\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ }\r
+#endif // IRMP_SUPPORT_NEC_PROTOCOL == 1\r
#if IRMP_SUPPORT_JVC_PROTOCOL == 1\r
else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit\r
{\r
irmp_param.complete_len = irmp_bit; // patch length\r
}\r
#endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1\r
+\r
+#if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1\r
+ else if (irmp_param.protocol == IRMP_MATSUSHITA_PROTOCOL && irmp_bit == 22) // it was a TECHNICS stop bit\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit);\r
+#endif // ANALYZE\r
+ // Situation:\r
+ // The first 12 bits have been stored in irmp_tmp_command (LSB first)\r
+ // The following 10 bits have been stored in irmp_tmp_address (LSB first)\r
+ // The code of TECHNICS is:\r
+ // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)\r
+ // ccccccccccccaaaaaaaaaa\r
+ // where C is inverted value of c\r
+\r
+ irmp_tmp_address <<= 1;\r
+ if (irmp_tmp_command & (1<<11))\r
+ {\r
+ irmp_tmp_address |= 1;\r
+ irmp_tmp_command &= ~(1<<11);\r
+ }\r
+\r
+ if (irmp_tmp_command == ((~irmp_tmp_address) & 0x07FF))\r
+ {\r
+ irmp_tmp_address = 0;\r
+\r
+ irmp_param.protocol = IRMP_TECHNICS_PROTOCOL; // switch protocol\r
+ irmp_param.complete_len = irmp_bit; // patch length\r
+ }\r
+ else\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");\r
+ ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r
+#endif // ANALYZE\r
+ irmp_start_bit_detected = 0; // wait for another start bit...\r
+ irmp_pulse_time = 0;\r
+ irmp_pause_time = 0;\r
+ }\r
+ }\r
+#endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1\r
else\r
{\r
#ifdef ANALYZE\r
else\r
#endif\r
\r
-#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r
+#if 0 && IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame\r
// if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame\r
if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && repetition_frame_number == 1)\r
{\r
else\r
#endif\r
\r
-#if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r
+#if 0 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame\r
// if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame\r
if ((irmp_param.protocol == IRMP_SAMSUNG32_PROTOCOL || irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL) && (repetition_frame_number & 0x01))\r
{\r
}\r
#endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
\r
+#if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_MITSU_HEAVY_PROTOCOL)\r
+ {\r
+ check = irmp_tmp_command >> 8; // inverted upper byte == lower byte?\r
+ check = ~ check;\r
+ if (check == (irmp_tmp_command & 0xFF)) { //ok:\r
+ irmp_tmp_command &= 0xFF;\r
+ }\r
+ else mitsu_parity = PARITY_CHECK_FAILED;\r
+ if (mitsu_parity == PARITY_CHECK_FAILED)\r
+ {\r
+#ifdef ANALYZE\r
+ ANALYZE_PRINTF ("error 7: parity check failed\n");\r
+#endif // ANALYZE\r
+ irmp_ir_detected = FALSE;\r
+ }\r
+ }\r
+#endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL\r
+\r
#if IRMP_SUPPORT_RC6_PROTOCOL == 1\r
if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode = 6?\r
{\r
{\r
irmp_tmp_command |= rc5_cmd_bit6; // store bit 6\r
}\r
+#endif\r
+#if IRMP_SUPPORT_S100_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_S100_PROTOCOL)\r
+ {\r
+ irmp_tmp_command |= rc5_cmd_bit6; // store bit 6\r
+ }\r
#endif\r
irmp_command = irmp_tmp_command; // store command\r
\r
* Compile it under linux with:\r
* cc irmp.c -o irmp\r
*\r
- * usage: ./irmp [-v|-s|-a|-l|-p] < file\r
+ * usage: ./irmp [-v|-s|-a|-l] < file\r
*\r
* options:\r
* -v verbose\r
* -s silent\r
* -a analyze\r
* -l list pulse/pauses\r
- * -p print timings\r
*---------------------------------------------------------------------------------------------------------------------------------------------------\r
*/\r
\r
-static void\r
-print_timings (void)\r
-{\r
- printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN, sizeof (PAUSE_LEN));\r
- printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN);\r
- puts ("");\r
- printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");\r
- printf ("====================================================================================\n");\r
- printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- SIRCS_START_BIT_PULSE_LEN_MIN, SIRCS_START_BIT_PULSE_LEN_MAX, SIRCS_START_BIT_PAUSE_LEN_MIN, SIRCS_START_BIT_PAUSE_LEN_MAX,\r
- SIRCS_0_PULSE_LEN_MIN, SIRCS_0_PULSE_LEN_MAX, SIRCS_PAUSE_LEN_MIN, SIRCS_PAUSE_LEN_MAX,\r
- SIRCS_1_PULSE_LEN_MIN, SIRCS_1_PULSE_LEN_MAX, SIRCS_PAUSE_LEN_MIN, SIRCS_PAUSE_LEN_MAX);\r
-\r
- printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX, NEC_START_BIT_PAUSE_LEN_MIN, NEC_START_BIT_PAUSE_LEN_MAX,\r
- NEC_PULSE_LEN_MIN, NEC_PULSE_LEN_MAX, NEC_0_PAUSE_LEN_MIN, NEC_0_PAUSE_LEN_MAX,\r
- NEC_PULSE_LEN_MIN, NEC_PULSE_LEN_MAX, NEC_1_PAUSE_LEN_MIN, NEC_1_PAUSE_LEN_MAX);\r
-\r
- printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- 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,\r
- NEC_PULSE_LEN_MIN, NEC_PULSE_LEN_MAX, NEC_0_PAUSE_LEN_MIN, NEC_0_PAUSE_LEN_MAX,\r
- NEC_PULSE_LEN_MIN, NEC_PULSE_LEN_MAX, NEC_1_PAUSE_LEN_MIN, NEC_1_PAUSE_LEN_MAX);\r
-\r
- printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- SAMSUNG_START_BIT_PULSE_LEN_MIN, SAMSUNG_START_BIT_PULSE_LEN_MAX, SAMSUNG_START_BIT_PAUSE_LEN_MIN, SAMSUNG_START_BIT_PAUSE_LEN_MAX,\r
- SAMSUNG_PULSE_LEN_MIN, SAMSUNG_PULSE_LEN_MAX, SAMSUNG_0_PAUSE_LEN_MIN, SAMSUNG_0_PAUSE_LEN_MAX,\r
- SAMSUNG_PULSE_LEN_MIN, SAMSUNG_PULSE_LEN_MAX, SAMSUNG_1_PAUSE_LEN_MIN, SAMSUNG_1_PAUSE_LEN_MAX);\r
-\r
- printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- MATSUSHITA_START_BIT_PULSE_LEN_MIN, MATSUSHITA_START_BIT_PULSE_LEN_MAX, MATSUSHITA_START_BIT_PAUSE_LEN_MIN, MATSUSHITA_START_BIT_PAUSE_LEN_MAX,\r
- MATSUSHITA_PULSE_LEN_MIN, MATSUSHITA_PULSE_LEN_MAX, MATSUSHITA_0_PAUSE_LEN_MIN, MATSUSHITA_0_PAUSE_LEN_MAX,\r
- MATSUSHITA_PULSE_LEN_MIN, MATSUSHITA_PULSE_LEN_MAX, MATSUSHITA_1_PAUSE_LEN_MIN, MATSUSHITA_1_PAUSE_LEN_MAX);\r
-\r
- printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- KASEIKYO_START_BIT_PULSE_LEN_MIN, KASEIKYO_START_BIT_PULSE_LEN_MAX, KASEIKYO_START_BIT_PAUSE_LEN_MIN, KASEIKYO_START_BIT_PAUSE_LEN_MAX,\r
- KASEIKYO_PULSE_LEN_MIN, KASEIKYO_PULSE_LEN_MAX, KASEIKYO_0_PAUSE_LEN_MIN, KASEIKYO_0_PAUSE_LEN_MAX,\r
- KASEIKYO_PULSE_LEN_MIN, KASEIKYO_PULSE_LEN_MAX, KASEIKYO_1_PAUSE_LEN_MIN, KASEIKYO_1_PAUSE_LEN_MAX);\r
-\r
- printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- RECS80_START_BIT_PULSE_LEN_MIN, RECS80_START_BIT_PULSE_LEN_MAX, RECS80_START_BIT_PAUSE_LEN_MIN, RECS80_START_BIT_PAUSE_LEN_MAX,\r
- RECS80_PULSE_LEN_MIN, RECS80_PULSE_LEN_MAX, RECS80_0_PAUSE_LEN_MIN, RECS80_0_PAUSE_LEN_MAX,\r
- RECS80_PULSE_LEN_MIN, RECS80_PULSE_LEN_MAX, RECS80_1_PAUSE_LEN_MIN, RECS80_1_PAUSE_LEN_MAX);\r
-\r
- printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",\r
- RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX, RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r
- RC5_BIT_LEN_MIN, RC5_BIT_LEN_MAX);\r
-\r
- printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX,\r
- DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX, DENON_0_PAUSE_LEN_MIN, DENON_0_PAUSE_LEN_MAX,\r
- DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX, DENON_1_PAUSE_LEN_MIN, DENON_1_PAUSE_LEN_MAX);\r
-\r
- printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX,\r
- THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX, THOMSON_0_PAUSE_LEN_MIN, THOMSON_0_PAUSE_LEN_MAX,\r
- THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX, THOMSON_1_PAUSE_LEN_MIN, THOMSON_1_PAUSE_LEN_MAX);\r
-\r
- printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- RC6_START_BIT_PULSE_LEN_MIN, RC6_START_BIT_PULSE_LEN_MAX, RC6_START_BIT_PAUSE_LEN_MIN, RC6_START_BIT_PAUSE_LEN_MAX,\r
- RC6_BIT_PULSE_LEN_MIN, RC6_BIT_PULSE_LEN_MAX, RC6_BIT_PAUSE_LEN_MIN, RC6_BIT_PAUSE_LEN_MAX);\r
-\r
- printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- RECS80EXT_START_BIT_PULSE_LEN_MIN, RECS80EXT_START_BIT_PULSE_LEN_MAX, RECS80EXT_START_BIT_PAUSE_LEN_MIN, RECS80EXT_START_BIT_PAUSE_LEN_MAX,\r
- RECS80EXT_PULSE_LEN_MIN, RECS80EXT_PULSE_LEN_MAX, RECS80EXT_0_PAUSE_LEN_MIN, RECS80EXT_0_PAUSE_LEN_MAX,\r
- RECS80EXT_PULSE_LEN_MIN, RECS80EXT_PULSE_LEN_MAX, RECS80EXT_1_PAUSE_LEN_MIN, RECS80EXT_1_PAUSE_LEN_MAX);\r
-\r
- printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- NUBERT_START_BIT_PULSE_LEN_MIN, NUBERT_START_BIT_PULSE_LEN_MAX, NUBERT_START_BIT_PAUSE_LEN_MIN, NUBERT_START_BIT_PAUSE_LEN_MAX,\r
- NUBERT_0_PULSE_LEN_MIN, NUBERT_0_PULSE_LEN_MAX, NUBERT_0_PAUSE_LEN_MIN, NUBERT_0_PAUSE_LEN_MAX,\r
- NUBERT_1_PULSE_LEN_MIN, NUBERT_1_PULSE_LEN_MAX, NUBERT_1_PAUSE_LEN_MIN, NUBERT_1_PAUSE_LEN_MAX);\r
-\r
- printf ("FAN 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- FAN_START_BIT_PULSE_LEN_MIN, FAN_START_BIT_PULSE_LEN_MAX, FAN_START_BIT_PAUSE_LEN_MIN, FAN_START_BIT_PAUSE_LEN_MAX,\r
- FAN_0_PULSE_LEN_MIN, FAN_0_PULSE_LEN_MAX, FAN_0_PAUSE_LEN_MIN, FAN_0_PAUSE_LEN_MAX,\r
- FAN_1_PULSE_LEN_MIN, FAN_1_PULSE_LEN_MAX, FAN_1_PAUSE_LEN_MIN, FAN_1_PAUSE_LEN_MAX);\r
-\r
- printf ("SPEAKER 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- SPEAKER_START_BIT_PULSE_LEN_MIN, SPEAKER_START_BIT_PULSE_LEN_MAX, SPEAKER_START_BIT_PAUSE_LEN_MIN, SPEAKER_START_BIT_PAUSE_LEN_MAX,\r
- SPEAKER_0_PULSE_LEN_MIN, SPEAKER_0_PULSE_LEN_MAX, SPEAKER_0_PAUSE_LEN_MIN, SPEAKER_0_PAUSE_LEN_MAX,\r
- SPEAKER_1_PULSE_LEN_MIN, SPEAKER_1_PULSE_LEN_MAX, SPEAKER_1_PAUSE_LEN_MIN, SPEAKER_1_PAUSE_LEN_MAX);\r
-\r
- printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX);\r
-\r
- printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX);\r
-\r
- printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX);\r
-\r
- printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",\r
- BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX,\r
- BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX);\r
-\r
- printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- BANG_OLUFSEN_PULSE_LEN_MIN, BANG_OLUFSEN_PULSE_LEN_MAX, BANG_OLUFSEN_0_PAUSE_LEN_MIN, BANG_OLUFSEN_0_PAUSE_LEN_MAX,\r
- BANG_OLUFSEN_PULSE_LEN_MIN, BANG_OLUFSEN_PULSE_LEN_MAX, BANG_OLUFSEN_1_PAUSE_LEN_MIN, BANG_OLUFSEN_1_PAUSE_LEN_MAX);\r
-\r
- printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",\r
- GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX,\r
- GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX,\r
- GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX);\r
-\r
- printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r
- SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX,\r
- SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX,\r
- SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX,\r
- 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX,\r
- 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX);\r
-\r
- printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX, FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX,\r
- FDC_PULSE_LEN_MIN, FDC_PULSE_LEN_MAX, FDC_0_PAUSE_LEN_MIN, FDC_0_PAUSE_LEN_MAX,\r
- FDC_PULSE_LEN_MIN, FDC_PULSE_LEN_MAX, FDC_1_PAUSE_LEN_MIN, FDC_1_PAUSE_LEN_MAX);\r
-\r
- printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX, RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX,\r
- RCCAR_PULSE_LEN_MIN, RCCAR_PULSE_LEN_MAX, RCCAR_0_PAUSE_LEN_MIN, RCCAR_0_PAUSE_LEN_MAX,\r
- RCCAR_PULSE_LEN_MIN, RCCAR_PULSE_LEN_MAX, RCCAR_1_PAUSE_LEN_MIN, RCCAR_1_PAUSE_LEN_MAX);\r
-\r
- printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- NIKON_START_BIT_PULSE_LEN_MIN, NIKON_START_BIT_PULSE_LEN_MAX, NIKON_START_BIT_PAUSE_LEN_MIN, NIKON_START_BIT_PAUSE_LEN_MAX,\r
- NIKON_PULSE_LEN_MIN, NIKON_PULSE_LEN_MAX, NIKON_0_PAUSE_LEN_MIN, NIKON_0_PAUSE_LEN_MAX,\r
- NIKON_PULSE_LEN_MIN, NIKON_PULSE_LEN_MAX, NIKON_1_PAUSE_LEN_MIN, NIKON_1_PAUSE_LEN_MAX);\r
-\r
- printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- LEGO_START_BIT_PULSE_LEN_MIN, LEGO_START_BIT_PULSE_LEN_MAX, LEGO_START_BIT_PAUSE_LEN_MIN, LEGO_START_BIT_PAUSE_LEN_MAX,\r
- LEGO_PULSE_LEN_MIN, LEGO_PULSE_LEN_MAX, LEGO_0_PAUSE_LEN_MIN, LEGO_0_PAUSE_LEN_MAX,\r
- LEGO_PULSE_LEN_MIN, LEGO_PULSE_LEN_MAX, LEGO_1_PAUSE_LEN_MIN, LEGO_1_PAUSE_LEN_MAX);\r
-\r
- printf ("\n");\r
- printf ("PROTOCOL S S-PULSE S-PAUSE PULSE PAUSE-00 PAUSE-01 PAUSE-10 PAUSE-11\n");\r
- printf ("================================================================================================\n");\r
- printf ("RCMM 1 %3d %3d %3d %3d %3d %3d %3d\n",\r
- (uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME), (uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME),\r
- (uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME),\r
- (uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME), (uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME),\r
- (uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME), (uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME));\r
- printf ("RCMM 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
- RCMM32_START_BIT_PULSE_LEN_MIN, RCMM32_START_BIT_PULSE_LEN_MAX, RCMM32_START_BIT_PAUSE_LEN_MIN, RCMM32_START_BIT_PAUSE_LEN_MAX,\r
- RCMM32_BIT_PULSE_LEN_MIN, RCMM32_BIT_PULSE_LEN_MAX, RCMM32_BIT_00_PAUSE_LEN_MIN, RCMM32_BIT_00_PAUSE_LEN_MAX,\r
- RCMM32_BIT_01_PAUSE_LEN_MIN, RCMM32_BIT_01_PAUSE_LEN_MAX, RCMM32_BIT_10_PAUSE_LEN_MIN, RCMM32_BIT_10_PAUSE_LEN_MAX,\r
- RCMM32_BIT_11_PAUSE_LEN_MIN, RCMM32_BIT_11_PAUSE_LEN_MAX);\r
-}\r
-\r
void\r
print_spectrum (char * text, int * buf, int is_pulse)\r
{\r
double average = 0;\r
double tolerance;\r
\r
- puts ("-------------------------------------------------------------------------------");\r
+ puts ("-----------------------------------------------------------------------------");\r
printf ("%s:\n", text);\r
\r
for (i = 0; i < 256; i++)\r
{\r
static uint8_t key_table[128] =\r
{\r
- // 0 1 2 3 4 5 6 7 8 9 A B C D E F\r
- 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',\r
- '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',\r
- 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',\r
- 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,\r
-\r
- 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',\r
- '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',\r
- 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',\r
- 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0\r
+ // 0 1 2 3 4 5 6 7 8 9 A B C D E F\r
+ 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0xDF, '´', 0, '\b',\r
+ '\t', 'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 0xFC, '+', 0, 0, 'a',\r
+ 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0xF6, 0xE4, '#', '\r', 0, '<', 'y', 'x',\r
+ 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,\r
+\r
+ 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',\r
+ '\t', 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 0xDC, '*', 0, 0, 'A',\r
+ 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 0xD6, 0xC4, '\'', '\r', 0, '>', 'Y', 'X',\r
+ 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0\r
};\r
static uint_fast8_t state;\r
\r
{\r
switch (cmd)\r
{\r
- case 0x0003: key = '²'; break;\r
+ case 0x0003: key = 0xB2; break; // upper 2\r
case 0x0008: key = '{'; break;\r
case 0x0009: key = '['; break;\r
case 0x000A: key = ']'; break;\r
printf ("%8.3fms ", (double) (time_counter * 1000) / F_INTERRUPTS);\r
}\r
\r
- if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)\r
+ if (irmp_data.protocol == IRMP_ACP24_PROTOCOL)\r
+ {\r
+ uint16_t temp = (irmp_data.command & 0x000F) + 15;\r
+\r
+ printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",\r
+ irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, temp);\r
+ }\r
+ else if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)\r
{\r
if ((key >= 0x20 && key < 0x7F) || key >= 0xA0)\r
{\r
{\r
silent = TRUE;\r
}\r
- else if (! strcmp (argv[1], "-p"))\r
- {\r
- print_timings ();\r
- return (0);\r
- }\r
else if (! strcmp (argv[1], "-r"))\r
{\r
radio = TRUE;\r
char * p;\r
int idx = -1;\r
\r
- puts ("-------------------------------------------------------------------");\r
+ puts ("----------------------------------------------------------------------");\r
putchar (ch);\r
\r
\r
print_spectrum ("START PAUSES", start_pauses, FALSE);\r
print_spectrum ("PULSES", pulses, TRUE);\r
print_spectrum ("PAUSES", pauses, FALSE);\r
- puts ("-------------------------------------------------------------------------------");\r
+ puts ("-----------------------------------------------------------------------------");\r
}\r
return 0;\r
}\r