Add dirty port of irmp library.

This commit is contained in:
Grzegorz Hetman 2017-06-14 01:00:22 +02:00
parent abe3b8fd68
commit bcb7890df2
10 changed files with 7603 additions and 0 deletions

3
examples/irmp/Makefile Normal file
View file

@ -0,0 +1,3 @@
PROGRAM=irmp
EXTRA_COMPONENTS = extras/irmp
include ../../common.mk

39
examples/irmp/irmp.c Normal file
View file

@ -0,0 +1,39 @@
#include "espressif/esp_common.h"
#include "FreeRTOS.h"
#include "task.h"
#include "esp/uart.h"
#include "irmp/irmp.h"
#include <ssid_config.h>
void print_ir(void *pvParameters) {
IRMP_DATA irmp_data;
for (;;){
if (irmp_get_data (&irmp_data)){
printf("protocol: 0x%x", irmp_data.protocol);
#if IRMP_PROTOCOL_NAMES == 1
printf(" %s", irmp_protocol_names[irmp_data.protocol]);
#endif
printf(" address: 0x%x", irmp_data.address);
printf(" command: 0x%x", irmp_data.command);
printf(" flags: 0x%x", irmp_data.flags);
printf("\r\n");
}
}
}
void user_init(void) {
uart_set_baud(0, 115200);
_xt_isr_attach(INUM_TIMER_FRC1, (_xt_isr)irmp_ISR);
timer_set_frequency(FRC1, F_INTERRUPTS); // 15KHz ~66.6uS
timer_set_interrupts(FRC1, true);
timer_set_run(FRC1, true);
irmp_init();
printf("F_INTERRUPTS==%d\n",F_INTERRUPTS);
xTaskCreate(&print_ir, "print_ir", 256, NULL, 2, NULL);
}

14
extras/irmp/component.mk Normal file
View file

@ -0,0 +1,14 @@
# Component makefile for extras/irmp
INC_DIRS += $(irmp_ROOT)..
# args for passing into compile rule generation
irmp_SRC_DIR = $(irmp_ROOT)
# users can override this setting and get console debug output
IRMP_DEBUG ?= 0
ifeq ($(IRMP_DEBUG),1)
irmp_CFLAGS = $(CFLAGS) -DIRMP_DEBUG
endif
$(eval $(call component_compile_rules,irmp))

5751
extras/irmp/irmp.c Normal file

File diff suppressed because it is too large Load diff

261
extras/irmp/irmp.h Normal file
View file

@ -0,0 +1,261 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmp.h
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
*
* $Id: irmp.h,v 1.103 2016/09/09 07:53:29 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef _IRMP_H_
#define _IRMP_H_
#include "irmpsystem.h"
#ifndef IRMP_USE_AS_LIB
# include "irmpconfig.h"
#endif
#if defined (__AVR_XMEGA__)
# define _CONCAT(a,b) a##b
# define CONCAT(a,b) _CONCAT(a,b)
# define IRMP_PORT_PRE CONCAT(PORT, IRMP_PORT_LETTER)
# define IRMP_DDR_PRE CONCAT(PORT, IRMP_PORT_LETTER)
# define IRMP_PIN_PRE CONCAT(PORT, IRMP_PORT_LETTER)
# define IRMP_PORT IRMP_PORT_PRE.OUT
# define IRMP_DDR IRMP_DDR_PRE.DIR
# define IRMP_PIN IRMP_PIN_PRE.IN
# define IRMP_BIT IRMP_BIT_NUMBER
# define input(x) ((x) & (1 << IRMP_BIT))
#elif defined (ATMEL_AVR)
# define _CONCAT(a,b) a##b
# define CONCAT(a,b) _CONCAT(a,b)
# define IRMP_PORT CONCAT(PORT, IRMP_PORT_LETTER)
# define IRMP_DDR CONCAT(DDR, IRMP_PORT_LETTER)
# define IRMP_PIN CONCAT(PIN, IRMP_PORT_LETTER)
# define IRMP_BIT IRMP_BIT_NUMBER
# define input(x) ((x) & (1 << IRMP_BIT))
#elif defined (PIC_C18) || defined (PIC_CCS)
# define input(x) (x)
#elif defined (ARM_STM32)
# define _CONCAT(a,b) a##b
# define CONCAT(a,b) _CONCAT(a,b)
# define IRMP_PORT CONCAT(GPIO, IRMP_PORT_LETTER)
# if defined (ARM_STM32L1XX)
# define IRMP_PORT_RCC CONCAT(RCC_AHBPeriph_GPIO, IRMP_PORT_LETTER)
# elif defined (ARM_STM32F10X)
# define IRMP_PORT_RCC CONCAT(RCC_APB2Periph_GPIO, IRMP_PORT_LETTER)
# elif defined (ARM_STM32F4XX)
# define IRMP_PORT_RCC CONCAT(RCC_AHB1Periph_GPIO, IRMP_PORT_LETTER)
# endif
# define IRMP_BIT CONCAT(GPIO_Pin_, IRMP_BIT_NUMBER)
# define IRMP_PIN IRMP_PORT // for use with input(x) below
# define input(x) (GPIO_ReadInputDataBit(x, IRMP_BIT))
# ifndef USE_STDPERIPH_DRIVER
# warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration.
# endif
#elif defined (STELLARIS_ARM_CORTEX_M4)
# define _CONCAT(a,b) a##b
# define CONCAT(a,b) _CONCAT(a,b)
# define IRMP_PORT_PERIPH CONCAT(SYSCTL_PERIPH_GPIO, IRMP_PORT_LETTER)
# define IRMP_PORT_BASE CONCAT(GPIO_PORT, CONCAT(IRMP_PORT_LETTER, _BASE))
# define IRMP_PORT_PIN CONCAT(GPIO_PIN_, IRMP_BIT_NUMBER)
# define IRMP_PIN IRMP_PORT_PIN
# define input(x) ((uint8_t)(ROM_GPIOPinRead(IRMP_PORT_BASE, IRMP_PORT_PIN)))
# define sei() IntMasterEnable()
#elif defined(__SDCC_stm8)
# define _CONCAT(a,b) a##b
# define CONCAT(a,b) _CONCAT(a,b)
# define IRMP_GPIO_STRUCT CONCAT(GPIO, IRMP_PORT_LETTER)
# define IRMP_BIT IRMP_BIT_NUMBER
# define input(x) ((x) & (1 << IRMP_BIT))
#elif defined (TEENSY_ARM_CORTEX_M4)
# define input(x) ((uint8_t)(digitalReadFast(x)))
#elif defined(__xtensa__)
# define IRMP_BIT IRMP_BIT_NUMBER
# define input(x) GPIO_INPUT_GET(IRMP_BIT_NUMBER)
#endif
#if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
# undef IRMP_SUPPORT_MATSUSHITA_PROTOCOL
# define IRMP_SUPPORT_MATSUSHITA_PROTOCOL 1
#endif
#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
# warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols
# warning RUWIDO protocol disabled
# undef IRMP_SUPPORT_RUWIDO_PROTOCOL
# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0
#endif
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 && IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
# warning KASEIKYO protocol conflicts wih PANASONIC, please enable only one of both protocols
# warning PANASONIC protocol disabled
# undef IRMP_SUPPORT_PANASONIC_PROTOCOL
# define IRMP_SUPPORT_PANASONIC_PROTOCOL 0
#endif
#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_ACP24_PROTOCOL == 1
# warning DENON protocol conflicts wih ACP24, please enable only one of both protocols
# warning ACP24 protocol disabled
# undef IRMP_SUPPORT_ACP24_PROTOCOL
# define IRMP_SUPPORT_ACP24_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
# warning RC6 protocol conflicts wih ROOMBA, please enable only one of both protocols
# warning ROOMBA protocol disabled
# undef IRMP_SUPPORT_ROOMBA_PROTOCOL
# define IRMP_SUPPORT_ROOMBA_PROTOCOL 0
#endif
#if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1 && IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
# warning PANASONIC protocol conflicts wih MITSU_HEAVY, please enable only one of both protocols
# warning MITSU_HEAVY protocol disabled
# undef IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
# define IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1
# warning RC5 protocol conflicts wih ORTEK, please enable only one of both protocols
# warning ORTEK protocol disabled
# undef IRMP_SUPPORT_ORTEK_PROTOCOL
# define IRMP_SUPPORT_ORTEK_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_S100_PROTOCOL == 1
# warning RC5 protocol conflicts wih S100, please enable only one of both protocols
# warning S100 protocol disabled
# undef IRMP_SUPPORT_S100_PROTOCOL
# define IRMP_SUPPORT_S100_PROTOCOL 0
#endif
#if IRMP_SUPPORT_NUBERT_PROTOCOL == 1 && IRMP_SUPPORT_FAN_PROTOCOL == 1
# warning NUBERT protocol conflicts wih FAN, please enable only one of both protocols
# warning FAN protocol disabled
# undef IRMP_SUPPORT_FAN_PROTOCOL
# define IRMP_SUPPORT_FAN_PROTOCOL 0
#endif
#if IRMP_SUPPORT_FDC_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1
# warning FDC protocol conflicts wih ORTEK, please enable only one of both protocols
# warning ORTEK protocol disabled
# undef IRMP_SUPPORT_ORTEK_PROTOCOL
# define IRMP_SUPPORT_ORTEK_PROTOCOL 0
#endif
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1 && IRMP_SUPPORT_NETBOX_PROTOCOL == 1
# warning ORTEK protocol conflicts wih NETBOX, please enable only one of both protocols
# warning NETBOX protocol disabled
# undef IRMP_SUPPORT_NETBOX_PROTOCOL
# define IRMP_SUPPORT_NETBOX_PROTOCOL 0
#endif
#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000
# warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000)
# undef IRMP_SUPPORT_SIEMENS_PROTOCOL
# define IRMP_SUPPORT_SIEMENS_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 && F_INTERRUPTS < 15000
# warning F_INTERRUPTS too low, RUWIDO protocol disabled (should be at least 15000)
# undef IRMP_SUPPORT_RUWIDO_PROTOCOL
# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000
# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000)
# undef IRMP_SUPPORT_RECS80_PROTOCOL
# define IRMP_SUPPORT_RECS80_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000
# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000)
# undef IRMP_SUPPORT_RECS80EXT_PROTOCOL
# define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0
#endif
#if IRMP_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000
# warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000)
# undef IRMP_SUPPORT_LEGO_PROTOCOL
# define IRMP_SUPPORT_LEGO_PROTOCOL 0
#endif
#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 0
# warning SAMSUNG48 protocol needs also SAMSUNG protocol, SAMSUNG protocol enabled
# undef IRMP_SUPPORT_SAMSUNG_PROTOCOL
# define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1
#endif
#if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0
# warning JVC protocol needs also NEC protocol, NEC protocol enabled
# undef IRMP_SUPPORT_NEC_PROTOCOL
# define IRMP_SUPPORT_NEC_PROTOCOL 1
#endif
#if IRMP_SUPPORT_NEC16_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0
# warning NEC16 protocol needs also NEC protocol, NEC protocol enabled
# undef IRMP_SUPPORT_NEC_PROTOCOL
# define IRMP_SUPPORT_NEC_PROTOCOL 1
#endif
#if IRMP_SUPPORT_NEC42_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0
# warning NEC42 protocol needs also NEC protocol, NEC protocol enabled
# undef IRMP_SUPPORT_NEC_PROTOCOL
# define IRMP_SUPPORT_NEC_PROTOCOL 1
#endif
#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0
# warning LGAIR protocol needs also NEC protocol, NEC protocol enabled
# undef IRMP_SUPPORT_NEC_PROTOCOL
# define IRMP_SUPPORT_NEC_PROTOCOL 1
#endif
#if IRMP_SUPPORT_RCMM_PROTOCOL == 1 && F_INTERRUPTS < 20000
# warning F_INTERRUPTS too low, RCMM protocol disabled (should be at least 20000)
# undef IRMP_SUPPORT_RCMM_PROTOCOL
# define IRMP_SUPPORT_RCMM_PROTOCOL 0
#endif
#if F_INTERRUPTS > 20000
#error F_INTERRUPTS too high (should be not greater than 20000)
#endif
#include "irmpprotocols.h"
#define IRMP_FLAG_REPETITION 0x01
#ifdef __cplusplus
extern "C"
{
#endif
extern void irmp_init (void);
extern uint_fast8_t irmp_get_data (IRMP_DATA *);
extern uint_fast8_t irmp_ISR (void);
#if IRMP_PROTOCOL_NAMES == 1
extern const char * const irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM;
#endif
#if IRMP_USE_CALLBACK == 1
extern void irmp_set_callback_ptr (void (*cb)(uint_fast8_t));
#endif // IRMP_USE_CALLBACK == 1
#ifdef __cplusplus
}
#endif
#endif /* _IRMP_H_ */

