*\r
* Copyright (c) 2009-2015 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.182 2015/11/18 08:27:50 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 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
\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_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
// 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 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
- 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_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
{\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
#else // AVR\r
IRMP_PORT &= ~(1<<IRMP_BIT); // deactivate pullup\r
IRMP_DDR &= ~(1<<IRMP_BIT); // set pin to input\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 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
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
+#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_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
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
{\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
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