From: ukw Date: Mon, 19 Sep 2016 14:29:31 +0000 (+0000) Subject: Version 3.0.3: added VINCENT protocol X-Git-Tag: irmp-libopencm3-pre-1~11 X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp.git/commitdiff_plain/4bcf310e81dd5d1bc29ad018f0cb7f87cd819448?hp=7365350cfc3f5406c68411a2eafe97dadaa08444 Version 3.0.3: added VINCENT protocol git-svn-id: svn://mikrocontroller.net/irmp@178 aeb2e35e-bfc4-4214-b83c-9e8de998ed28 --- diff --git a/IR-Data/test-suite.sh b/IR-Data/test-suite.sh index df2b3ae..0511870 100644 --- a/IR-Data/test-suite.sh +++ b/IR-Data/test-suite.sh @@ -72,16 +72,16 @@ do echo -n "testing $j ... " if tmpsrc/irmp-10kHz -v < $j | grep -q error then - tmpsrc/irmp-10kHz -v < $j | grep error - echo "test failed" - exit 1 + tmpsrc/irmp-10kHz -v < $j | grep error + echo "test failed" + exit 1 else - if tmpsrc/irmp-10kHz -v < $j | grep -q checked - then - echo "checked!" - else - echo "successful" - fi + if tmpsrc/irmp-10kHz -v < $j | grep -q checked + then + echo "checked!" + else + echo "successful" + fi fi done @@ -99,37 +99,38 @@ for j in \ kathrein-15kHz.txt \ lg-air-15kHz.txt \ merlin-15kHz.txt \ - panasonic-vcr-15kHz.txt \ - pentax-15kHz.txt \ - rc5-philipps-15kHz.txt \ - rc6a-siemens-15kHz.txt \ + panasonic-vcr-15kHz.txt \ + pentax-15kHz.txt \ + rc5-philipps-15kHz.txt \ + rc6a-siemens-15kHz.txt \ recs80-15kHz.txt \ saa3004-15kHz.txt \ - samsung-br-15kHz.txt \ - samsung32-tv-15kHz.txt \ + samsung-br-15kHz.txt \ + samsung32-tv-15kHz.txt \ samsung32-15kHz.txt \ samsung48-15kHz.txt \ sharp_15khz.txt \ - technics-15kHz.txt \ + technics-15kHz.txt \ thomson-mb100-15kHz.txt \ tp400vt-15kHz.txt \ universal-15kHz.txt \ - vincent-flash-15kHz.txt \ + vincent-15kHz.txt \ + vincent-flash-15kHz.txt \ xbox360-15kHz.txt do echo -n "testing $j ... " if tmpsrc/irmp-15kHz -v < $j | grep -q error then - tmpsrc/irmp-15kHz -v < $j | grep error - echo "test failed" - exit 1 + tmpsrc/irmp-15kHz -v < $j | grep error + echo "test failed" + exit 1 else - if tmpsrc/irmp-15kHz -v < $j | grep -q checked - then - echo "checked!" - else - echo "successful" - fi + if tmpsrc/irmp-15kHz -v < $j | grep -q checked + then + echo "checked!" + else + echo "successful" + fi fi done @@ -146,16 +147,16 @@ do echo -n "testing $j ... " if tmpsrc/irmp-20kHz -v < $j | grep -q error then - tmpsrc/irmp-20kHz -v < $j | grep error - echo "test failed" - exit 1 + tmpsrc/irmp-20kHz -v < $j | grep error + echo "test failed" + exit 1 else - if tmpsrc/irmp-20kHz -v < $j | grep -q checked - then - echo "checked!" - else - echo "successful" - fi + if tmpsrc/irmp-20kHz -v < $j | grep -q checked + then + echo "checked!" + else + echo "successful" + fi fi done diff --git a/README.txt b/README.txt index ca88fd7..0b2b87f 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,8 @@ IRMP - Infrared Multi Protocol Decoder -------------------------------------- -Version IRMP: 3.0.2 2016-09-09 -Version IRSND: 3.0.2 2016-09-09 +Version IRMP: 3.0.3 2016-09-19 +Version IRSND: 3.0.3 2016-09-19 Documentation: diff --git a/irmp.c b/irmp.c index 3b97afc..6297aa5 100644 --- a/irmp.c +++ b/irmp.c @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.c,v 1.187 2016/09/09 07:53:29 fm Exp $ + * $Id: irmp.c,v 1.188 2016/09/14 06:31:48 fm Exp $ * * Supported AVR mikrocontrollers: * @@ -173,6 +173,17 @@ #define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1) #define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1) +#define VINCENT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) +#define VINCENT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) +#define VINCENT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) +#define VINCENT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) +#define VINCENT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) +#define VINCENT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1) +#define VINCENT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1) +#define VINCENT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1) +#define VINCENT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1) +#define VINCENT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1) + #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1) #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) @@ -635,6 +646,7 @@ static const char proto_acp24[] PROGMEM = "ACP24"; static const char proto_technics[] PROGMEM = "TECHNICS"; static const char proto_panasonic[] PROGMEM = "PANASONIC"; static const char proto_mitsu_heavy[] PROGMEM = "MITSU_HEAVY"; +static const char proto_vincent[] PROGMEM = "VINCENT"; static const char proto_radio1[] PROGMEM = "RADIO1"; @@ -691,6 +703,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM = proto_technics, proto_panasonic, proto_mitsu_heavy, + proto_vincent, proto_radio1 }; @@ -1336,6 +1349,31 @@ static const PROGMEM IRMP_PARAMETER mitsu_heavy_param = #endif +#if IRMP_SUPPORT_VINCENT_PROTOCOL == 1 + +static const PROGMEM IRMP_PARAMETER vincent_param = +{ + IRMP_VINCENT_PROTOCOL, // protocol: ir protocol + VINCENT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1 + VINCENT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1 + VINCENT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1 + VINCENT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1 + VINCENT_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0 + VINCENT_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0 + VINCENT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0 + VINCENT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0 + VINCENT_ADDRESS_OFFSET, // address_offset: address offset + VINCENT_ADDRESS_OFFSET + VINCENT_ADDRESS_LEN, // address_end: end of address + VINCENT_COMMAND_OFFSET, // command_offset: command offset + VINCENT_COMMAND_OFFSET + VINCENT_COMMAND_LEN, // command_end: end of command + VINCENT_COMPLETE_DATA_LEN, // complete_len: complete length of frame + VINCENT_STOP_BIT, // stop_bit: flag: frame has stop bit + VINCENT_LSB, // lsb_first: flag: LSB first + VINCENT_FLAGS // flags: some flags +}; + +#endif + #if IRMP_SUPPORT_RECS80_PROTOCOL == 1 static const PROGMEM IRMP_PARAMETER recs80_param = @@ -2200,6 +2238,18 @@ irmp_get_data (IRMP_DATA * irmp_data_p) } break; #endif + + +#if IRMP_SUPPORT_NEC_PROTOCOL == 1 + case IRMP_VINCENT_PROTOCOL: + if ((irmp_command >> 8) == (irmp_command & 0x00FF)) + { + irmp_command &= 0xff; + rtc = TRUE; + } + break; +#endif + #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 case IRMP_BOSE_PROTOCOL: if ((irmp_command >> 8) == (~irmp_command & 0x00FF)) @@ -3066,6 +3116,20 @@ irmp_ISR (void) else #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1 +#if IRMP_SUPPORT_VINCENT_PROTOCOL == 1 + if (irmp_pulse_time >= VINCENT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= VINCENT_START_BIT_PULSE_LEN_MAX && + irmp_pause_time >= VINCENT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= VINCENT_START_BIT_PAUSE_LEN_MAX) + { // it's VINCENT +#ifdef ANALYZE + ANALYZE_PRINTF ("protocol = VINCENT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n", + VINCENT_START_BIT_PULSE_LEN_MIN, VINCENT_START_BIT_PULSE_LEN_MAX, + VINCENT_START_BIT_PAUSE_LEN_MIN, VINCENT_START_BIT_PAUSE_LEN_MAX); +#endif // ANALYZE + irmp_param_p = (IRMP_PARAMETER *) &vincent_param; + } + else +#endif // IRMP_SUPPORT_VINCENT_PROTOCOL == 1 + #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1 if (irmp_pulse_time >= RADIO1_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RADIO1_START_BIT_PULSE_LEN_MAX && irmp_pause_time >= RADIO1_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RADIO1_START_BIT_PAUSE_LEN_MAX) diff --git a/irmpconfig.h b/irmpconfig.h index 61c14a9..9887ea0 100644 --- a/irmpconfig.h +++ b/irmpconfig.h @@ -6,7 +6,7 @@ * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de * Extensions for PIC 12F1820 W.Strobl 2014-07-20 * - * $Id: irmpconfig.h,v 1.148 2016/09/09 07:53:29 fm Exp $ + * $Id: irmpconfig.h,v 1.150 2016/09/19 14:28:24 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 @@ -98,6 +98,7 @@ #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_RADIO1_PROTOCOL 0 // RADIO, e.g. TEVION >= 10000 ~250 bytes (experimental) /*--------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/irmpprotocols.h b/irmpprotocols.h index a742d6d..0b38759 100644 --- a/irmpprotocols.h +++ b/irmpprotocols.h @@ -5,7 +5,7 @@ * * Copyright (c) 2013-2016 Frank Meyer - frank(at)fli4l.de * - * $Id: irmpprotocols.h,v 1.46 2016/09/09 07:53:29 fm Exp $ + * $Id: irmpprotocols.h,v 1.47 2016/09/14 06:31:48 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 @@ -74,10 +74,11 @@ #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_RADIO1_PROTOCOL 50 // Radio protocol (experimental status), do not use it yet! +#define IRMP_RADIO1_PROTOCOL 51 // Radio protocol (experimental status), do not use it yet! -#define IRMP_N_PROTOCOLS 51 // number of supported protocols +#define IRMP_N_PROTOCOLS 52 // number of supported protocols /*--------------------------------------------------------------------------------------------------------------------------------------------------- * timing constants: @@ -295,6 +296,26 @@ typedef uint8_t PAUSE_LEN; #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: *---------------------------------------------------------------------------------------------------------------------------------------------------