218
extras/irmp/irmpconfig.h Normal file
View file

@ -0,0 +1,218 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmpconfig.h
*
* DO NOT INCLUDE THIS FILE, WILL BE INCLUDED BY IRMP.H!
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
* Extensions for PIC 12F1820 W.Strobl 2014-07-20
*
* $Id: irmpconfig.h,v 1.152 2017/02/17 09:13:06 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef _IRMPCONFIG_H_
#define _IRMPCONFIG_H_
#ifndef _IRMP_H_
# error please include only irmp.h, not irmpconfig.h
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change F_INTERRUPTS if you change the number of interrupts per second,
* Normally, F_INTERRUPTS should be in the range from 10000 to 15000, typical is 15000
* A value above 15000 costs additional program space, absolute maximum value is 20000.
* On PIC with XC8/C18 Compiler, use 15151 as the correct value.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef F_INTERRUPTS
# define F_INTERRUPTS 15000 // interrupts per second, min: 10000, max: 20000, typ: 15000
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change settings from 1 to 0 if you want to disable one or more decoders.
* This saves program space.
*
* 1 enable decoder
* 0 disable decoder
*
* The standard decoders are enabled per default.
* Less common protocols are disabled here, you need to enable them manually.
*
* If you want to use FDC or RCCAR simultaneous with RC5 protocol, additional program space is required.
* If you don't need RC5 when using FDC/RCCAR, you should disable RC5.
* You cannot enable both DENON and RUWIDO, only enable one of them.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
// typical protocols, disable here! Enable Remarks F_INTERRUPTS Program Space
#define IRMP_SUPPORT_SIRCS_PROTOCOL 1 // Sony SIRCS >= 10000 ~150 bytes
#define IRMP_SUPPORT_NEC_PROTOCOL 1 // NEC + APPLE >= 10000 ~300 bytes
#define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1 // Samsung + Samsg32 >= 10000 ~300 bytes
#define IRMP_SUPPORT_KASEIKYO_PROTOCOL 1 // Kaseikyo >= 10000 ~250 bytes
// more protocols, enable here! Enable Remarks F_INTERRUPTS Program Space
#define IRMP_SUPPORT_JVC_PROTOCOL 0 // JVC >= 10000 ~150 bytes
#define IRMP_SUPPORT_NEC16_PROTOCOL 0 // NEC16 >= 10000 ~100 bytes
#define IRMP_SUPPORT_NEC42_PROTOCOL 0 // NEC42 >= 10000 ~300 bytes
#define IRMP_SUPPORT_MATSUSHITA_PROTOCOL 0 // Matsushita >= 10000 ~50 bytes
#define IRMP_SUPPORT_DENON_PROTOCOL 0 // DENON, Sharp >= 10000 ~250 bytes
#define IRMP_SUPPORT_RC5_PROTOCOL 0 // RC5 >= 10000 ~250 bytes
#define IRMP_SUPPORT_RC6_PROTOCOL 0 // RC6 & RC6A >= 10000 ~250 bytes
#define IRMP_SUPPORT_IR60_PROTOCOL 0 // IR60 (SDA2008) >= 10000 ~300 bytes
#define IRMP_SUPPORT_GRUNDIG_PROTOCOL 0 // Grundig >= 10000 ~300 bytes
#define IRMP_SUPPORT_SIEMENS_PROTOCOL 0 // Siemens Gigaset >= 15000 ~550 bytes
#define IRMP_SUPPORT_NOKIA_PROTOCOL 0 // Nokia >= 10000 ~300 bytes
// exotic protocols, enable here! Enable Remarks F_INTERRUPTS Program Space
#define IRMP_SUPPORT_BOSE_PROTOCOL 0 // BOSE >= 10000 ~150 bytes
#define IRMP_SUPPORT_KATHREIN_PROTOCOL 0 // Kathrein >= 10000 ~200 bytes
#define IRMP_SUPPORT_NUBERT_PROTOCOL 0 // NUBERT >= 10000 ~50 bytes
#define IRMP_SUPPORT_FAN_PROTOCOL 0 // FAN (ventilator) >= 10000 ~50 bytes
#define IRMP_SUPPORT_SPEAKER_PROTOCOL 0 // SPEAKER (~NUBERT) >= 10000 ~50 bytes
#define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL 0 // Bang & Olufsen >= 10000 ~200 bytes
#define IRMP_SUPPORT_RECS80_PROTOCOL 0 // RECS80 (SAA3004) >= 15000 ~50 bytes
#define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0 // RECS80EXT (SAA3008) >= 15000 ~50 bytes
#define IRMP_SUPPORT_THOMSON_PROTOCOL 0 // Thomson >= 10000 ~250 bytes
#define IRMP_SUPPORT_NIKON_PROTOCOL 0 // NIKON camera >= 10000 ~250 bytes
#define IRMP_SUPPORT_NETBOX_PROTOCOL 0 // Netbox keyboard >= 10000 ~400 bytes (PROTOTYPE!)
#define IRMP_SUPPORT_ORTEK_PROTOCOL 0 // ORTEK (Hama) >= 10000 ~150 bytes
#define IRMP_SUPPORT_TELEFUNKEN_PROTOCOL 0 // Telefunken 1560 >= 10000 ~150 bytes
#define IRMP_SUPPORT_FDC_PROTOCOL 0 // FDC3402 keyboard >= 10000 (better 15000) ~150 bytes (~400 in combination with RC5)
#define IRMP_SUPPORT_RCCAR_PROTOCOL 0 // RC Car >= 10000 (better 15000) ~150 bytes (~500 in combination with RC5)
#define IRMP_SUPPORT_ROOMBA_PROTOCOL 0 // iRobot Roomba >= 10000 ~150 bytes
#define IRMP_SUPPORT_RUWIDO_PROTOCOL 0 // RUWIDO, T-Home >= 15000 ~550 bytes
#define IRMP_SUPPORT_A1TVBOX_PROTOCOL 0 // A1 TV BOX >= 15000 (better 20000) ~300 bytes
#define IRMP_SUPPORT_LEGO_PROTOCOL 0 // LEGO Power RC >= 20000 ~150 bytes
#define IRMP_SUPPORT_RCMM_PROTOCOL 0 // RCMM 12,24, or 32 >= 20000 ~150 bytes
#define IRMP_SUPPORT_LGAIR_PROTOCOL 0 // LG Air Condition >= 10000 ~300 bytes
#define IRMP_SUPPORT_SAMSUNG48_PROTOCOL 0 // Samsung48 >= 10000 ~100 bytes (SAMSUNG must be enabled!)
#define IRMP_SUPPORT_MERLIN_PROTOCOL 0 // Merlin >= 15000 (better 20000) ~300 bytes
#define IRMP_SUPPORT_PENTAX_PROTOCOL 0 // Pentax >= 10000 ~150 bytes
#define IRMP_SUPPORT_S100_PROTOCOL 0 // S100 >= 10000 ~250 bytes
#define IRMP_SUPPORT_ACP24_PROTOCOL 0 // ACP24 >= 10000 ~250 bytes
#define IRMP_SUPPORT_TECHNICS_PROTOCOL 0 // TECHNICS >= 10000 ~250 bytes
#define IRMP_SUPPORT_PANASONIC_PROTOCOL 0 // PANASONIC Beamer >= 10000 ~250 bytes
#define IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL 0 // Mitsubishi Aircond >= 10000 ~250 bytes
#define IRMP_SUPPORT_VINCENT_PROTOCOL 0 // VINCENT >= 10000 ~250 bytes
#define IRMP_SUPPORT_SAMSUNGAH_PROTOCOL 1 // SAMSUNG AH >= 10000 ~250 bytes
#define IRMP_SUPPORT_RADIO1_PROTOCOL 0 // RADIO, e.g. TEVION >= 10000 ~250 bytes (experimental)
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for ATMEL ATMega/ATTiny/XMega
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#if defined (ATMEL_AVR) || defined (__AVR_XMEGA__) // use PB6 as IR input on AVR
# define IRMP_PORT_LETTER B
# define IRMP_BIT_NUMBER 6
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for PIC C18 or XC8 compiler
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (PIC_C18) // use RB4 as IR input on PIC (C18 or XC8 compiler)
# if defined(__12F1840)
# define IRMP_PIN RA5 // on 12F1840 with XC8 compiler
# else
# define IRMP_PIN PORTBbits.RB4 // PIC C18
# endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for PIC CCS compiler
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (PIC_CCS)
# define IRMP_PIN PIN_B4 // use PB4 as IR input on PIC (CCS compiler)
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for ARM STM32
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (ARM_STM32) // use C13 as IR input on STM32
# define IRMP_PORT_LETTER C
# define IRMP_BIT_NUMBER 13
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for Stellaris ARM Cortex M4
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (STELLARIS_ARM_CORTEX_M4) // use B4 as IR input on Stellaris LM4F
# define IRMP_PORT_LETTER B
# define IRMP_BIT_NUMBER 4
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for STM8
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (SDCC_STM8) // use PA1 as IR input on STM8
# define IRMP_PORT_LETTER A
# define IRMP_BIT_NUMBER 1
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for ESP8266
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (__xtensa__)
# define IRMP_BIT_NUMBER 12 // use GPIO12 (Pin 7 UEXT) on ESP8266-EVB evaluation board
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for Teensy 3.x with teensyduino gcc compiler
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined (TEENSY_ARM_CORTEX_M4)
# define IRMP_PIN 1 // use Digital pin 1 as IR input on Teensy
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Change hardware pin here for MBED
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif defined(__MBED__)
# define IRMP_PIN P0_22 // use P1_27 on LPC1347
# define IRMP_PINMODE PullUp // hardware dependent
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Handling of unknown target system: DON'T CHANGE
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#elif !defined (UNIX_OR_WINDOWS)
# error target system not defined.
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Set IRMP_LOGGING to 1 if want to log data to UART with 9600Bd
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef IRMP_LOGGING
# define IRMP_LOGGING 0 // 1: log IR signal (scan), 0: do not. default is 0
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Use external logging routines
* If you enable external logging, you have also to enable IRMP_LOGGING above
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef IRMP_EXT_LOGGING
# define IRMP_EXT_LOGGING 0 // 1: use external logging, 0: do not. default is 0
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Set IRMP_PROTOCOL_NAMES to 1 if want to access protocol names (for logging etc), costs ~300 bytes RAM!
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef IRMP_PROTOCOL_NAMES
# define IRMP_PROTOCOL_NAMES 0 // 1: access protocol names, 0: do not. default is 0
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Use Callbacks to indicate input signal
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef IRMP_USE_CALLBACK
# define IRMP_USE_CALLBACK 0 // 1: use callbacks. 0: do not. default is 0
#endif
#endif // _IRMPCONFIG_H_

109
extras/irmp/irmpextlog.c Normal file
View file

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmpextlog.c - external logging
*
* $Id: irmpextlog.c,v 1.6 2017/02/17 09:13:06 fm Exp $
*
* If you cannot use the internal UART logging routine, adapt the
* source below for your application. The following implementation
* is an example for a PIC 18F2550 with USB interface.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#include "irmp.h"
#if IRMP_EXT_LOGGING == 1
#include "irmpextlog.h"
#include "system/usb/usb.h"
#define bit_set(var,bitnr) ((var) |= 1 << (bitnr)) // set single bit in byte
#define loglen 50 // byte length for saving the data from irmp.c
// check your USB settings for max length of USB interface used for this FW!
static unsigned char logdata[loglen]; // array for saveing the data from irmp.c
static unsigned char logindex = 3; // start index of logdata
static char bitindex = 7; // bit position in current byte
static unsigned int bitcount;
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Initialize external logging
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
void
initextlog (void) // reset all data to default, only during init
{
unsigned char i;
for (i = 0; i < loglen; i++)
{
logdata[i] = 0;
}
bitcount = 0;
logindex = 3;
bitindex = 7;
}
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Send logging data via device (e.g. USB on PIC)
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
void
sendextlog (unsigned char data)
{
if (logindex == loglen || data == '\n') // buffer full or \n --> send to application
{
if (mUSBUSARTIsTxTrfReady()) // check USB, if ready send
{
logdata[0] = 0x01; // indicator for logging, depends on your application
logdata[1] = logindex; // save how much bytes are send from irmp.c
logdata[2] = 0; // set \n Index to 0; 0=buffer full; 0xA=\n received
if (data == '\n')
{
logdata[2] = data; // \n --> save \n=0xA in to check in app that \n was received
}
mUSBUSARTTxRam((unsigned char *) &logdata, loglen); // send all Data to main Seoftware
logindex = 3; // reset index
bitindex = 7; // reset bit position
logdata[logindex] = 0; // reset value of new logindex to 0
}
}
else
{
bitcount++;
if (data == '1')
{
bit_set(logdata[logindex], bitindex); // all logdata[logindex] on start = 0 --> only 1 must be set
}
bitindex--; // decrease bitposition, wirte from left to right
if (bitindex == -1) // byte complete Bit 7->0 --> next one
{
bitindex = 7;
logindex++;
if (logindex < loglen)
{
logdata[logindex] = 0; // set next byte to 0
}
}
}
}
#endif //IRMP_EXT_LOGGING
#if defined(PIC_C18)
static void
dummy (void)
{
// Only to avoid C18 compiler error
}
#endif

16
extras/irmp/irmpextlog.h Normal file
View file

@ -0,0 +1,16 @@
#ifndef _IRMPEXTLOG_H
#define _IRMPEXTLOG_H
#ifdef __cplusplus
extern "C"
{
#endif
void initextlog (void);
void sendextlog (unsigned char);
#ifdef __cplusplus
}
#endif
#endif

991
extras/irmp/irmpprotocols.h Normal file
View file

@ -0,0 +1,991 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmpprotocols.h - irmp protocols
*
* DO NOT INCLUDE THIS FILE, WILL BE INCLUDED BY IRMP.H or IRSND.H!
*
* Copyright (c) 2013-2016 Frank Meyer - frank(at)fli4l.de
*
* $Id: irmpprotocols.h,v 1.48 2017/02/17 09:13:06 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef _IRMP_PROTOCOLS_H_
#define _IRMP_PROTOCOLS_H_
#if !defined(_IRMP_H_) && !defined(_IRSND_H_)
# error please include only irmp.h or irsnd.h, not irmpprotocols.h
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* IR protocols:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define IRMP_SIRCS_PROTOCOL 1 // Sony
#define IRMP_NEC_PROTOCOL 2 // NEC, Pioneer, JVC, Toshiba, NoName etc.
#define IRMP_SAMSUNG_PROTOCOL 3 // Samsung
#define IRMP_MATSUSHITA_PROTOCOL 4 // Matsushita
#define IRMP_KASEIKYO_PROTOCOL 5 // Kaseikyo (Panasonic etc)
#define IRMP_RECS80_PROTOCOL 6 // Philips, Thomson, Nordmende, Telefunken, Saba
#define IRMP_RC5_PROTOCOL 7 // Philips etc
#define IRMP_DENON_PROTOCOL 8 // Denon, Sharp
#define IRMP_RC6_PROTOCOL 9 // Philips etc
#define IRMP_SAMSUNG32_PROTOCOL 10 // Samsung32: no sync pulse at bit 16, length 32 instead of 37
#define IRMP_APPLE_PROTOCOL 11 // Apple, very similar to NEC
#define IRMP_RECS80EXT_PROTOCOL 12 // Philips, Technisat, Thomson, Nordmende, Telefunken, Saba
#define IRMP_NUBERT_PROTOCOL 13 // Nubert
#define IRMP_BANG_OLUFSEN_PROTOCOL 14 // Bang & Olufsen
#define IRMP_GRUNDIG_PROTOCOL 15 // Grundig
#define IRMP_NOKIA_PROTOCOL 16 // Nokia
#define IRMP_SIEMENS_PROTOCOL 17 // Siemens, e.g. Gigaset
#define IRMP_FDC_PROTOCOL 18 // FDC keyboard
#define IRMP_RCCAR_PROTOCOL 19 // RC Car
#define IRMP_JVC_PROTOCOL 20 // JVC (NEC with 16 bits)
#define IRMP_RC6A_PROTOCOL 21 // RC6A, e.g. Kathrein, XBOX
#define IRMP_NIKON_PROTOCOL 22 // Nikon
#define IRMP_RUWIDO_PROTOCOL 23 // Ruwido, e.g. T-Home Mediareceiver
#define IRMP_IR60_PROTOCOL 24 // IR60 (SDA2008)
#define IRMP_KATHREIN_PROTOCOL 25 // Kathrein
#define IRMP_NETBOX_PROTOCOL 26 // Netbox keyboard (bitserial)
#define IRMP_NEC16_PROTOCOL 27 // NEC with 16 bits (incl. sync)
#define IRMP_NEC42_PROTOCOL 28 // NEC with 42 bits
#define IRMP_LEGO_PROTOCOL 29 // LEGO Power Functions RC
#define IRMP_THOMSON_PROTOCOL 30 // Thomson
#define IRMP_BOSE_PROTOCOL 31 // BOSE
#define IRMP_A1TVBOX_PROTOCOL 32 // A1 TV Box
#define IRMP_ORTEK_PROTOCOL 33 // ORTEK - Hama
#define IRMP_TELEFUNKEN_PROTOCOL 34 // Telefunken (1560)
#define IRMP_ROOMBA_PROTOCOL 35 // iRobot Roomba vacuum cleaner
#define IRMP_RCMM32_PROTOCOL 36 // Fujitsu-Siemens (Activy remote control)
#define IRMP_RCMM24_PROTOCOL 37 // Fujitsu-Siemens (Activy keyboard)
#define IRMP_RCMM12_PROTOCOL 38 // Fujitsu-Siemens (Activy keyboard)
#define IRMP_SPEAKER_PROTOCOL 39 // Another loudspeaker protocol, similar to Nubert
#define IRMP_LGAIR_PROTOCOL 40 // LG air conditioner
#define IRMP_SAMSUNG48_PROTOCOL 41 // air conditioner with SAMSUNG protocol (48 bits)
#define IRMP_MERLIN_PROTOCOL 42 // Merlin (Pollin 620 185)
#define IRMP_PENTAX_PROTOCOL 43 // Pentax camera
#define IRMP_FAN_PROTOCOL 44 // FAN (ventilator), very similar to NUBERT, but last bit is data bit instead of stop bit
#define IRMP_S100_PROTOCOL 45 // very similar to RC5, but 14 instead of 13 data bits
#define IRMP_ACP24_PROTOCOL 46 // Stiebel Eltron ACP24 air conditioner
#define IRMP_TECHNICS_PROTOCOL 47 // Technics, similar to Matsushita, but 22 instead of 24 bits
#define IRMP_PANASONIC_PROTOCOL 48 // Panasonic (Beamer), start bits similar to KASEIKYO
#define IRMP_MITSU_HEAVY_PROTOCOL 49 // Mitsubishi-Heavy Aircondition, similar timing as Panasonic beamer
#define IRMP_VINCENT_PROTOCOL 50 // Vincent
#define IRMP_SAMSUNGAH_PROTOCOL 51 // Vincent
#define IRMP_RADIO1_PROTOCOL 52 // Radio protocol (experimental status), do not use it yet!
#define IRMP_N_PROTOCOLS 53 // number of supported protocols
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* timing constants:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
// fm 22.09.2011: may not be more than 16000L, otherwise some JVC codes will not be accepted
#define IRMP_TIMEOUT_TIME 15500.0e-6 // timeout after 15.5 ms darkness
#define IRMP_TIMEOUT_TIME_MS 15500L // timeout after 15.5 ms darkness
#if IRMP_SUPPORT_NIKON_PROTOCOL == 1
# define IRMP_TIMEOUT_NIKON_TIME 29500.0e-6 // 2nd timeout after 29.5 ms darkness (only for NIKON!)
# define IRMP_TIMEOUT_NIKON_TIME_MS 29500L // 2nd timeout after 29.5 ms darkness
typedef uint16_t PAUSE_LEN;
# define IRMP_TIMEOUT_NIKON_LEN (PAUSE_LEN)(F_INTERRUPTS * IRMP_TIMEOUT_NIKON_TIME + 0.5)
#else
# if (F_INTERRUPTS * IRMP_TIMEOUT_TIME_MS) / 1000000 >= 254
typedef uint16_t PAUSE_LEN;
# else
typedef uint8_t PAUSE_LEN;
# endif
#endif
#define IRMP_TIMEOUT_LEN (PAUSE_LEN)(F_INTERRUPTS * IRMP_TIMEOUT_TIME + 0.5)
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* flags of struct IRMP_PARAMETER:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define IRMP_PARAM_FLAG_IS_MANCHESTER 0x01
#define IRMP_PARAM_FLAG_1ST_PULSE_IS_1 0x02
#define IRMP_PARAM_FLAG_IS_SERIAL 0x04
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* SIRCS:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define SIRCS_START_BIT_PULSE_TIME 2400.0e-6 // 2400 usec pulse
#define SIRCS_START_BIT_PAUSE_TIME 600.0e-6 // 600 usec pause
#define SIRCS_1_PULSE_TIME 1200.0e-6 // 1200 usec pulse
#define SIRCS_0_PULSE_TIME 600.0e-6 // 600 usec pulse
#define SIRCS_PAUSE_TIME 600.0e-6 // 600 usec pause
#define SIRCS_FRAMES 3 // SIRCS sends each frame 3 times
#define SIRCS_AUTO_REPETITION_PAUSE_TIME 25.0e-3 // auto repetition after 25ms
#define SIRCS_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms
#define SIRCS_ADDRESS_OFFSET 15 // skip 15 bits
#define SIRCS_ADDRESS_LEN 5 // read up to 5 address bits
#define SIRCS_COMMAND_OFFSET 0 // skip 0 bits
#define SIRCS_COMMAND_LEN 15 // read 12-15 command bits
#define SIRCS_MINIMUM_DATA_LEN 12 // minimum data length
#define SIRCS_COMPLETE_DATA_LEN 20 // complete length - may be up to 20
#define SIRCS_STOP_BIT 0 // has no stop bit
#define SIRCS_LSB 1 // LSB...MSB
#define SIRCS_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* NEC & NEC42 & NEC16 & LGAIR:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define NEC_START_BIT_PULSE_TIME 9000.0e-6 // 9000 usec pulse
#define NEC_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause
#define NEC_REPEAT_START_BIT_PAUSE_TIME 2250.0e-6 // 2250 usec pause
#define NEC_PULSE_TIME 560.0e-6 // 560 usec pulse
#define NEC_1_PAUSE_TIME 1690.0e-6 // 1690 usec pause
#define NEC_0_PAUSE_TIME 560.0e-6 // 560 usec pause
#define NEC_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms
#define NEC_ADDRESS_OFFSET 0 // skip 0 bits
#define NEC_ADDRESS_LEN 16 // read 16 address bits
#define NEC_COMMAND_OFFSET 16 // skip 16 bits (8 address + 8 /address)
#define NEC_COMMAND_LEN 16 // read 16 bits (8 command + 8 /command)
#define NEC_COMPLETE_DATA_LEN 32 // complete length
#define NEC_STOP_BIT 1 // has stop bit
#define NEC_LSB 1 // LSB...MSB
#define NEC_FLAGS 0 // flags
#define NEC42_ADDRESS_OFFSET 0 // skip 0 bits
#define NEC42_ADDRESS_LEN 13 // read 13 address bits
#define NEC42_COMMAND_OFFSET 26 // skip 26 bits (2 x 13 address bits)
#define NEC42_COMMAND_LEN 8 // read 8 command bits
#define NEC42_COMPLETE_DATA_LEN 42 // complete length (2 x 13 + 2 x 8)
#define LGAIR_ADDRESS_OFFSET 0 // skip 0 bits
#define LGAIR_ADDRESS_LEN 8 // read 8 address bits
#define LGAIR_COMMAND_OFFSET 8 // skip 8 bits (8 address)
#define LGAIR_COMMAND_LEN 16 // read 16 bits (16 command)
#define LGAIR_COMPLETE_DATA_LEN 28 // complete length (8 address + 16 command + 4 checksum)
#define NEC16_ADDRESS_OFFSET 0 // skip 0 bits
#define NEC16_ADDRESS_LEN 8 // read 8 address bits
#define NEC16_COMMAND_OFFSET 8 // skip 8 bits (8 address)
#define NEC16_COMMAND_LEN 8 // read 8 bits (8 command)
#define NEC16_COMPLETE_DATA_LEN 16 // complete length
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* SAMSUNG & SAMSUNG32 & SAMSUNG48:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define SAMSUNG_START_BIT_PULSE_TIME 4500.0e-6 // 4500 usec pulse
#define SAMSUNG_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause
#define SAMSUNG_PULSE_TIME 550.0e-6 // 550 usec pulse
#define SAMSUNG_1_PAUSE_TIME 1500.0e-6 // 1550 usec pause
#define SAMSUNG_0_PAUSE_TIME 500.0e-6 // 500 usec pause
#define SAMSUNG_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms
#define SAMSUNG_ADDRESS_OFFSET 0 // skip 0 bits
#define SAMSUNG_ADDRESS_LEN 16 // read 16 address bits
#define SAMSUNG_ID_OFFSET 17 // skip 16 + 1 sync bit
#define SAMSUNG_ID_LEN 4 // read 4 id bits
#define SAMSUNG_COMMAND_OFFSET 21 // skip 16 + 1 sync + 4 data bits
#define SAMSUNG_COMMAND_LEN 16 // read 16 command bits
#define SAMSUNG_COMPLETE_DATA_LEN 37 // complete length
#define SAMSUNG_STOP_BIT 1 // has stop bit
#define SAMSUNG_LSB 1 // LSB...MSB?
#define SAMSUNG_FLAGS 0 // flags
#define SAMSUNG32_COMMAND_OFFSET 16 // skip 16 bits
#define SAMSUNG32_COMMAND_LEN 16 // read 16 command bits
#define SAMSUNG32_COMPLETE_DATA_LEN 32 // complete length
#define SAMSUNG32_FRAMES 1 // SAMSUNG32 sends one frame
#define SAMSUNG32_AUTO_REPETITION_PAUSE_TIME 47.0e-3 // repetition after 47 ms
#define SAMSUNG32_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 47ms
#define SAMSUNG48_COMMAND_OFFSET 16 // skip 16 bits
#define SAMSUNG48_COMMAND_LEN 32 // read 32 command bits
#define SAMSUNG48_COMPLETE_DATA_LEN 48 // complete length
#define SAMSUNG48_FRAMES 2 // SAMSUNG48 sends each frame 2 times
#define SAMSUNG48_AUTO_REPETITION_PAUSE_TIME 5.0e-3 // repetition after 5 ms
#define SAMSUNG48_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 47ms
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* SAMSUNGAH:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define SAMSUNGAH_START_BIT_PULSE_TIME 2500.0e-6 // 2500 usec pulse
#define SAMSUNGAH_START_BIT_PAUSE_TIME 1900.0e-6 // 1900 usec pause
#define SAMSUNGAH_PULSE_TIME 450.0e-6 // 450 usec pulse
#define SAMSUNGAH_1_PAUSE_TIME 1100.0e-6 // 1100 usec pause
#define SAMSUNGAH_0_PAUSE_TIME 450.0e-6 // 450 usec pause
#define SAMSUNGAH_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms
#define SAMSUNGAH_ADDRESS_OFFSET 0 // skip 0 bits
#define SAMSUNGAH_ADDRESS_LEN 16 // read 16 address bits, ignore 17..31
#define SAMSUNGAH_COMMAND_OFFSET 32 // skip 32 bits
#define SAMSUNGAH_COMMAND_LEN 16 // read 32 bits
#define SAMSUNGAH_COMPLETE_DATA_LEN 48 // complete length
#define SAMSUNGAH_STOP_BIT 1 // has stop bit
#define SAMSUNGAH_LSB 1 // LSB...MSB?
#define SAMSUNGAH_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* MATSUSHITA:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define MATSUSHITA_START_BIT_PULSE_TIME 3488.0e-6 // 3488 usec pulse
#define MATSUSHITA_START_BIT_PAUSE_TIME 3488.0e-6 // 3488 usec pause
#define MATSUSHITA_PULSE_TIME 872.0e-6 // 872 usec pulse
#define MATSUSHITA_1_PAUSE_TIME 2616.0e-6 // 2616 usec pause
#define MATSUSHITA_0_PAUSE_TIME 872.0e-6 // 872 usec pause
#define MATSUSHITA_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms
#define MATSUSHITA_ADDRESS_OFFSET 12 // skip 12 bits
#define MATSUSHITA_ADDRESS_LEN 12 // read 12 address bits
#define MATSUSHITA_COMMAND_OFFSET 0 // skip 0 bits
#define MATSUSHITA_COMMAND_LEN 12 // read 12 bits (6 custom + 6 command)
#define MATSUSHITA_COMPLETE_DATA_LEN 24 // complete length
#define MATSUSHITA_STOP_BIT 1 // has stop bit
#define MATSUSHITA_LSB 1 // LSB...MSB?
#define MATSUSHITA_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* TECHNICS: same timings as MATSUSHITA
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define TECHNICS_ADDRESS_LEN 0 // read 0 address bits
#define TECHNICS_COMMAND_LEN 11 // read 11 bits
#define TECHNICS_COMPLETE_DATA_LEN 22 // complete length
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* KASEIKYO:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define KASEIKYO_START_BIT_PULSE_TIME 3380.0e-6 // 3380 usec pulse
#define KASEIKYO_START_BIT_PAUSE_TIME 1690.0e-6 // 1690 usec pause
#define KASEIKYO_PULSE_TIME 423.0e-6 // 525 usec pulse
#define KASEIKYO_1_PAUSE_TIME 1269.0e-6 // 525 usec pause
#define KASEIKYO_0_PAUSE_TIME 423.0e-6 // 1690 usec pause
#define KASEIKYO_AUTO_REPETITION_PAUSE_TIME 74.0e-3 // repetition after 74 ms
#define KASEIKYO_FRAME_REPEAT_PAUSE_TIME 74.0e-3 // frame repeat after 74 ms
#define KASEIKYO_ADDRESS_OFFSET 0 // skip 0 bits
#define KASEIKYO_ADDRESS_LEN 16 // read 16 address bits
#define KASEIKYO_COMMAND_OFFSET 28 // skip 28 bits (16 manufacturer & 4 parity & 8 genre)
#define KASEIKYO_COMMAND_LEN 12 // read 12 command bits (10 real command & 2 id)
#define KASEIKYO_COMPLETE_DATA_LEN 48 // complete length
#define KASEIKYO_STOP_BIT 1 // has stop bit
#define KASEIKYO_LSB 1 // LSB...MSB?
#define KASEIKYO_FRAMES 1 // KASEIKYO sends 1 frame
#define KASEIKYO_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* PANASONIC (Beamer), start bit timings similar to KASEIKYO
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define PANASONIC_START_BIT_PULSE_TIME 3600.0e-6 // 3600 usec pulse
#define PANASONIC_START_BIT_PAUSE_TIME 1600.0e-6 // 1690 usec pause
#define PANASONIC_PULSE_TIME 565.0e-6 // 565 usec pulse
#define PANASONIC_1_PAUSE_TIME 1140.0e-6 // 1140 usec pause
#define PANASONIC_0_PAUSE_TIME 316.0e-6 // 316 usec pause
#define PANASONIC_AUTO_REPETITION_PAUSE_TIME 40.0e-3 // repetition after 40 ms?
#define PANASONIC_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40 ms
#define PANASONIC_ADDRESS_OFFSET 24 // skip 24 bits: 010000000000010000000001
#define PANASONIC_ADDRESS_LEN 16 // read 16 address bits
#define PANASONIC_COMMAND_OFFSET 40 // skip 40 bits
#define PANASONIC_COMMAND_LEN 16 // read 16 command bits
#define PANASONIC_COMPLETE_DATA_LEN 56 // complete length
#define PANASONIC_STOP_BIT 1 // has stop bit
#define PANASONIC_LSB 1 // LSB...MSB?
#define PANASONIC_FRAMES 1 // PANASONIC sends 1 frame
#define PANASONIC_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* MITSUBISHI-Heavy Aircondition, timings similar to PANASONIC beamer
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define MITSU_HEAVY_START_BIT_PULSE_TIME 3200.0e-6 // 3600 usec pulse
#define MITSU_HEAVY_START_BIT_PAUSE_TIME 1560.0e-6 // 1690 usec pause
#define MITSU_HEAVY_PULSE_TIME 400.0e-6 // 565 usec pulse
#define MITSU_HEAVY_1_PAUSE_TIME 1200.0e-6 // 1140 usec pause
#define MITSU_HEAVY_0_PAUSE_TIME 430.0e-6 // 316 usec pause
#define MITSU_HEAVY_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40 ms
#define MITSU_HEAVY_ADDRESS_OFFSET 40 // skip 24 bits: 010000000000010000000001
#define MITSU_HEAVY_ADDRESS_LEN 16 // read 16 address bits
#define MITSU_HEAVY_COMMAND_OFFSET 56 // skip 40 bits
#define MITSU_HEAVY_COMMAND_LEN 16 // read 16 command bits
#define MITSU_HEAVY_COMPLETE_DATA_LEN 88 // complete length
#define MITSU_HEAVY_STOP_BIT 1 // has stop bit
#define MITSU_HEAVY_LSB 0 // LSB...MSB?
#define MITSU_HEAVY_FRAMES 1 // PANASONIC sends 1 frame
#define MITSU_HEAVY_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* VINCENT
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define VINCENT_START_BIT_PULSE_TIME 2500.0e-6 // 2500 usec pulse
#define VINCENT_START_BIT_PAUSE_TIME 4600.0e-6 // 4600 usec pause
#define VINCENT_PULSE_TIME 550.0e-6 // 550 usec pulse
#define VINCENT_1_PAUSE_TIME 1540.0e-6 // 1540 usec pause
#define VINCENT_0_PAUSE_TIME 550.0e-6 // 550 usec pause
#define VINCENT_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40 ms ?
#define VINCENT_ADDRESS_OFFSET 0 // skip 0 bits
#define VINCENT_ADDRESS_LEN 16 // read 16 address bits
#define VINCENT_COMMAND_OFFSET 16 // skip 16 bits
#define VINCENT_COMMAND_LEN 16 // read 16 command bits
#define VINCENT_COMPLETE_DATA_LEN 32 // complete length
#define VINCENT_STOP_BIT 1 // has stop bit
#define VINCENT_LSB 0 // LSB...MSB?
#define VINCENT_FRAMES 1 // VINCENT sends 1 frame
#define VINCENT_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RECS80:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RECS80_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse
#define RECS80_START_BIT_PAUSE_TIME 7432.0e-6 // 7432 usec pause
#define RECS80_PULSE_TIME 158.0e-6 // 158 usec pulse
#define RECS80_1_PAUSE_TIME 7432.0e-6 // 7432 usec pause
#define RECS80_0_PAUSE_TIME 4902.0e-6 // 4902 usec pause
#define RECS80_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define RECS80_ADDRESS_OFFSET 1 // skip 1 bit (toggle bit)
#define RECS80_ADDRESS_LEN 3 // read 3 address bits
#define RECS80_COMMAND_OFFSET 4 // skip 4 bits (1 toggle + 3 address)
#define RECS80_COMMAND_LEN 6 // read 6 command bits
#define RECS80_COMPLETE_DATA_LEN 10 // complete length
#define RECS80_STOP_BIT 1 // has stop bit
#define RECS80_LSB 0 // MSB...LSB
#define RECS80_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RC5:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RC5_BIT_TIME 889.0e-6 // 889 usec pulse/pause
#define RC5_FRAME_REPEAT_PAUSE_TIME 88.9e-3 // frame repeat after 88.9ms
#define RC5_ADDRESS_OFFSET 1 // skip 1 bit (2nd start)
#define RC5_ADDRESS_LEN 6 // read 1 toggle bit (for key repetition detection) + 5 address bits
#define RC5_COMMAND_OFFSET 7 // skip 5 bits (2nd start + 1 toggle + 5 address)
#define RC5_COMMAND_LEN 6 // read 6 command bits
#define RC5_COMPLETE_DATA_LEN 13 // complete length
#define RC5_STOP_BIT 0 // has no stop bit
#define RC5_LSB 0 // MSB...LSB
#define RC5_FLAGS IRMP_PARAM_FLAG_IS_MANCHESTER // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* S100: very similar to RC5, but 14 insted of 13 bits
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define S100_BIT_TIME 889.0e-6 // 889 usec pulse/pause
#define S100_FRAME_REPEAT_PAUSE_TIME 88.9e-3 // frame repeat after 88.9ms
#define S100_ADDRESS_OFFSET 1 // skip 1 bit (2nd start)
#define S100_ADDRESS_LEN 6 // read 1 toggle bit (for key repetition detection) + 5 address bits
#define S100_COMMAND_OFFSET 7 // skip 5 bits (2nd start + 1 toggle + 5 address)
#define S100_COMMAND_LEN 7 // read 7 command bits
#define S100_COMPLETE_DATA_LEN 14 // complete length
#define S100_STOP_BIT 0 // has no stop bit
#define S100_LSB 0 // MSB...LSB
#define S100_FLAGS IRMP_PARAM_FLAG_IS_MANCHESTER // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* DENON:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define DENON_PULSE_TIME 310.0e-6 // 310 usec pulse in practice, 275 in theory
#define DENON_1_PAUSE_TIME 1780.0e-6 // 1780 usec pause in practice, 1900 in theory
#define DENON_0_PAUSE_TIME 745.0e-6 // 745 usec pause in practice, 775 in theory
#define DENON_FRAMES 2 // DENON sends each frame 2 times
#define DENON_AUTO_REPETITION_PAUSE_TIME 45.0e-3 // inverted repetition after 45ms
#define DENON_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define DENON_ADDRESS_OFFSET 0 // skip 0 bits
#define DENON_ADDRESS_LEN 5 // read 5 address bits
#define DENON_COMMAND_OFFSET 5 // skip 5
#define DENON_COMMAND_LEN 10 // read 10 command bits
#define DENON_COMPLETE_DATA_LEN 15 // complete length
#define DENON_STOP_BIT 1 // has stop bit
#define DENON_LSB 0 // MSB...LSB
#define DENON_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RC6:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RC6_START_BIT_PULSE_TIME 2666.0e-6 // 2.666 msec pulse
#define RC6_START_BIT_PAUSE_TIME 889.0e-6 // 889 usec pause
#define RC6_TOGGLE_BIT_TIME 889.0e-6 // 889 msec pulse/pause
#define RC6_BIT_TIME 444.0e-6 // 444 usec pulse/pause
#define RC6_BIT_2_TIME 889.0e-6 // 889 usec pulse/pause
#define RC6_BIT_3_TIME 1333.0e-6 // 1333 usec pulse/pause
#define RC6_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define RC6_ADDRESS_OFFSET 5 // skip "1" + 3 mode bits + 1 toggle bit
#define RC6_ADDRESS_LEN 8 // read 8 address bits
#define RC6_COMMAND_OFFSET 13 // skip 12 bits ("1" + 3 mode + 1 toggle + 8 address)
#define RC6_COMMAND_LEN 8 // read 8 command bits
#define RC6_COMPLETE_DATA_LEN_SHORT 21 // complete length
#define RC6_COMPLETE_DATA_LEN_LONG 36 // complete length
#define RC6_STOP_BIT 0 // has no stop bit
#define RC6_LSB 0 // MSB...LSB
#define RC6_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RECS80EXT:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RECS80EXT_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse
#define RECS80EXT_START_BIT_PAUSE_TIME 3637.0e-6 // 3637 usec pause
#define RECS80EXT_PULSE_TIME 158.0e-6 // 158 usec pulse
#define RECS80EXT_1_PAUSE_TIME 7432.0e-6 // 7432 usec pause
#define RECS80EXT_0_PAUSE_TIME 4902.0e-6 // 4902 usec pause
#define RECS80EXT_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define RECS80EXT_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle)
#define RECS80EXT_ADDRESS_LEN 4 // read 4 address bits
#define RECS80EXT_COMMAND_OFFSET 6 // skip 6 bits (2nd start + 1 toggle + 4 address)
#define RECS80EXT_COMMAND_LEN 6 // read 6 command bits
#define RECS80EXT_COMPLETE_DATA_LEN 12 // complete length
#define RECS80EXT_STOP_BIT 1 // has stop bit
#define RECS80EXT_LSB 0 // MSB...LSB
#define RECS80EXT_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* NUBERT:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define NUBERT_START_BIT_PULSE_TIME 1340.0e-6 // 1340 usec pulse
#define NUBERT_START_BIT_PAUSE_TIME 340.0e-6 // 340 usec pause
#define NUBERT_1_PULSE_TIME 1340.0e-6 // 1340 usec pulse
#define NUBERT_1_PAUSE_TIME 340.0e-6 // 340 usec pause
#define NUBERT_0_PULSE_TIME 500.0e-6 // 500 usec pulse
#define NUBERT_0_PAUSE_TIME 1300.0e-6 // 1300 usec pause
#define NUBERT_FRAMES 2 // Nubert sends 2 frames
#define NUBERT_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms
#define NUBERT_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 45ms
#define NUBERT_ADDRESS_OFFSET 0 // skip 0 bits
#define NUBERT_ADDRESS_LEN 0 // read 0 address bits
#define NUBERT_COMMAND_OFFSET 0 // skip 0 bits
#define NUBERT_COMMAND_LEN 10 // read 10 bits
#define NUBERT_COMPLETE_DATA_LEN 10 // complete length
#define NUBERT_STOP_BIT 1 // has stop bit
#define NUBERT_LSB 0 // MSB?
#define NUBERT_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* FAN: (ventilator)
*
* Similar to NUBERT, but
* - has data bit instead of stop bit
* - has NO frame repetition
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define FAN_START_BIT_PULSE_TIME 1280.0e-6 // 1280 usec pulse
#define FAN_START_BIT_PAUSE_TIME 380.0e-6 // 380 usec pause
#define FAN_1_PULSE_TIME 1280.0e-6 // 1280 usec pulse
#define FAN_1_PAUSE_TIME 380.0e-6 // 380 usec pause
#define FAN_0_PULSE_TIME 380.0e-6 // 380 usec pulse
#define FAN_0_PAUSE_TIME 1280.0e-6 // 1280 usec pause
#define FAN_FRAMES 1 // FAN sends only 1 frame (NUBERT sends 2)
#define FAN_AUTO_REPETITION_PAUSE_TIME 6.6e-3 // auto repetition after 6.6ms
#define FAN_FRAME_REPEAT_PAUSE_TIME 6.6e-3 // frame repeat after 6.6ms
#define FAN_ADDRESS_OFFSET 0 // skip 0 bits
#define FAN_ADDRESS_LEN 0 // read 0 address bits
#define FAN_COMMAND_OFFSET 0 // skip 0 bits
#define FAN_COMMAND_LEN 11 // read 10 bits
#define FAN_COMPLETE_DATA_LEN 11 // complete length
#define FAN_STOP_BIT 0 // has NO stop bit (fm: this seems to be wrong)
#define FAN_LSB 0 // MSB
#define FAN_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* SPEAKER:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define SPEAKER_START_BIT_PULSE_TIME 440.0e-6 // 440 usec pulse
#define SPEAKER_START_BIT_PAUSE_TIME 1250.0e-6 // 1250 usec pause
#define SPEAKER_1_PULSE_TIME 1250.0e-6 // 1250 usec pulse
#define SPEAKER_1_PAUSE_TIME 440.0e-6 // 440 usec pause
#define SPEAKER_0_PULSE_TIME 440.0e-6 // 440 usec pulse
#define SPEAKER_0_PAUSE_TIME 1250.0e-6 // 1250 usec pause
#define SPEAKER_FRAMES 2 // SPEAKER sends 2 frames
#define SPEAKER_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms
#define SPEAKER_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 45ms
#define SPEAKER_ADDRESS_OFFSET 0 // skip 0 bits
#define SPEAKER_ADDRESS_LEN 0 // read 0 address bits
#define SPEAKER_COMMAND_OFFSET 0 // skip 0 bits
#define SPEAKER_COMMAND_LEN 10 // read 10 bits
#define SPEAKER_COMPLETE_DATA_LEN 10 // complete length
#define SPEAKER_STOP_BIT 1 // has stop bit
#define SPEAKER_LSB 0 // MSB?
#define SPEAKER_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* BANG_OLUFSEN:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define BANG_OLUFSEN_START_BIT1_PULSE_TIME 200.0e-6 // 200 usec pulse
#define BANG_OLUFSEN_START_BIT1_PAUSE_TIME 3125.0e-6 // 3125 usec pause
#define BANG_OLUFSEN_START_BIT2_PULSE_TIME 200.0e-6 // 200 usec pulse
#define BANG_OLUFSEN_START_BIT2_PAUSE_TIME 3125.0e-6 // 3125 usec pause
#define BANG_OLUFSEN_START_BIT3_PULSE_TIME 200.0e-6 // 200 usec pulse
#define BANG_OLUFSEN_START_BIT3_PAUSE_TIME 15625.0e-6 // 15625 usec pause
#define BANG_OLUFSEN_START_BIT4_PULSE_TIME 200.0e-6 // 200 usec pulse
#define BANG_OLUFSEN_START_BIT4_PAUSE_TIME 3125.0e-6 // 3125 usec pause
#define BANG_OLUFSEN_PULSE_TIME 200.0e-6 // 200 usec pulse
#define BANG_OLUFSEN_1_PAUSE_TIME 9375.0e-6 // 9375 usec pause
#define BANG_OLUFSEN_0_PAUSE_TIME 3125.0e-6 // 3125 usec pause
#define BANG_OLUFSEN_R_PAUSE_TIME 6250.0e-6 // 6250 usec pause (repeat last bit)
#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME 12500.0e-6 // 12500 usec pause (trailer bit)
#define BANG_OLUFSEN_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define BANG_OLUFSEN_ADDRESS_OFFSET 0 // no address bits
#define BANG_OLUFSEN_ADDRESS_LEN 0 // no address bits
#define BANG_OLUFSEN_COMMAND_OFFSET 3 // skip startbits 2, 3, 4
#define BANG_OLUFSEN_COMMAND_LEN 16 // read 16 command bits
#define BANG_OLUFSEN_COMPLETE_DATA_LEN 20 // complete length: startbits 2, 3, 4 + 16 data bits + trailer bit
#define BANG_OLUFSEN_STOP_BIT 1 // has stop bit
#define BANG_OLUFSEN_LSB 0 // MSB...LSB
#define BANG_OLUFSEN_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* GRUNDIG & NOKIA
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define GRUNDIG_NOKIA_IR60_BIT_TIME 528.0e-6 // 528 usec pulse/pause
#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME 2639.0e-6 // 2639 usec pause after pre bit
#define GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_TIME 117.76e-3 // info frame repeat after 117.76 ms
#define GRUNDIG_NOKIA_IR60_STOP_BIT 0 // has no stop bit
#define GRUNDIG_NOKIA_IR60_LSB 1 // MSB...LSB
#define GRUNDIG_NOKIA_IR60_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags
#define GRUNDIG_FRAMES 2 // GRUNDIG sends each frame 1+1 times
#define GRUNDIG_AUTO_REPETITION_PAUSE_TIME 20.0e-3 // repetition after 20ms
#define GRUNDIG_ADDRESS_OFFSET 0 // no address
#define GRUNDIG_ADDRESS_LEN 0 // no address
#define GRUNDIG_COMMAND_OFFSET 1 // skip 1 start bit
#define GRUNDIG_COMMAND_LEN 9 // read 9 command bits
#define GRUNDIG_COMPLETE_DATA_LEN 10 // complete length: 1 start bit + 9 data bits
#define NOKIA_FRAMES 3 // NOKIA sends each frame 1 + 1 + 1 times
#define NOKIA_AUTO_REPETITION_PAUSE_TIME 20.0e-3 // repetition after 20ms
#define NOKIA_ADDRESS_OFFSET 9 // skip 9 bits (1 start bit + 8 data bits)
#define NOKIA_ADDRESS_LEN 8 // 7 address bits
#define NOKIA_COMMAND_OFFSET 1 // skip 1 bit (1 start bit)
#define NOKIA_COMMAND_LEN 8 // read 8 command bits
#define NOKIA_COMPLETE_DATA_LEN 17 // complete length: 1 start bit + 8 address bits + 8 command bits
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* IR60:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define IR60_FRAMES 2 // IR60 sends each frame 1+1 times
#define IR60_AUTO_REPETITION_PAUSE_TIME 22.2e-3 // repetition after 22.2ms
#define IR60_TIMEOUT_TIME 5000.0e-6 // timeout grundig frame, switch to IR60
#define IR60_ADDRESS_OFFSET 0 // skip 1 bits
#define IR60_ADDRESS_LEN 0 // read 0 address bits
#define IR60_COMMAND_OFFSET 0 // skip 1 bit (start bit after pre bit, always 1)
#define IR60_COMMAND_LEN 7 // read 6 command bits
#define IR60_COMPLETE_DATA_LEN 7 // complete length
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* SIEMENS & RUWIDO:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#if 0
#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME 275.0e-6 // 275 usec pulse
#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME 550.0e-6 // 550 usec pause
#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME 275.0e-6 // 275 usec short pulse
#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME_2 550.0e-6 // 550 usec long pulse
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME 275.0e-6 // 275 usec short pause
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME_2 550.0e-6 // 550 usec long pause
#else
#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME 370.0e-6 // 370 usec pulse
#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME 550.0e-6 // 550 usec pause
#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME 370.0e-6 // 370 usec short pulse
#define SIEMENS_OR_RUWIDO_BIT_PULSE_TIME_2 680.0e-6 // 680 usec long pulse
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME 275.0e-6 // 275 usec short pause
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME_2 550.0e-6 // 550 usec long pause
#endif
#define SIEMENS_OR_RUWIDO_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define SIEMENS_OR_RUWIDO_STOP_BIT 0 // has no stop bit
#define SIEMENS_OR_RUWIDO_LSB 0 // MSB...LSB
#define SIEMENS_OR_RUWIDO_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags
#define RUWIDO_ADDRESS_OFFSET 0 // skip 0 bits
#define RUWIDO_ADDRESS_LEN 9 // read 9 address bits
#define RUWIDO_COMMAND_OFFSET 9 // skip 9 bits
#define RUWIDO_COMMAND_LEN 8 // read 7 + 1 command bits, last bit is only check bit
#define RUWIDO_COMPLETE_DATA_LEN 17 // complete length
#define SIEMENS_ADDRESS_OFFSET 0 // skip 0 bits
#define SIEMENS_ADDRESS_LEN 11 // read 11 bits
#define SIEMENS_COMMAND_OFFSET 11 // skip 11 bits
#define SIEMENS_COMMAND_LEN 11 // read 10 + 1 command bits, last bit is only check bit
#define SIEMENS_COMPLETE_DATA_LEN 22 // complete length
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* FDC:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define FDC_START_BIT_PULSE_TIME 2085.0e-6 // 2085 usec pulse
#define FDC_START_BIT_PAUSE_TIME 966.0e-6 // 966 usec pause
#define FDC_PULSE_TIME 300.0e-6 // 300 usec pulse
#define FDC_1_PAUSE_TIME 715.0e-6 // 715 usec pause
#define FDC_0_PAUSE_TIME 220.0e-6 // 220 usec pause
#define FDC_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms
#define FDC_ADDRESS_OFFSET 0 // skip 0 bits
#define FDC_ADDRESS_LEN 14 // read 14 address bits, but use only 6, shift 8 into command
#define FDC_COMMAND_OFFSET 20 // skip 20 bits
#define FDC_COMMAND_LEN 12 // read 12 bits
#define FDC_COMPLETE_DATA_LEN 40 // complete length
#define FDC_STOP_BIT 1 // has stop bit
#define FDC_LSB 1 // LSB...MSB
#define FDC_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RCCAR:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RCCAR_START_BIT_PULSE_TIME 2000.0e-6 // 2000 usec pulse
#define RCCAR_START_BIT_PAUSE_TIME 2000.0e-6 // 2000 usec pause
#define RCCAR_PULSE_TIME 600.0e-6 // 360 usec pulse
#define RCCAR_1_PAUSE_TIME 450.0e-6 // 650 usec pause
#define RCCAR_0_PAUSE_TIME 900.0e-6 // 180 usec pause
#define RCCAR_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms
#define RCCAR_ADDRESS_OFFSET 0 // skip 0 bits
#define RCCAR_ADDRESS_LEN 0 // read 0 address bits
#define RCCAR_COMMAND_OFFSET 0 // skip 0 bits
#define RCCAR_COMMAND_LEN 13 // read 13 bits
#define RCCAR_COMPLETE_DATA_LEN 13 // complete length
#define RCCAR_STOP_BIT 1 // has stop bit
#define RCCAR_LSB 1 // LSB...MSB
#define RCCAR_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* JVC:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define JVC_START_BIT_PULSE_TIME 9000.0e-6 // 9000 usec pulse
#define JVC_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause
#define JVC_PULSE_TIME 560.0e-6 // 560 usec pulse
#define JVC_1_PAUSE_TIME 1690.0e-6 // 1690 usec pause
#define JVC_0_PAUSE_TIME 560.0e-6 // 560 usec pause
#define JVC_FRAME_REPEAT_PAUSE_TIME 22.0e-3 // frame repeat after 22ms
#define JVC_ADDRESS_OFFSET 0 // skip 0 bits
#define JVC_ADDRESS_LEN 4 // read 4 address bits
#define JVC_COMMAND_OFFSET 4 // skip 4 bits
#define JVC_COMMAND_LEN 12 // read 12 bits
#define JVC_COMPLETE_DATA_LEN 16 // complete length
#define JVC_STOP_BIT 1 // has stop bit
#define JVC_LSB 1 // LSB...MSB
#define JVC_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* NIKON:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define NIKON_START_BIT_PULSE_TIME 2200.0e-6 // 2200 usec pulse
#define NIKON_START_BIT_PAUSE_TIME 27100.0e-6 // 27100 usec pause
#define NIKON_PULSE_TIME 500.0e-6 // 500 usec pulse
#define NIKON_1_PAUSE_TIME 3500.0e-6 // 3500 usec pause
#define NIKON_0_PAUSE_TIME 1500.0e-6 // 1500 usec pause
#define NIKON_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms
#define NIKON_ADDRESS_OFFSET 0 // skip 0 bits
#define NIKON_ADDRESS_LEN 0 // read 0 address bits
#define NIKON_COMMAND_OFFSET 0 // skip 0 bits
#define NIKON_COMMAND_LEN 2 // read 2 bits
#define NIKON_COMPLETE_DATA_LEN 2 // complete length
#define NIKON_STOP_BIT 1 // has stop bit
#define NIKON_LSB 0 // LSB...MSB
#define NIKON_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* KATHREIN:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define KATHREIN_START_BIT_PULSE_TIME 210.0e-6 // 1340 usec pulse
#define KATHREIN_START_BIT_PAUSE_TIME 6218.0e-6 // 340 usec pause
#define KATHREIN_1_PULSE_TIME 210.0e-6 // 1340 usec pulse
#define KATHREIN_1_PAUSE_TIME 3000.0e-6 // 340 usec pause
#define KATHREIN_0_PULSE_TIME 210.0e-6 // 500 usec pulse
#define KATHREIN_0_PAUSE_TIME 1400.0e-6 // 1300 usec pause
#define KATHREIN_SYNC_BIT_PAUSE_LEN_TIME 4600.0e-6 // 4600 usec sync (on 6th and/or 8th bit)
#define KATHREIN_FRAMES 1 // Kathrein sends 1 frame
#define KATHREIN_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms
#define KATHREIN_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms
#define KATHREIN_ADDRESS_OFFSET 1 // skip 1 bits
#define KATHREIN_ADDRESS_LEN 4 // read 4 address bits
#define KATHREIN_COMMAND_OFFSET 5 // skip 5 bits
#define KATHREIN_COMMAND_LEN 7 // read 7 bits
#define KATHREIN_COMPLETE_DATA_LEN 13 // complete length
#define KATHREIN_STOP_BIT 1 // has stop bit
#define KATHREIN_LSB 0 // MSB
#define KATHREIN_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* NETBOX:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define NETBOX_START_BIT_PULSE_TIME 2400.0e-6 // 2400 usec pulse
#define NETBOX_START_BIT_PAUSE_TIME 800.0e-6 // 800 usec pause
#define NETBOX_PULSE_TIME 800.0e-6 // 800 usec pulse
#define NETBOX_PAUSE_TIME 800.0e-6 // 800 usec pause
#define NETBOX_FRAMES 1 // Netbox sends 1 frame
#define NETBOX_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms
#define NETBOX_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms
#define NETBOX_ADDRESS_OFFSET 0 // skip 0 bits
#define NETBOX_ADDRESS_LEN 3 // read 3 address bits
#define NETBOX_COMMAND_OFFSET 3 // skip 3 bits
#define NETBOX_COMMAND_LEN 13 // read 13 bits
#define NETBOX_COMPLETE_DATA_LEN 16 // complete length
#define NETBOX_STOP_BIT 0 // has no stop bit
#define NETBOX_LSB 1 // LSB
#define NETBOX_FLAGS IRMP_PARAM_FLAG_IS_SERIAL // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* LEGO:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define LEGO_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz)
#define LEGO_START_BIT_PAUSE_TIME 1026.0e-6 // 1026 usec pause (39 x 1/38kHz)
#define LEGO_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz)
#define LEGO_1_PAUSE_TIME 553.0e-6 // 553 usec pause (21 x 1/38kHz)
#define LEGO_0_PAUSE_TIME 263.0e-6 // 263 usec pause (10 x 1/38kHz)
#define LEGO_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms
#define LEGO_ADDRESS_OFFSET 0 // skip 0 bits
#define LEGO_ADDRESS_LEN 0 // read 0 address bits
#define LEGO_COMMAND_OFFSET 0 // skip 0 bits
#define LEGO_COMMAND_LEN 16 // read 16 bits (12 command + 4 CRC)
#define LEGO_COMPLETE_DATA_LEN 16 // complete length
#define LEGO_STOP_BIT 1 // has stop bit
#define LEGO_LSB 0 // MSB...LSB
#define LEGO_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* THOMSON:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define THOMSON_PULSE_TIME 550.0e-6 // 550 usec pulse
#define THOMSON_1_PAUSE_TIME 4500.0e-6 // 4500 usec pause
#define THOMSON_0_PAUSE_TIME 2000.0e-6 // 2000 usec pause
#define THOMSON_FRAMES 1 // THOMSON sends 1 frame
#define THOMSON_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // repetition after 35ms
#define THOMSON_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms
#define THOMSON_ADDRESS_OFFSET 0 // skip 0 bits
#define THOMSON_ADDRESS_LEN 4 // read 4 address bits
#define THOMSON_COMMAND_OFFSET 5 // skip 4 address bits + 1 toggle bit
#define THOMSON_COMMAND_LEN 7 // read 7 command bits
#define THOMSON_COMPLETE_DATA_LEN 12 // complete length
#define THOMSON_STOP_BIT 1 // has stop bit
#define THOMSON_LSB 0 // MSB...LSB
#define THOMSON_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* BOSE:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define BOSE_START_BIT_PULSE_TIME 1060.0e-6 // 1060 usec pulse
#define BOSE_START_BIT_PAUSE_TIME 1425.0e-6 // 1425 usec pause
#define BOSE_PULSE_TIME 550.0e-6 // 550 usec pulse
#define BOSE_1_PAUSE_TIME 1425.0e-6 // 1425 usec pause
#define BOSE_0_PAUSE_TIME 437.0e-6 // 437 usec pause
#define BOSE_FRAMES 1
#define BOSE_AUTO_REPETITION_PAUSE_TIME 40.0e-3 // repetition after 40ms?
#define BOSE_FRAME_REPEAT_PAUSE_TIME 40.0e-3 // frame repeat after 40ms?
#define BOSE_ADDRESS_OFFSET 0 // skip 0 bits
#define BOSE_ADDRESS_LEN 0 // read 16 address bits
#define BOSE_COMMAND_OFFSET 0 // skip 16 bits (8 address + 8 /address)
#define BOSE_COMMAND_LEN 16 // read 16 bits (8 command + 8 /command)
#define BOSE_COMPLETE_DATA_LEN 16 // complete length
#define BOSE_STOP_BIT 1 // has stop bit
#define BOSE_LSB 1 // LSB...MSB
#define BOSE_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* A1TVBOX:
* In reality A1 TV Box has no start bit with 300/340 usec. There are 2 start bits "10" with 250us pulse + 150us pause + 150us pause + 250us pulse
* This is not very easy to detect, because 1st and 2nd pause of both start bits are closely spaced.
* So IRMP looks for pseudo start bit with 300/340 usec and ignores the second half of the 2nd bit (250us pulse)
* This method only works because the first data bit (which is the 3rd bit) following is always "1":
* IRMP treats the first "long" pulse (250us of 2nd start bit + 250us of 1st data bit) of this "1" as a first _short_ pulse.
* This is a bug in IRMP's manchester decoder, but a good feature here ;-)
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define A1TVBOX_START_BIT_PULSE_TIME 300.0e-6 // 300 usec pulse
#define A1TVBOX_START_BIT_PAUSE_TIME 340.0e-6 // 340 usec pause
#define A1TVBOX_BIT_PULSE_TIME 250.0e-6 // 250 usec pulse
#define A1TVBOX_BIT_PAUSE_TIME 150.0e-6 // 150 usec pulse
#define A1TVBOX_STOP_BIT 0 // has no stop bit
#define A1TVBOX_LSB 0 // MSB...LSB
#define A1TVBOX_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1 ) // flags
#define A1TVBOX_FRAMES 1 // A1TVBOX sends each frame 1 times
#define A1TVBOX_ADDRESS_OFFSET 1 // skip 1 bits
#define A1TVBOX_ADDRESS_LEN 8 // read 8 address bits
#define A1TVBOX_COMMAND_OFFSET 9 // skip 9 bits (start bit + address)
#define A1TVBOX_COMMAND_LEN 8 // read 8 command bits
#define A1TVBOX_COMPLETE_DATA_LEN 17 // complete length incl. start bit
#define A1TVBOX_FRAME_REPEAT_PAUSE_TIME 50.0e-3 // 50 msec pause between frames, don't know if it is correct
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* MERLIN:
* See notes for A1TVBOX
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define MERLIN_START_BIT_PULSE_TIME 210.0e-6 // 210 usec pulse
#define MERLIN_START_BIT_PAUSE_TIME 420.0e-6 // 429 usec pause
#define MERLIN_BIT_PULSE_TIME 210.0e-6 // 210 usec pulse
#define MERLIN_BIT_PAUSE_TIME 210.0e-6 // 210 usec pulse
#define MERLIN_STOP_BIT 0 // has no stop bit
#define MERLIN_LSB 0 // MSB...LSB
#define MERLIN_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1 ) // flags
#define MERLIN_FRAMES 1 // MERLIN sends each frame 1 times
#define MERLIN_ADDRESS_OFFSET 1 // skip 1 bits
#define MERLIN_ADDRESS_LEN 8 // read 8 address bits
#define MERLIN_COMMAND_OFFSET 8 // skip 9 bits (start bit + address)
#define MERLIN_COMMAND_LEN 10 // read 8 command bits
#define MERLIN_COMPLETE_DATA_LEN 19 // complete length incl. start bit
#define MERLIN_FRAME_REPEAT_PAUSE_TIME 50.0e-3 // 50 msec pause between frames, don't know if it is correct
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* ORTEK (Hama): 6 address bits + 2 frame type bits + 6 command bits + 1 parity bit + 1 unknown bit + "1" + "0"
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define ORTEK_START_BIT_PULSE_TIME 2000.0e-6 // 2000 usec pulse
#define ORTEK_START_BIT_PAUSE_TIME 1000.0e-6 // 1000 usec pause
#define ORTEK_BIT_TIME 500.0e-6 // 500 usec pulse/pause
#define ORTEK_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms
#define ORTEK_ADDRESS_OFFSET 0 // skip 0 bits
#define ORTEK_ADDRESS_LEN 8 // read 6 address bits + 2 special bits
#define ORTEK_COMMAND_OFFSET 8 // skip 6 address bits + 2 special bits
#define ORTEK_COMMAND_LEN 6 // read 6 command bits
#define ORTEK_COMPLETE_DATA_LEN 18 // complete length
#define ORTEK_STOP_BIT 0 // has no stop bit
#define ORTEK_LSB 0 // MSB...LSB
#define ORTEK_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* TELEFUNKEN:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define TELEFUNKEN_START_BIT_PULSE_TIME 600.0e-6 // 600 usec pulse
#define TELEFUNKEN_START_BIT_PAUSE_TIME 1500.0e-6 // 1500 usec pause
#define TELEFUNKEN_PULSE_TIME 600.0e-6 // 600 usec pulse
#define TELEFUNKEN_1_PAUSE_TIME 1500.0e-6 // 1500 usec pause
#define TELEFUNKEN_0_PAUSE_TIME 600.0e-6 // 600 usec pause
#define TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME 22.0e-3 // frame repeat after XX ms ?????
#define TELEFUNKEN_ADDRESS_OFFSET 0 // skip 0 bits
#define TELEFUNKEN_ADDRESS_LEN 0 // read 0 address bits
#define TELEFUNKEN_COMMAND_OFFSET 0 // skip 0 bits
#define TELEFUNKEN_COMMAND_LEN 15 // read 15 bits
#define TELEFUNKEN_COMPLETE_DATA_LEN 15 // complete length
#define TELEFUNKEN_STOP_BIT 1 // has stop bit
#define TELEFUNKEN_LSB 0 // LSB...MSB
#define TELEFUNKEN_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* ROOMBA
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define ROOMBA_START_BIT_PULSE_TIME 2790.0e-6 // 2790 usec pulse
#define ROOMBA_START_BIT_PAUSE_TIME 930.0e-6 // 930 usec pause
#define ROOMBA_0_PULSE_TIME 930.0e-6 // 930 usec pulse
#define ROOMBA_1_PULSE_TIME 2790.0e-6 // 2790 usec pulse
#define ROOMBA_0_PAUSE_TIME 2790.0e-6 // 2790 usec pause
#define ROOMBA_1_PAUSE_TIME 930.0e-6 // 930 usec pause
#define ROOMBA_FRAME_REPEAT_PAUSE_TIME 18.0e-3 // frame repeat after 18ms
#define ROOMBA_ADDRESS_OFFSET 0 // skip 0 bits
#define ROOMBA_ADDRESS_LEN 0 // read 0 address bits
#define ROOMBA_COMMAND_OFFSET 0 // skip 0 bits
#define ROOMBA_COMMAND_LEN 7 // read 7 bits
#define ROOMBA_COMPLETE_DATA_LEN 7 // complete length
#define ROOMBA_STOP_BIT 0 // has stop bit (fm: sure?)
#define ROOMBA_LSB 0 // MSB...LSB
#define ROOMBA_FLAGS 0 // flags
#define ROOMBA_FRAMES 8 // ROOMBA sends 8 frames (this is a lie, but more comfortable)
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RC-MM (32, 24, or 12 bit)
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RCMM32_START_BIT_PULSE_TIME 500.0e-6 // 500 usec pulse
#define RCMM32_START_BIT_PAUSE_TIME 220.0e-6 // 220 usec pause
#define RCMM32_PULSE_TIME 230.0e-6 // 230 usec pulse
#define RCMM32_00_PAUSE_TIME 220.0e-6 // 220 usec pause
#define RCMM32_01_PAUSE_TIME 370.0e-6 // 370 usec pause
#define RCMM32_10_PAUSE_TIME 540.0e-6 // 540 usec pause
#define RCMM32_11_PAUSE_TIME 720.0e-6 // 720 usec pause
#define RCMM32_FRAME_REPEAT_PAUSE_TIME 80.0e-3 // frame repeat after 80 ms
#define RCMM32_ADDRESS_OFFSET 0 // skip 0 bits
#define RCMM32_ADDRESS_LEN 16 // read 16 address bits
#define RCMM32_COMMAND_OFFSET 17 // skip 17 bits
#define RCMM32_COMMAND_LEN 15 // read 15 bits
#define RCMM32_COMPLETE_DATA_LEN 32 // complete length
#define RCMM32_STOP_BIT 1 // has stop bit
#define RCMM32_LSB 0 // LSB...MSB
#define RCMM32_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* PENTAX:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define PENTAX_START_BIT_PULSE_TIME 13000.0e-6 // 13 msec pulse
#define PENTAX_START_BIT_PAUSE_TIME 3000.0e-6 // 3 msec pause
#define PENTAX_PULSE_TIME 1000.0e-6 // 1 msec pulse
#define PENTAX_1_PAUSE_TIME 3000.0e-6 // 3 msec pause
#define PENTAX_0_PAUSE_TIME 1000.0e-6 // 1 msec pause
#define PENTAX_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms
#define PENTAX_ADDRESS_OFFSET 0 // skip 0 bits
#define PENTAX_ADDRESS_LEN 0 // read 0 address bits
#define PENTAX_COMMAND_OFFSET 0 // skip 0 bits
#define PENTAX_COMMAND_LEN 6 // read 6 bits
#define PENTAX_COMPLETE_DATA_LEN 6 // complete length
#define PENTAX_STOP_BIT 1 // has stop bit
#define PENTAX_LSB 0 // LSB...MSB
#define PENTAX_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* ACP24: Stiebel Eltron ACP24 air conditioner
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define ACP24_START_BIT_PULSE_TIME 390.0e-6 // 390 usec pulse
#define ACP24_START_BIT_PAUSE_TIME 950.0e-6 // 950 usec pause
#define ACP24_PULSE_TIME 390.0e-6 // 390 usec pulse
#define ACP24_1_PAUSE_TIME 1300.0e-6 // 1300 usec pause
#define ACP24_0_PAUSE_TIME 950.0e-6 // 950 usec pause
#define ACP24_FRAME_REPEAT_PAUSE_TIME 22.0e-3 // frame repeat after 22ms?
#define ACP24_ADDRESS_OFFSET 0 // skip 0 bits
#define ACP24_ADDRESS_LEN 0 // read 6 address bits
#define ACP24_COMMAND_OFFSET 0 // skip 6 bits
#define ACP24_COMMAND_LEN 0 // read 0 bits (70 bits will be read and compressed by special routine)
#define ACP24_COMPLETE_DATA_LEN 70 // complete length
#define ACP24_STOP_BIT 1 // has stop bit
#define ACP24_LSB 0 // LSB...MSB
#define ACP24_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* RADIO1 - e.g. Tevion
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define RADIO1_START_BIT_PULSE_TIME 3000.0e-6 // 3000 usec pulse
#define RADIO1_START_BIT_PAUSE_TIME 7000.0e-6 // 7000 usec pulse
#define RADIO1_0_PULSE_TIME 500.0e-6 // 500 usec pulse
#define RADIO1_0_PAUSE_TIME 1000.0e-6 // 1000 usec pause
#define RADIO1_1_PULSE_TIME 1000.0e-6 // 1000 usec pulse
#define RADIO1_1_PAUSE_TIME 500.0e-6 // 500 usec pause
#define RADIO1_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms
#define RADIO1_ADDRESS_OFFSET 4 // skip 4 bits
#define RADIO1_ADDRESS_LEN 16 // read 16 address bits
#define RADIO1_COMMAND_OFFSET 20 // skip 4 + 16 bits
#define RADIO1_COMMAND_LEN 3 // read 3 command bits
#define RADIO1_COMPLETE_DATA_LEN 23 // complete length
#define RADIO1_STOP_BIT 1 // has stop bit
#define RADIO1_LSB 1 // LSB...MSB?
#define RADIO1_FLAGS 0 // flags
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* Frame Repetitions:
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define AUTO_FRAME_REPETITION_TIME 80.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 25-50ms
#endif // _IRMP_PROTOCOLS_H_

201
extras/irmp/irmpsystem.h Normal file
View file

@ -0,0 +1,201 @@
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* irmpsystem.h - system specific includes and defines
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
*
* $Id: irmpsystem.h,v 1.25 2016/12/19 09:01:41 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
#ifndef _IRMPSYSTEM_H_
#define _IRMPSYSTEM_H_
#if !defined(_IRMP_H_) && !defined(_IRSND_H_)
# error please include only irmp.h or irsnd.h, not irmpsystem.h
#endif
#if defined(__18CXX) // Microchip PIC C18 compiler
# define PIC_C18
#elif defined(__XC8) // PIC XC8 compiler
# include <xc.h>
# define PIC_C18
#elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC compiler
# define PIC_CCS
#elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD) // ARM STM32
# include <stm32l1xx.h>
# define ARM_STM32
# define ARM_STM32L1XX
# define F_CPU (SysCtlClockGet())
#elif defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) \
|| defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) \
|| defined(STM32F10X_HD) || defined(STM32F10X_HD_VL) \
|| defined(STM32F10X_XL) || defined(STM32F10X_CL) // ARM STM32
# include <stm32f10x.h>
# define ARM_STM32
# define ARM_STM32F10X
# define F_CPU (SysCtlClockGet())
#elif defined(STM32F4XX) // ARM STM32
# include <stm32f4xx.h>
# define ARM_STM32
# define ARM_STM32F4XX
#elif defined(__SDCC_stm8) // STM8
# define SDCC_STM8
#elif defined(TARGET_IS_BLIZZARD_RA2) // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)
# define STELLARIS_ARM_CORTEX_M4
# define F_CPU (SysCtlClockGet())
#elif defined(__xtensa__) // ESP8266 (Arduino)
#include "FreeRTOS.h"
#include "esp/gpio.h"
//# include "Arduino.h"
//# include "ets_sys.h"
//# include "osapi.h"
//# include "gpio.h"
//# include "os_type.h"
//# include "c_types.h"
# define uint_fast8_t uint8_t
# define uint_fast16_t uint16_t
#elif defined(TEENSYDUINO) && (defined(__MK20DX256__) || defined(__MK20DX128__)) // Teensy 3.x (tested on Teensy 3.1 in Arduino 1.6.5 / Teensyduino 1.2.5)
# include <core_pins.h>
# define TEENSY_ARM_CORTEX_M4
#elif defined(unix) || defined(WIN32) || defined(__APPLE__) // Unix/Linux or Windows or Apple
# define UNIX_OR_WINDOWS
#elif defined(__MBED__) // mbed platform
// #include "mbed.h" // if mbed.h is used, source must be compiled as cpp
#include "gpio_api.h"
#else
# define ATMEL_AVR // ATMEL AVR
#endif
#include <string.h>
#ifdef UNIX_OR_WINDOWS // Analyze on Unix/Linux or Windows
# include <stdio.h>
# include <stdlib.h>
# define F_CPU 8000000L
# define ANALYZE
# ifdef unix
# include <stdint.h>
# else
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
# endif
#endif
#if defined(ATMEL_AVR)
# include <stdint.h>
# include <stdio.h>
# include <avr/io.h>
# include <util/delay.h>
# include <avr/pgmspace.h>
# include <avr/interrupt.h>
# define IRSND_OC2 0 // OC2
# define IRSND_OC2A 1 // OC2A
# define IRSND_OC2B 2 // OC2B
# define IRSND_OC0 3 // OC0
# define IRSND_OC0A 4 // OC0A
# define IRSND_OC0B 5 // OC0B
# define IRSND_XMEGA_OC0A 0 // OC0A
# define IRSND_XMEGA_OC0B 1 // OC0B
# define IRSND_XMEGA_OC0C 2 // OC0C
# define IRSND_XMEGA_OC0D 3 // OC0D
# define IRSND_XMEGA_OC1A 4 // OC1A
# define IRSND_XMEGA_OC1B 5 // OC1B
#elif defined(STELLARIS_ARM_CORTEX_M4)
# include "inc/hw_ints.h"
# include "inc/hw_memmap.h"
# include "inc/hw_types.h"
# include "inc/hw_gpio.h"
# include "driverlib/fpu.h"
# include "driverlib/sysctl.h"
# include "driverlib/interrupt.h"
# include "driverlib/gpio.h"
# include "driverlib/rom.h"
# include "driverlib/systick.h"
# include "driverlib/pin_map.h"
# include "driverlib/timer.h"
# define PROGMEM
# define memcpy_P memcpy
# define APP_SYSTICKS_PER_SEC 32
#elif defined(ARM_STM32F10X)
# include "stm32f10x_gpio.h"
# include "stm32f10x_rcc.h"
# include "stm32f10x_tim.h"
# include "misc.h"
# define PROGMEM
# define memcpy_P memcpy
#elif defined(SDCC_STM8)
# include "stm8s.h"
# define PROGMEM
# define memcpy_P memcpy
# define __attribute__(x)
# define uint_fast8_t uint8_t
# define uint_fast16_t uint16_t
#elif defined(TEENSY_ARM_CORTEX_M4)
# define PROGMEM
# define memcpy_P memcpy
#elif defined(__xtensa__)
# define PROGMEM
# define memcpy_P memcpy
#elif defined(__MBED__)
# define PROGMEM
# define memcpy_P memcpy
#else
# define PROGMEM
# define memcpy_P memcpy
#endif
#if defined(PIC_CCS) || defined(PIC_C18) || defined(ARM_STM32) || defined(STELLARIS_ARM_CORTEX_M4)
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned char uint_fast8_t;
typedef unsigned short uint_fast16_t;
#endif
#if defined (PIC_C18) // PIC C18 or XC8 compiler
# include <p18cxxx.h> // main PIC18 h file
#ifndef __XC8
# include <timers.h> // timer lib
# include <pwm.h> // pwm lib
#endif
# define IRSND_PIC_CCP1 1 // PIC C18 RC2 = PWM1 module
# define IRSND_PIC_CCP2 2 // PIC C18 RC1 = PWM2 module
#endif
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#if defined(PIC_C18)
#define IRMP_PACKED_STRUCT
#else
#define IRMP_PACKED_STRUCT __attribute__ ((__packed__))
#endif
typedef struct IRMP_PACKED_STRUCT
{
uint8_t protocol; // protocol, e.g. NEC_PROTOCOL
uint16_t address; // address
uint16_t command; // command
uint8_t flags; // flags, e.g. repetition
} IRMP_DATA;
#endif // _IRMPSYSTEM_H_