From a7054daf46ab0ee2310b26be519161d5a0320211 Mon Sep 17 00:00:00 2001 From: ukw Date: Wed, 2 Jun 2010 13:40:38 +0000 Subject: [PATCH] Version 1.5.0: added Siemens Gigaset protocol, added frame repeat for irsnd git-svn-id: svn://mikrocontroller.net/irmp@18 aeb2e35e-bfc4-4214-b83c-9e8de998ed28 --- IR-Data/Siemens-Gigaset-M740AV-15kHz.txt | 59 ++ IR-Data/Siemens-Gigaset-M740AV.txt | 59 ++ IR-Data/test-suite.sh | 3 +- irmp.c | 140 ++++- irmp.exe | Bin 22528 -> 23040 bytes irmp.h | 429 ++++++++------- irmpconfig.h | 3 +- irsnd.c | 655 ++++++++++++----------- irsnd.exe | Bin 12800 -> 13312 bytes irsndconfig.h | 10 +- irsndmain.c | 10 +- 11 files changed, 845 insertions(+), 523 deletions(-) create mode 100644 IR-Data/Siemens-Gigaset-M740AV-15kHz.txt create mode 100644 IR-Data/Siemens-Gigaset-M740AV.txt diff --git a/IR-Data/Siemens-Gigaset-M740AV-15kHz.txt b/IR-Data/Siemens-Gigaset-M740AV-15kHz.txt new file mode 100644 index 0000000..8a7eb26 --- /dev/null +++ b/IR-Data/Siemens-Gigaset-M740AV-15kHz.txt @@ -0,0 +1,59 @@ +# Power +0000111111110000111100000000111100001111111100000000111100001111111000001110000011100000000011111110000011100000111000001110000011100001111000000001111111100000000111100001111111100001111111111111111111 +# 1 +0000011111110000011100000000111100001111111100000000111100001111111100001111000011110000000011111110000011100000111000001110000011100000111000001110000011100001111000000001111111100001111111111111111111 +#2 +00000111111100000111000000001111000011111111000000001110000011111110000011100000111000000001111111100001111000011110000111000001110000011100000111000001110000000011111111000000001111111111111111 +# 3 +0000111111110000111100000000111100001111111100000000111100001111111100001110000011100000000011111110000011100000111000001110000011100000111000011110000111100000000111100001111111100001111111111111111111 +# 4 +0000111111110000111100000000111100001111111100000000111100001111111000001110000011100000000011111110000011100000111000001110000011100001111000011110000000011111111000011110000000011111111111111111111111 +# 5 +0000011111110000011100000000011100000111111100000000111100001111111100001111000011110000000011111111000011110000111100001110000011100000111000001110000000001111111000000000111111100000111111111111111111 +# 6 +00001111111100001111000000001110000011111110000000001110000011111110000111100001111000000001111111000001110000011100000111000001110000111100001111000000001111000011111110000000001111111111111111 +# 7 +0000011111110000011100000000011100000111111100000000111100001111111100001111000011110000000011111111000011110000111000001110000011100000111000001110000000001110000011100000111111100000111111111111111111 +# 8 +00000111111100000111000000000111000001111111000000001111000011111111000011110000111100000000111111110000111100001110000011100000111000001110000000001111111000001110000011100000000011111111111111 +# 9 +0000111111110000111100000000111100001111111000000000111000001111111000001110000111100000000111111110000111000001110000011100000111000001110000000011111111000011110000000011111110000011111111111111111111 +# 0 +00000111111100000111000000000111000001111111000000000111000001111111000001110000111100000000111111110000111100001111000011110000111100001111000000001111111000000000111111100000000011111111111111 +# HELP +0000111111110000111100000000111100001111111000000000111000001111111000011110000111100000000111111110000111000001110000011100000111000000001111111100001111000000001111000011111110000011111111111111111111 +# Hoch +00000111111100001111000000001111000011111110000000001110000011111110000011100001111000000001111111100001110000011100000111000001110000000001111111000000001111000011111111000000001111111111111111 +# Links +00000111111100001111000000001111000011111111000000001110000011111110000011100000111000000001111111100001111000011100000111000001110000011100000000011100001111111100001111000000001111111111111111 +# OK +00000111111100000111000000000111000001111111000000001111000011111111000011110000111100000000111111110000111100001110000011100000111000001110000000001110000011100000111111100000000011111111111111 +# Rechts +0000011111110000111100000000111100001111111100000000111100001111111100001110000011100000000011111110000011100000111000001110000011100000111000000001111000011110000111100001111111100001111111111111111111 +# Runter +00000111111110000111100000000111100001111111100000000111000001111111000001110000011100000000011111110000011100000111000011110000111100000000111111110000111100001111000011110000000011111111111111 +# EXIT +0000011111111000011110000000011110000111111100000000011100000111111100000111000001110000000001111111000001110000011100001111000011110000111100000000111100001111111100000000111111110000111111111111111111 +# Mute +0000111111110000111100000000111100001111111100000000111100001111111000001110000011100000000011111110000011100000111000001110000011100000000111111110000000011110000111100001111111100001111111111111111111 +# Menu +0000111111110000111100000000111100001111111100000000111100001111111000001110000011100000000011111110000011100000111000001110000011100000000111100001111111100001111000000001111111100001111111111111111111 +# EPG +0000011111110000011100000000011100000111111100000000011100001111111100001111000011110000000011111111000011110000111100001110000011100000000011100000111111100000000011100000111111100000111111111111111111 +# INFO +00000111111100000111000000000111000001111111000000000111000001111111000001110000111100000000111111110000111100001111000011110000111100000000111100001110000011111110000011100000000011111111111111 +# REW +0000011111111000011110000000011110000111111100000000011100000111111100000111000001110000000001111111000001110000011100001111000011110000000011110000111100001111111100000000111111100000111111111111111111 +# STOP +00000111111100000111000000000111000001111111000000001111000011111111000011100000111000000000111111100000111000011110000111100001111000000001110000011100000111000001111111000000001111111111111111 +# FF +0000011111110000011100000000111100001111111100000000111100001111111100001111000011110000000011111110000011100000111000001110000011100000000011100000111000001110000111100001111111100001111111111111111111 +# Rot +00000111111100000111000000000111000001111111000000001111000011111111000011110000111100000000111111110000111100001110000011100000000011111110000011100000111000001110000011100000000011111111111111 +# Gruen +0000011111110000011100000000111100001111111100000000111000001111111000001110000011100000000111111110000111100001111000011100000000011111110000011100000111000011110000000011111111000011111111111111111111 +# Gelb +00000111111100000111000000001111000011111111000000001111000011111111000011110000111100000000111111100000111000001110000011100000000011111110000011100000111000000000111111100000000111111111111111 +# Blau +0000011111110000011100000000011100000111111100000000111100001111111100001110000011100000000011111110000011100001111000011110000000011111110000011100000111000000000111000001111111000011111111111111111111 +00001111111100001111000000001111000011111111000000001110000011111110000011100000111000000000111111100000111000001110000011100000000011111110000111100000000111111110000111100000000111111111111111 diff --git a/IR-Data/Siemens-Gigaset-M740AV.txt b/IR-Data/Siemens-Gigaset-M740AV.txt new file mode 100644 index 0000000..ad92d91 --- /dev/null +++ b/IR-Data/Siemens-Gigaset-M740AV.txt @@ -0,0 +1,59 @@ +# Power +00011111100011100000011100011111100000011100011111000011000011000000111110000110000110000110000110001110000001111110000001110001111110001111111111111 +# 1 +000011111000011000000111000111111000000111000111111000111000111000000111110000110000110000110000110000110000110000110001110000001111110001111111111111 +#2 +000011111000011000000111000111111000000110000111110000110000110000001111110001110001110001100001100001100001100001100000011111100000011111111111 +# 3 +00011111100011100000011100011111100000011100011111100011000011000000111110000110000110000110000110000110001110001110000001110001111110001111111111111 +# 4 +00011111100011100000011100011111100000011100011111000011000011000000111110000110000110000110000110001110001110000001111110001110000001111111111111111 +# 5 +000011111000011000000110000111110000001110001111110001110001110000001111110001110001110001100001100001100001100000011111000000111110000111111111111 +# 6 +0001111110001110000001100001111100000011000011111000111000111000000111110000110000110000110000110001110001110000001110001111100000011111111111 +# 7 +0000111110000110000001100001111100000011100011111100011100011100000011111100011100011000011000011000011000011000000110000110000111110000111111111111 +# 8 +0000111110000110000001100001111100000011100011111100011100011100000011111100011100011000011000011000011000000111110000110000110000001111111111 +# 9 +00011111100011100000011100011111000000110000111110000110001110000001111110001100001100001100001100001100000011111100011100000011111000011111111111111 +# 0 +000011111000011000000110000111110000001100001111100001100011100000011111100011100011100011100011100011100000011111000000111110000001111111111 +# HELP +00011111100011100000011100011111000000110000111110001110001110000001111110001100001100001100001100000011111100011100000011100011111000011111111111111 +# Hoch +0000111110001110000001110001111100000011000011111000011000111000000111111000110000110000110000110000001111100000011100011111100000011111111111 +# Links +00001111100011100000011100011111100000011000011111000011000011000000111111000111000110000110000110000110000001100011111100011100000011111111111 +# OK +0000111110000110000001100001111100000011100011111100011100011100000011111100011100011000011000011000011000000110000110000111110000001111111111 +# Rechts +00001111100011100000011100011111100000011100011111100011000011000000111110000110000110000110000110000110000001110001110001110001111110001111111111111 +# Runter +000011111100011100000011100011111100000011000011111000011000011000000111110000110000110001110001110000001111110001110001110001110000001111111111 +# EXIT +0000111111000111000000111000111110000001100001111100001100001100000011111000011000011000111000111000111000000111000111111000000111111000111111111111 +# Mute +00011111100011100000011100011111100000011100011111000011000011000000111110000110000110000110000110000001111110000001110001110001111110001111111111111 +# Menu +00011111100011100000011100011111100000011100011111000011000011000000111110000110000110000110000110000001110001111110001110000001111110001111111111111 +# EPG +00001111100001100000011000011111000000110001111110001110001110000001111110001110001110001100001100000011000011111000000110000111110000111111111111 +# INFO +0000111110000110000001100001111100000011000011111000011000111000000111111000111000111000111000111000000111000110000111110000110000001111111111 +# REW +0000111111000111000000111000111110000001100001111100001100001100000011111000011000011000111000111000000111000111000111111000000111110000111111111111 +# STOP +0000111110000110000001100001111100000011100011111100011000011000000111110000110001110001110001110000001100001100001100001111100000011111111111 +# FF +00001111100001100000011100011111100000011100011111100011100011100000011111000011000011000011000011000000110000110000110001110001111110001111111111111 +# Rot +0000111110000110000001100001111100000011100011111100011100011100000011111100011100011000011000000111110000110000110000110000110000001111111111 +# Gruen +00001111100001100000011100011111100000011000011111000011000011000000111111000111000111000110000001111100001100001100011100000011111100011111111111111 +# Gelb +0000111110000110000001110001111110000001110001111110001110001110000001111100001100001100001100000011111000011000011000000111110000001111111111 +# Blau +000011111000011000000110000111110000001110001111110001100001100000011111000011000111000111000000111110000110000110000001100001111100011111111111111 +0001111110001110000001110001111110000001100001111100001100001100000011111000011000011000011000000111110001110000001111110001110000001111111111 diff --git a/IR-Data/test-suite.sh b/IR-Data/test-suite.sh index f4b192a..461c688 100644 --- a/IR-Data/test-suite.sh +++ b/IR-Data/test-suite.sh @@ -8,7 +8,7 @@ # # Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de # -# $Id: test-suite.sh,v 1.6 2010/05/25 14:44:41 fm Exp $ +# $Id: test-suite.sh,v 1.7 2010/05/28 08:26:13 fm Exp $ #---------------------------------------------------------------------------- for j in \ @@ -23,6 +23,7 @@ for j in \ RC5-Taste.txt \ Samsung_DVD_Rec_00062C.txt \ Samsung_TV.txt \ + Siemens-Gigaset-M740AV.txt \ Sony-RM-S-310.txt \ sony-rm-s311.txt \ Sony-RM-U305C.txt \ diff --git a/irmp.c b/irmp.c index 74aa156..01421c9 100644 --- a/irmp.c +++ b/irmp.c @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.c,v 1.31 2010/05/26 08:34:30 fm Exp $ + * $Id: irmp.c,v 1.33 2010/06/02 13:18:03 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -25,6 +25,7 @@ * PANASONIC - Panasonic (older, yet not implemented) * GRUNDIG - Grundig * NOKIA - Nokia + * SIEMENS - Siemens, e.g. Gigaset M740AV * *--------------------------------------------------------------------------------------------------------------------------------------------------- * @@ -492,12 +493,17 @@ typedef unsigned int16 uint16_t; #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) -#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1) -#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) -#define GRUNDIG_OR_NOKIA_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1) -#define GRUNDIG_OR_NOKIA_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) -#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1) -#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1) +#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1) +#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) +#define GRUNDIG_OR_NOKIA_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1) +#define GRUNDIG_OR_NOKIA_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) +#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1) +#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1) + +#define SIEMENS_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1) +#define SIEMENS_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1) +#define SIEMENS_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1) +#define SIEMENS_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1) #define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t! @@ -987,6 +993,30 @@ static PROGMEM IRMP_PARAMETER grundig_param = #endif +#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + +static PROGMEM IRMP_PARAMETER siemens_param = +{ + IRMP_SIEMENS_PROTOCOL, // protocol: ir protocol + SIEMENS_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1 + SIEMENS_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1 + SIEMENS_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1 + SIEMENS_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1 + 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0 + 1, // pulse_0_len_max: maximum length of pulse with bit value 0 + 1, // pause_0_len_min: minimum length of pause with bit value 0 + 1, // pause_0_len_max: maximum length of pause with bit value 0 + SIEMENS_ADDRESS_OFFSET, // address_offset: address offset + SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN, // address_end: end of address + SIEMENS_COMMAND_OFFSET, // command_offset: command offset + SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN, // command_end: end of command + SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame + SIEMENS_STOP_BIT, // stop_bit: flag: frame has stop bit + SIEMENS_LSB // lsb_first: flag: LSB first +}; + +#endif + static uint8_t irmp_bit; // current bit position static IRMP_PARAMETER irmp_param; @@ -1157,10 +1187,11 @@ irmp_ISR (void) #if IRMP_SUPPORT_RC5_PROTOCOL == 1 static uint8_t rc5_cmd_bit6; // bit 6 of RC5 command is the inverted 2nd start bit #endif -#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_RC6_PROTOCOL == 1 +#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_RC6_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 static uint8_t last_pause; // last pause value #endif -#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_RC6_PROTOCOL == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 || IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 +#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_RC6_PROTOCOL == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 || \ + IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 static uint8_t last_value; // last bit value #endif uint8_t irmp_input; // input value @@ -1218,7 +1249,7 @@ irmp_ISR (void) if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout? { // yes... - DEBUG_PRINTF ("error 1: pause after start bit %d too long: %d\n", irmp_pulse_time, irmp_pause_time); + DEBUG_PRINTF ("error 1: pause after start bit pulse %d too long: %d\n", irmp_pulse_time, irmp_pause_time); irmp_start_bit_detected = 0; // reset flags, let's wait for another start bit irmp_pulse_time = 0; irmp_pause_time = 0; @@ -1426,6 +1457,22 @@ irmp_ISR (void) else #endif // IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 +#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + if (((irmp_pulse_time >= SIEMENS_START_BIT_LEN_MIN && irmp_pulse_time <= SIEMENS_START_BIT_LEN_MAX) || + (irmp_pulse_time >= 2 * SIEMENS_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * SIEMENS_START_BIT_LEN_MAX)) && + ((irmp_pause_time >= SIEMENS_START_BIT_LEN_MIN && irmp_pause_time <= SIEMENS_START_BIT_LEN_MAX) || + (irmp_pause_time >= 2 * SIEMENS_START_BIT_LEN_MIN && irmp_pause_time <= 2 * SIEMENS_START_BIT_LEN_MAX))) + { // it's SIEMENS + DEBUG_PRINTF ("protocol = SIEMENS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n", + SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX, + SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX); + irmp_param_p = (IRMP_PARAMETER *) &siemens_param; + last_pause = irmp_pause_time; + last_value = 1; + } + else +#endif // IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + { DEBUG_PRINTF ("protocol = UNKNOWN\n"); irmp_start_bit_detected = 0; // wait for another start bit... @@ -1505,6 +1552,27 @@ irmp_ISR (void) else #endif // IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 +#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + if (irmp_param.protocol == IRMP_SIEMENS_PROTOCOL) + { + if (irmp_pause_time > SIEMENS_START_BIT_LEN_MAX && irmp_pause_time <= 2 * SIEMENS_START_BIT_LEN_MAX) + { + DEBUG_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time); + DEBUG_PUTCHAR ('0'); + DEBUG_PUTCHAR ('\n'); + irmp_store_bit (0); + } + else if (! last_value) + { + DEBUG_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time); + DEBUG_PUTCHAR ('1'); + DEBUG_PUTCHAR ('\n'); + irmp_store_bit (1); + } + } + else +#endif // IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + #if IRMP_SUPPORT_DENON_PROTOCOL == 1 if (irmp_param.protocol == IRMP_DENON_PROTOCOL) { @@ -1544,7 +1612,8 @@ irmp_ISR (void) if (irmp_param.protocol != IRMP_RC5_PROTOCOL && irmp_param.protocol != IRMP_RC6_PROTOCOL && irmp_param.protocol != IRMP_GRUNDIG_PROTOCOL && - irmp_param.protocol != IRMP_NOKIA_PROTOCOL) + irmp_param.protocol != IRMP_NOKIA_PROTOCOL && + irmp_param.protocol != IRMP_SIEMENS_PROTOCOL) { DEBUG_PRINTF ("stop bit detected\n"); } @@ -1631,6 +1700,15 @@ irmp_ISR (void) irmp_param.stop_bit = TRUE; // set flag } else +#endif +#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + if (irmp_param.protocol == IRMP_SIEMENS_PROTOCOL && + irmp_pause_time > 2 * SIEMENS_BIT_LEN_MAX && irmp_bit >= SIEMENS_COMPLETE_DATA_LEN - 2 && !irmp_param.stop_bit) + { // special rc5 decoder + got_light = TRUE; // this is a lie, but generates a stop bit ;-) + irmp_param.stop_bit = TRUE; // set flag + } + else #endif if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout? { // yes... @@ -1798,6 +1876,44 @@ irmp_ISR (void) else #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1 +#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 + if (irmp_param.protocol == IRMP_SIEMENS_PROTOCOL) // special siemens decoder + { + if (irmp_pulse_time > SIEMENS_BIT_LEN_MAX && irmp_pulse_time <= 2 * SIEMENS_BIT_LEN_MAX) + { + DEBUG_PUTCHAR ('0'); + irmp_store_bit (0); + DEBUG_PUTCHAR ('1'); + DEBUG_PUTCHAR ('\n'); + irmp_store_bit (1); + last_value = 1; + } + + else // if (irmp_pulse_time >= SIEMENS_BIT_LEN_MIN && irmp_pulse_time <= SIEMENS_BIT_LEN_MAX) + { + uint8_t siemens_value; + + if (last_pause > SIEMENS_BIT_LEN_MAX && last_pause <= 2 * SIEMENS_BIT_LEN_MAX) + { + siemens_value = last_value ? 0 : 1; + last_value = siemens_value; + } + else + { + siemens_value = last_value; + } + + DEBUG_PUTCHAR (siemens_value + '0'); + DEBUG_PUTCHAR ('\n'); + irmp_store_bit (siemens_value); + } + + last_pause = irmp_pause_time; + wait_for_space = 0; + } + else +#endif + #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit == 16) // Samsung: 16th bit { @@ -2146,6 +2262,8 @@ print_timings (void) BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX); printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d\n", GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN, GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX); + printf ("SIEMENS 1 %3d - %3d %3d - %3d\n", + SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX, SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX); } int diff --git a/irmp.exe b/irmp.exe index 66afcf9d52b6ecb934874c86179c48a2d22f96a0..58062aaf74daf3e4b72f7a7428fb19afd299da0d 100644 GIT binary patch delta 10274 zcmc&aeS8yDwv#lWp=~+^5-8A=QUVkxn9NsZCX=K>`I0LAkV+L1T+9v;v0EF;ThSS5 z3;jSr2UvEO)k0BO7qKo_(M7hkY@vdR=u>v}sk?sA04nY((t^!9cP5h-gtx!_>xJK) zJLleW&pluF+%u=hEe3hNVbl5S*0MnbSnT&HW;7%l24h$*3{2Jr7t_j6!?c90f54O( zhVh2?l;wtTMs|?$m?7J6N_o-XVfG@-G-zm*Nn52qvoLJQw2Ea*E0xAX%Ei?Y173RwaPgO|B8&$c?Wn_FKKa8tkNiCf6YXa#-gofY4^hilBt9VDcM% zZ9o}8>dfMf2CD*qMqo3%#R*820QD0;j4SgL6YPm@@42mzVZ zK26E?MmxeT7Hv27>)O(%VwH8sK7@@`ddW7jtJ93=7&^`OYTYlQ(Pp_hM z4u|8dC-7F4q2fX@7qR(4_2Cqa8>~~EfDSDK(;>ArZGi`?@`BgiJ{*pKZ!4O`Yj2hS z3O3Rz&y7~ZSCFGqmI5!e!C@G7;5#@ILGMw#dL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7vCOgBQR!Ik@b7iBJ8pvyFwO-|zjLeeJ=pblS32zVGp?6iyIrST*Ik5>AaY=T z(~Xmj3yd!s_Zi=ZT|8&}hw+jzWV~j)X}n|XF~*tFO{~djT4-8ksx*nFfT`Z}N7LJ; zL#Fplr%a!lzBFAn^}x0cpaxPysZ44DWuz>As)Q<~R#2-c_*WnGOR9nTEp;95Xe>Q| zCTSg=Nsp!{&?b5c{TMwL(u{|$q3h`_^eglZdN=(B{T6+YK0<#;pNb@$EA(whIvOU4 z(J>>K@sN0|%;T`r^O;4=bIe+%l{wCIzy@DrI+=USoPlfx%dn5L3)pRtcn-1ev;Sag zxy{^8?l5US)5vsoW&a$nBp}^1cd^@aq2tz33@q diff --git a/irmp.h b/irmp.h index 03430a2..91283aa 100644 --- a/irmp.h +++ b/irmp.h @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.h,v 1.18 2010/05/26 08:34:30 fm Exp $ + * $Id: irmp.h,v 1.23 2010/06/02 13:18:03 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -26,220 +26,245 @@ extern "C" * 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 -#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_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 +#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 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_FRAME_REPETITION_TIME 25.0e-3 // repetition 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_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 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_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_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 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 1450.0e-6 // 1450 usec pause -#define SAMSUNG_0_PAUSE_TIME 450.0e-6 // 450 usec pause -#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_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 1450.0e-6 // 1450 usec pause +#define SAMSUNG_0_PAUSE_TIME 450.0e-6 // 450 usec pause +#define SAMSUNG_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#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 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 2 // SAMSUNG32 sends each frame 2 times -#define SAMSUNG32_FRAME_REPETITION_TIME 47.0e-3 // repetition after 47 ms +#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 2 // SAMSUNG32 sends each frame 2 times +#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 40ms -#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_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_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 45.0e-3 // frame repeat after 45ms +#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 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_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_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_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#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 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_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle) -#define RECS80_ADDRESS_LEN 3 // read 3 address bits -#define RECS80_COMMAND_OFFSET 5 // skip 5 bits (2nd start + 1 toggle + 3 address) -#define RECS80_COMMAND_LEN 6 // read 6 command bits -#define RECS80_COMPLETE_DATA_LEN 11 // complete length -#define RECS80_STOP_BIT 1 // has stop bit -#define RECS80_LSB 0 // MSB...LSB +#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 2 // skip 2 bits (2nd start + 1 toggle) +#define RECS80_ADDRESS_LEN 3 // read 3 address bits +#define RECS80_COMMAND_OFFSET 5 // skip 5 bits (2nd start + 1 toggle + 3 address) +#define RECS80_COMMAND_LEN 6 // read 6 command bits +#define RECS80_COMPLETE_DATA_LEN 11 // complete length +#define RECS80_STOP_BIT 1 // has stop bit +#define RECS80_LSB 0 // MSB...LSB -#define RC5_BIT_TIME 889.0e-6 // 889 usec pulse/pause -#define RC5_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle) -#define RC5_ADDRESS_LEN 5 // read 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_BIT_TIME 889.0e-6 // 889 usec pulse/pause +#define RC5_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define RC5_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle) +#define RC5_ADDRESS_LEN 5 // read 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 DENON_PULSE_TIME 275.0e-6 // 275 usec pulse -#define DENON_1_PAUSE_TIME 1900.0e-6 // 1900 usec pause -#define DENON_0_PAUSE_TIME 1050.0e-6 // 1050 usec pause -#define DENON_FRAMES 2 // DENON sends each frame 2 times -#define DENON_FRAME_REPETITION_TIME 65.0e-3 // inverted repetition after 65ms -#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_PULSE_TIME 275.0e-6 // 275 usec pulse +#define DENON_1_PAUSE_TIME 1900.0e-6 // 1900 usec pause +#define DENON_0_PAUSE_TIME 1050.0e-6 // 1050 usec pause +#define DENON_FRAMES 2 // DENON sends each frame 2 times +#define DENON_AUTO_REPETITION_PAUSE_TIME 65.0e-3 // inverted repetition after 65ms +#define DENON_FRAME_REPEAT_PAUSE_TIME 65.0e-3 // frame repeat after 65ms +#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 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 // 889 usec pulse/pause -#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_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 // 889 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 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_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle) -#define RECS80EXT_ADDRESS_LEN 4 // read 3 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_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 3 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 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_FRAME_REPETITION_TIME 35.0e-3 // repetition after 35ms -#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_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 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_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_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 GRUNDIG_OR_NOKIA_BIT_TIME 528.0e-6 // 528 usec pulse/pause -#define GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME 2639.0e-6 // 2639 usec pause after pre bit -#define GRUNDIG_OR_NOKIA_STOP_BIT 0 // has no stop bit -#define GRUNDIG_OR_NOKIA_LSB 1 // MSB...LSB +#define GRUNDIG_OR_NOKIA_BIT_TIME 528.0e-6 // 528 usec pulse/pause +#define GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME 2639.0e-6 // 2639 usec pause after pre bit +#define GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_TIME 117.76e-3 // info frame repeat after 117.76 ms +#define GRUNDIG_OR_NOKIA_STOP_BIT 0 // has no stop bit +#define GRUNDIG_OR_NOKIA_LSB 1 // MSB...LSB -#define GRUNDIG_FRAMES 2 // GRUNDIG sends each frame 1+1 times -#define GRUNDIG_FRAME_REPETITION_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 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_FRAME_REPETITION_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 +#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 -#define AUTO_FRAME_REPETITION_TIME 50.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 25-50ms +#define SIEMENS_BIT_TIME 250.0e-6 // 250 usec pulse/pause +#define SIEMENS_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms +#define SIEMENS_ADDRESS_OFFSET 2 // skip 2 start bits +#define SIEMENS_ADDRESS_LEN 12 // read 12 address bits +#define SIEMENS_COMMAND_OFFSET 15 // skip 15 bits (2 start bits + 12 address bits + 1 inverted bit) +#define SIEMENS_COMMAND_LEN 7 // read 7 command bits +#define SIEMENS_COMPLETE_DATA_LEN 23 // complete length +#define SIEMENS_STOP_BIT 0 // has no stop bit +#define SIEMENS_LSB 0 // MSB...LSB + +#define AUTO_FRAME_REPETITION_TIME 50.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 25-50ms #define TRUE 1 #define FALSE 0 @@ -248,10 +273,10 @@ extern "C" typedef struct { - uint8_t protocol; // protocol, i.e. NEC_PROTOCOL - uint16_t address; // address - uint16_t command; // command - uint8_t flags; // flags, e.g. repetition + uint8_t protocol; // protocol, i.e. NEC_PROTOCOL + uint16_t address; // address + uint16_t command; // command + uint8_t flags; // flags, e.g. repetition } IRMP_DATA; diff --git a/irmpconfig.h b/irmpconfig.h index a22ebf2..9954398 100644 --- a/irmpconfig.h +++ b/irmpconfig.h @@ -3,7 +3,7 @@ * * Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de * - * $Id: irmpconfig.h,v 1.6 2010/05/25 14:45:39 fm Exp $ + * $Id: irmpconfig.h,v 1.8 2010/05/28 11:23:19 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -44,6 +44,7 @@ #define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL 1 // flag: support Bang & Olufsen uses ~200 bytes #define IRMP_SUPPORT_GRUNDIG_PROTOCOL 1 // flag: support Grundig uses ~150 bytes #define IRMP_SUPPORT_NOKIA_PROTOCOL 1 // flag: support Nokia uses ~150 bytes +#define IRMP_SUPPORT_SIEMENS_PROTOCOL 1 // flag: support Siemens Gigaset uses ~150 bytes /*--------------------------------------------------------------------------------------------------------------------------------------------------- * Change hardware pin here: diff --git a/irsnd.c b/irsnd.c index 86cc94f..6856da8 100644 --- a/irsnd.c +++ b/irsnd.c @@ -3,7 +3,7 @@ * * Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de * - * $Id: irsnd.c,v 1.12 2010/05/26 08:34:30 fm Exp $ + * $Id: irsnd.c,v 1.15 2010/06/02 13:18:03 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 @@ -56,52 +56,63 @@ typedef unsigned short uint16_t; #define SIRCS_1_PULSE_LEN (uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME + 0.5) #define SIRCS_0_PULSE_LEN (uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME + 0.5) #define SIRCS_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME + 0.5) -#define SIRCS_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * SIRCS_FRAME_REPETITION_TIME + 0.5) // use uint16_t! +#define SIRCS_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SIRCS_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t! +#define SIRCS_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SIRCS_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define NEC_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME + 0.5) #define NEC_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME + 0.5) +#define NEC_REPEAT_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME + 0.5) #define NEC_PULSE_LEN (uint8_t)(F_INTERRUPTS * NEC_PULSE_TIME + 0.5) #define NEC_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME + 0.5) #define NEC_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME + 0.5) +#define NEC_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define SAMSUNG_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME + 0.5) #define SAMSUNG_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME + 0.5) #define SAMSUNG_PULSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME + 0.5) #define SAMSUNG_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME + 0.5) #define SAMSUNG_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME + 0.5) +#define SAMSUNG_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SAMSUNG_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! -#define SAMSUNG32_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * SAMSUNG32_FRAME_REPETITION_TIME + 0.5) // use uint16_t! +#define SAMSUNG32_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SAMSUNG32_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t! +#define SAMSUNG32_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SAMSUNG32_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define MATSUSHITA_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME + 0.5) #define MATSUSHITA_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME + 0.5) #define MATSUSHITA_PULSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME + 0.5) #define MATSUSHITA_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME + 0.5) #define MATSUSHITA_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME + 0.5) +#define MATSUSHITA_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * MATSUSHITA_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define RECS80_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME + 0.5) #define RECS80_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME + 0.5) #define RECS80_PULSE_LEN (uint8_t)(F_INTERRUPTS * RECS80_PULSE_TIME + 0.5) #define RECS80_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME + 0.5) #define RECS80_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME + 0.5) +#define RECS80_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * RECS80_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define RC5_START_BIT_LEN (uint8_t)(F_INTERRUPTS * RC5_BIT_TIME + 0.5) #define RC5_BIT_LEN (uint8_t)(F_INTERRUPTS * RC5_BIT_TIME + 0.5) +#define RC5_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * RC5_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define RC6_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME + 0.5) #define RC6_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME + 0.5) #define RC6_TOGGLE_BIT_LEN (uint8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME + 0.5) #define RC6_BIT_LEN (uint8_t)(F_INTERRUPTS * RC6_BIT_TIME + 0.5) +#define RC6_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * RC6_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define DENON_PULSE_LEN (uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME + 0.5) #define DENON_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME + 0.5) #define DENON_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME + 0.5) -#define DENON_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * DENON_FRAME_REPETITION_TIME + 0.5) // use uint16_t! +#define DENON_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t! +#define DENON_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * DENON_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define RECS80EXT_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME + 0.5) #define RECS80EXT_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME + 0.5) #define RECS80EXT_PULSE_LEN (uint8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME + 0.5) #define RECS80EXT_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME + 0.5) #define RECS80EXT_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME + 0.5) +#define RECS80EXT_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * RECS80EXT_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define NUBERT_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME + 0.5) #define NUBERT_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME + 0.5) @@ -109,7 +120,8 @@ typedef unsigned short uint16_t; #define NUBERT_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME + 0.5) #define NUBERT_0_PULSE_LEN (uint8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME + 0.5) #define NUBERT_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME + 0.5) -#define NUBERT_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * NUBERT_FRAME_REPETITION_TIME + 0.5) // use uint16_t! +#define NUBERT_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * NUBERT_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t! +#define NUBERT_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * NUBERT_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define BANG_OLUFSEN_START_BIT1_PULSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME + 0.5) #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME + 0.5) @@ -122,11 +134,17 @@ typedef unsigned short uint16_t; #define BANG_OLUFSEN_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME + 0.5) #define BANG_OLUFSEN_R_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME + 0.5) #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME + 0.5) +#define BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * BANG_OLUFSEN_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME + 0.5) #define GRUNDIG_OR_NOKIA_BIT_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME + 0.5) -#define GRUNDIG_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_FRAME_REPETITION_TIME + 0.5) // use uint16_t! -#define NOKIA_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * NOKIA_FRAME_REPETITION_TIME + 0.5) // use uint16_t! +#define GRUNDIG_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t! +#define NOKIA_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * NOKIA_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t! +#define GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! + +#define SIEMENS_START_BIT_LEN (uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME + 0.5) +#define SIEMENS_BIT_LEN (uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME + 0.5) +#define SIEMENS_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SIEMENS_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t! #define IRSND_FREQ_32_KHZ (uint8_t) ((F_CPU / 32000 / 2) - 1) #define IRSND_FREQ_36_KHZ (uint8_t) ((F_CPU / 36000 / 2) - 1) @@ -138,6 +156,7 @@ typedef unsigned short uint16_t; static volatile uint8_t irsnd_busy; static volatile uint8_t irsnd_protocol; static volatile uint8_t irsnd_buffer[6]; +static volatile uint8_t irsnd_repeat; static volatile uint8_t irsnd_is_on = FALSE; /*--------------------------------------------------------------------------------------------------------------------------------------------------- @@ -270,6 +289,7 @@ irsnd_send_data (IRMP_DATA * irmp_data_p) } irsnd_protocol = irmp_data_p->protocol; + irsnd_repeat = irmp_data_p->flags; switch (irsnd_protocol) { @@ -446,6 +466,16 @@ irsnd_send_data (IRMP_DATA * irmp_data_p) break; } #endif +#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 + case IRMP_SIEMENS_PROTOCOL: + { + irsnd_buffer[0] = ((irmp_data_p->address & 0x0FFF) >> 5); // SAAAAAAA + irsnd_buffer[1] = ((irmp_data_p->address & 0x1F) << 3) | ((irmp_data_p->command & 0x7F) >> 5); // AAAAA0CC + irsnd_buffer[2] = (irmp_data_p->command << 3); // CCCCC0 + irsnd_busy = TRUE; + break; + } +#endif default: { break; @@ -475,10 +505,14 @@ irsnd_ISR (void) static uint8_t has_stop_bit; static uint8_t new_frame = TRUE; static uint8_t complete_data_len; - static uint8_t n_frames; // number of repetitions - static uint8_t frame_counter; // repetition counter - static uint16_t repetition_pause_len; // pause before repetition, uint16_t! - static uint16_t repetition_pause_counter; // pause before repetition, uint16_t! + static uint8_t n_auto_repetitions; // number of auto_repetitions + static uint8_t auto_repetition_counter; // auto_repetition counter + static uint16_t auto_repetition_pause_len; // pause before auto_repetition, uint16_t! + static uint16_t auto_repetition_pause_counter; // pause before auto_repetition, uint16_t! + static uint8_t n_repeat_frames; // number of repeat frames + static uint8_t repeat_counter; // repeat counter + static uint16_t repeat_frame_pause_len; // pause before repeat, uint16_t! + static uint16_t packet_repeat_pause_counter; // pause before repeat, uint16_t! #if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 static uint8_t last_bit_value; #endif @@ -489,32 +523,32 @@ irsnd_ISR (void) { if (current_bit == 0xFF && new_frame) // start of transmission... { - if (frame_counter > 0) + if (auto_repetition_counter > 0) { - repetition_pause_counter++; + auto_repetition_pause_counter++; - if (repetition_pause_counter >= repetition_pause_len) + if (auto_repetition_pause_counter >= auto_repetition_pause_len) { - repetition_pause_counter = 0; + auto_repetition_pause_counter = 0; if (irsnd_protocol == IRMP_DENON_PROTOCOL) { current_bit = 16; complete_data_len = 2 * DENON_COMPLETE_DATA_LEN + 1; } - else if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL) + else if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL) // n'th grundig info frame { current_bit = 15; complete_data_len = 16 + GRUNDIG_COMPLETE_DATA_LEN; } - else if (irsnd_protocol == IRMP_NOKIA_PROTOCOL) + else if (irsnd_protocol == IRMP_NOKIA_PROTOCOL) // n'th nokia info frame { - if (frame_counter == 1) + if (auto_repetition_counter + 1 < n_auto_repetitions) { current_bit = 23; complete_data_len = 24 + NOKIA_COMPLETE_DATA_LEN; } - else // if (frame_counter == 2) + else // nokia stop frame { current_bit = 0xFF; complete_data_len = NOKIA_COMPLETE_DATA_LEN; @@ -536,26 +570,45 @@ irsnd_ISR (void) return irsnd_busy; } } + else if (repeat_counter > 0 && packet_repeat_pause_counter < repeat_frame_pause_len) + { + packet_repeat_pause_counter++; + +#ifdef DEBUG + if (irsnd_is_on) + { + putchar ('0'); + } + else + { + putchar ('1'); + } +#endif + return irsnd_busy; + } else { - pulse_counter = 0; - pause_counter = 0; + n_repeat_frames = irsnd_repeat; + packet_repeat_pause_counter = 0; + pulse_counter = 0; + pause_counter = 0; switch (irsnd_protocol) { #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 case IRMP_SIRCS_PROTOCOL: { - startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN; - startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN; - pulse_1_len = SIRCS_1_PULSE_LEN; - pause_1_len = SIRCS_PAUSE_LEN; - pulse_0_len = SIRCS_0_PULSE_LEN; - pause_0_len = SIRCS_PAUSE_LEN; - has_stop_bit = SIRCS_STOP_BIT; - complete_data_len = SIRCS_MINIMUM_DATA_LEN; - n_frames = SIRCS_FRAMES; // 3 frames - repetition_pause_len = SIRCS_FRAME_REPETITION_LEN; // 25ms pause + startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN; + startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN; + pulse_1_len = SIRCS_1_PULSE_LEN; + pause_1_len = SIRCS_PAUSE_LEN; + pulse_0_len = SIRCS_0_PULSE_LEN; + pause_0_len = SIRCS_PAUSE_LEN; + has_stop_bit = SIRCS_STOP_BIT; + complete_data_len = SIRCS_MINIMUM_DATA_LEN; + n_auto_repetitions = (repeat_counter == 0) ? SIRCS_FRAMES : 1; // 3 frames auto repetition if first frame + auto_repetition_pause_len = SIRCS_AUTO_REPETITION_PAUSE_LEN; // 25ms pause + repeat_frame_pause_len = SIRCS_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_40_KHZ); break; } @@ -563,16 +616,27 @@ irsnd_ISR (void) #if IRSND_SUPPORT_NEC_PROTOCOL == 1 case IRMP_NEC_PROTOCOL: { - startbit_pulse_len = NEC_START_BIT_PULSE_LEN; - startbit_pause_len = NEC_START_BIT_PAUSE_LEN; - pulse_1_len = NEC_PULSE_LEN; - pause_1_len = NEC_1_PAUSE_LEN; - pulse_0_len = NEC_PULSE_LEN; - pause_0_len = NEC_0_PAUSE_LEN; - has_stop_bit = NEC_STOP_BIT; - complete_data_len = NEC_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; + startbit_pulse_len = NEC_START_BIT_PULSE_LEN; + + if (repeat_counter > 0) + { + startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN; + complete_data_len = 0; + } + else + { + startbit_pause_len = NEC_START_BIT_PAUSE_LEN; + complete_data_len = NEC_COMPLETE_DATA_LEN; + } + + pulse_1_len = NEC_PULSE_LEN; + pause_1_len = NEC_1_PAUSE_LEN; + pulse_0_len = NEC_PULSE_LEN; + pause_0_len = NEC_0_PAUSE_LEN; + has_stop_bit = NEC_STOP_BIT; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = NEC_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } @@ -580,32 +644,34 @@ irsnd_ISR (void) #if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 case IRMP_SAMSUNG_PROTOCOL: { - startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; - startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; - pulse_1_len = SAMSUNG_PULSE_LEN; - pause_1_len = SAMSUNG_1_PAUSE_LEN; - pulse_0_len = SAMSUNG_PULSE_LEN; - pause_0_len = SAMSUNG_0_PAUSE_LEN; - has_stop_bit = SAMSUNG_STOP_BIT; - complete_data_len = SAMSUNG_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; + startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; + startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; + pulse_1_len = SAMSUNG_PULSE_LEN; + pause_1_len = SAMSUNG_1_PAUSE_LEN; + pulse_0_len = SAMSUNG_PULSE_LEN; + pause_0_len = SAMSUNG_0_PAUSE_LEN; + has_stop_bit = SAMSUNG_STOP_BIT; + complete_data_len = SAMSUNG_COMPLETE_DATA_LEN; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = SAMSUNG_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } case IRMP_SAMSUNG32_PROTOCOL: { - startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; - startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; - pulse_1_len = SAMSUNG_PULSE_LEN; - pause_1_len = SAMSUNG_1_PAUSE_LEN; - pulse_0_len = SAMSUNG_PULSE_LEN; - pause_0_len = SAMSUNG_0_PAUSE_LEN; - has_stop_bit = SAMSUNG_STOP_BIT; - complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN; - n_frames = SAMSUNG32_FRAMES; // 2 frames - repetition_pause_len = SAMSUNG32_FRAME_REPETITION_LEN; // 47 ms pause + startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; + startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; + pulse_1_len = SAMSUNG_PULSE_LEN; + pause_1_len = SAMSUNG_1_PAUSE_LEN; + pulse_0_len = SAMSUNG_PULSE_LEN; + pause_0_len = SAMSUNG_0_PAUSE_LEN; + has_stop_bit = SAMSUNG_STOP_BIT; + complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN; + n_auto_repetitions = SAMSUNG32_FRAMES; // 2 frames + auto_repetition_pause_len = SAMSUNG32_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause + repeat_frame_pause_len = SAMSUNG32_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } @@ -613,16 +679,17 @@ irsnd_ISR (void) #if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 case IRMP_MATSUSHITA_PROTOCOL: { - startbit_pulse_len = MATSUSHITA_START_BIT_PULSE_LEN; - startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN; - pulse_1_len = MATSUSHITA_PULSE_LEN; - pause_1_len = MATSUSHITA_1_PAUSE_LEN; - pulse_0_len = MATSUSHITA_PULSE_LEN; - pause_0_len = MATSUSHITA_0_PAUSE_LEN; - has_stop_bit = MATSUSHITA_STOP_BIT; - complete_data_len = MATSUSHITA_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; + startbit_pulse_len = MATSUSHITA_START_BIT_PULSE_LEN; + startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN; + pulse_1_len = MATSUSHITA_PULSE_LEN; + pause_1_len = MATSUSHITA_1_PAUSE_LEN; + pulse_0_len = MATSUSHITA_PULSE_LEN; + pause_0_len = MATSUSHITA_0_PAUSE_LEN; + has_stop_bit = MATSUSHITA_STOP_BIT; + complete_data_len = MATSUSHITA_COMPLETE_DATA_LEN; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = MATSUSHITA_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_36_KHZ); break; } @@ -630,16 +697,17 @@ irsnd_ISR (void) #if IRSND_SUPPORT_RECS80_PROTOCOL == 1 case IRMP_RECS80_PROTOCOL: { - startbit_pulse_len = RECS80_START_BIT_PULSE_LEN; - startbit_pause_len = RECS80_START_BIT_PAUSE_LEN; - pulse_1_len = RECS80_PULSE_LEN; - pause_1_len = RECS80_1_PAUSE_LEN; - pulse_0_len = RECS80_PULSE_LEN; - pause_0_len = RECS80_0_PAUSE_LEN; - has_stop_bit = RECS80_STOP_BIT; - complete_data_len = RECS80_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; + startbit_pulse_len = RECS80_START_BIT_PULSE_LEN; + startbit_pause_len = RECS80_START_BIT_PAUSE_LEN; + pulse_1_len = RECS80_PULSE_LEN; + pause_1_len = RECS80_1_PAUSE_LEN; + pulse_0_len = RECS80_PULSE_LEN; + pause_0_len = RECS80_0_PAUSE_LEN; + has_stop_bit = RECS80_STOP_BIT; + complete_data_len = RECS80_COMPLETE_DATA_LEN; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = RECS80_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } @@ -647,16 +715,17 @@ irsnd_ISR (void) #if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 case IRMP_RECS80EXT_PROTOCOL: { - startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN; - startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN; - pulse_1_len = RECS80EXT_PULSE_LEN; - pause_1_len = RECS80EXT_1_PAUSE_LEN; - pulse_0_len = RECS80EXT_PULSE_LEN; - pause_0_len = RECS80EXT_0_PAUSE_LEN; - has_stop_bit = RECS80EXT_STOP_BIT; - complete_data_len = RECS80EXT_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; + startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN; + startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN; + pulse_1_len = RECS80EXT_PULSE_LEN; + pause_1_len = RECS80EXT_1_PAUSE_LEN; + pulse_0_len = RECS80EXT_PULSE_LEN; + pause_0_len = RECS80EXT_0_PAUSE_LEN; + has_stop_bit = RECS80EXT_STOP_BIT; + complete_data_len = RECS80EXT_COMPLETE_DATA_LEN; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = RECS80EXT_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } @@ -664,16 +733,15 @@ irsnd_ISR (void) #if IRSND_SUPPORT_RC5_PROTOCOL == 1 case IRMP_RC5_PROTOCOL: { - startbit_pulse_len = RC5_BIT_LEN; - startbit_pause_len = RC5_BIT_LEN; - pulse_1_len = RC5_BIT_LEN; - pause_1_len = RC5_BIT_LEN; - pulse_0_len = RC5_BIT_LEN; - pause_0_len = RC5_BIT_LEN; - has_stop_bit = RC5_STOP_BIT; - complete_data_len = RC5_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; + startbit_pulse_len = RC5_BIT_LEN; + startbit_pause_len = RC5_BIT_LEN; + pulse_len = RC5_BIT_LEN; + pause_len = RC5_BIT_LEN; + has_stop_bit = RC5_STOP_BIT; + complete_data_len = RC5_COMPLETE_DATA_LEN; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = RC5_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_36_KHZ); break; } @@ -681,16 +749,17 @@ irsnd_ISR (void) #if IRSND_SUPPORT_DENON_PROTOCOL == 1 case IRMP_DENON_PROTOCOL: { - startbit_pulse_len = 0x00; - startbit_pause_len = 0x00; - pulse_1_len = DENON_PULSE_LEN; - pause_1_len = DENON_1_PAUSE_LEN; - pulse_0_len = DENON_PULSE_LEN; - pause_0_len = DENON_0_PAUSE_LEN; - has_stop_bit = DENON_STOP_BIT; - complete_data_len = DENON_COMPLETE_DATA_LEN; - n_frames = DENON_FRAMES; // 2 frames, 2nd with inverted command - repetition_pause_len = DENON_FRAME_REPETITION_LEN; // 65 ms pause after 1st frame + startbit_pulse_len = 0x00; + startbit_pause_len = 0x00; + pulse_1_len = DENON_PULSE_LEN; + pause_1_len = DENON_1_PAUSE_LEN; + pulse_0_len = DENON_PULSE_LEN; + pause_0_len = DENON_0_PAUSE_LEN; + has_stop_bit = DENON_STOP_BIT; + complete_data_len = DENON_COMPLETE_DATA_LEN; + n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command + auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame + repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_32_KHZ); break; } @@ -698,16 +767,17 @@ irsnd_ISR (void) #if IRSND_SUPPORT_NUBERT_PROTOCOL == 1 case IRMP_NUBERT_PROTOCOL: { - startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN; - startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN; - pulse_1_len = NUBERT_1_PULSE_LEN; - pause_1_len = NUBERT_1_PAUSE_LEN; - pulse_0_len = NUBERT_0_PULSE_LEN; - pause_0_len = NUBERT_0_PAUSE_LEN; - has_stop_bit = NUBERT_STOP_BIT; - complete_data_len = NUBERT_COMPLETE_DATA_LEN; - n_frames = NUBERT_FRAMES; // 2 frames - repetition_pause_len = NUBERT_FRAME_REPETITION_LEN; // 35 ms pause + startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN; + startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN; + pulse_1_len = NUBERT_1_PULSE_LEN; + pause_1_len = NUBERT_1_PAUSE_LEN; + pulse_0_len = NUBERT_0_PULSE_LEN; + pause_0_len = NUBERT_0_PAUSE_LEN; + has_stop_bit = NUBERT_STOP_BIT; + complete_data_len = NUBERT_COMPLETE_DATA_LEN; + n_auto_repetitions = NUBERT_FRAMES; // 2 frames + auto_repetition_pause_len = NUBERT_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause + repeat_frame_pause_len = NUBERT_FRAME_REPEAT_PAUSE_LEN; irsnd_set_freq (IRSND_FREQ_36_KHZ); break; } @@ -715,17 +785,18 @@ irsnd_ISR (void) #if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 case IRMP_BANG_OLUFSEN_PROTOCOL: { - startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN; - startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN; - pulse_1_len = BANG_OLUFSEN_PULSE_LEN; - pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN; - pulse_0_len = BANG_OLUFSEN_PULSE_LEN; - pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN; - has_stop_bit = BANG_OLUFSEN_STOP_BIT; - complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN; - n_frames = 1; // 1 frame - repetition_pause_len = 0; - last_bit_value = 0; + startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN; + startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN; + pulse_1_len = BANG_OLUFSEN_PULSE_LEN; + pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN; + pulse_0_len = BANG_OLUFSEN_PULSE_LEN; + pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN; + has_stop_bit = BANG_OLUFSEN_STOP_BIT; + complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN; + last_bit_value = 0; irsnd_set_freq (IRSND_FREQ_455_KHZ); break; } @@ -733,36 +804,51 @@ irsnd_ISR (void) #if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 case IRMP_GRUNDIG_PROTOCOL: { - startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; - startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; - pulse_1_len = GRUNDIG_OR_NOKIA_BIT_LEN; - pause_1_len = GRUNDIG_OR_NOKIA_BIT_LEN; - pulse_0_len = GRUNDIG_OR_NOKIA_BIT_LEN; - pause_0_len = GRUNDIG_OR_NOKIA_BIT_LEN; - has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; - complete_data_len = GRUNDIG_COMPLETE_DATA_LEN; - n_frames = GRUNDIG_FRAMES; // 2 frames - repetition_pause_len = GRUNDIG_FRAME_REPETITION_LEN; // 20msec pause + startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; + startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; + pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; + pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; + has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; + complete_data_len = GRUNDIG_COMPLETE_DATA_LEN; + n_auto_repetitions = GRUNDIG_FRAMES; // 2 frames + auto_repetition_pause_len = GRUNDIG_AUTO_REPETITION_PAUSE_LEN; // 20m sec pause + repeat_frame_pause_len = GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause irsnd_set_freq (IRSND_FREQ_38_KHZ); + break; } #endif #if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 case IRMP_NOKIA_PROTOCOL: { - startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; - startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; - pulse_1_len = GRUNDIG_OR_NOKIA_BIT_LEN; - pause_1_len = GRUNDIG_OR_NOKIA_BIT_LEN; - pulse_0_len = GRUNDIG_OR_NOKIA_BIT_LEN; - pause_0_len = GRUNDIG_OR_NOKIA_BIT_LEN; - has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; - complete_data_len = NOKIA_COMPLETE_DATA_LEN; - n_frames = NOKIA_FRAMES; // 2 frames - repetition_pause_len = NOKIA_FRAME_REPETITION_LEN; // 20msec pause + startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; + startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; + pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; + pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; + has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; + complete_data_len = NOKIA_COMPLETE_DATA_LEN; + n_auto_repetitions = NOKIA_FRAMES; // 2 frames + auto_repetition_pause_len = NOKIA_AUTO_REPETITION_PAUSE_LEN; // 20 msec pause + repeat_frame_pause_len = GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause irsnd_set_freq (IRSND_FREQ_38_KHZ); break; } +#endif +#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 + case IRMP_SIEMENS_PROTOCOL: + { + startbit_pulse_len = SIEMENS_BIT_LEN; + startbit_pause_len = SIEMENS_BIT_LEN; + pulse_len = SIEMENS_BIT_LEN; + pause_len = SIEMENS_BIT_LEN; + has_stop_bit = SIEMENS_STOP_BIT; + complete_data_len = SIEMENS_COMPLETE_DATA_LEN - 1; + n_auto_repetitions = 1; // 1 frame + auto_repetition_pause_len = 0; + repeat_frame_pause_len = SIEMENS_FRAME_REPEAT_PAUSE_LEN; + irsnd_set_freq (IRSND_FREQ_36_KHZ); + break; + } #endif default: { @@ -776,6 +862,7 @@ irsnd_ISR (void) if (irsnd_busy) { new_frame = FALSE; + switch (irsnd_protocol) { #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 @@ -806,6 +893,11 @@ irsnd_ISR (void) #if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 case IRMP_BANG_OLUFSEN_PROTOCOL: #endif + + +#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 || IRSND_SUPPORT_NEC_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 || \ + IRSND_SUPPORT_RECS80_PROTOCOL == 1 || IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 || IRSND_SUPPORT_DENON_PROTOCOL == 1 || IRSND_SUPPORT_NUBERT_PROTOCOL == 1 || \ + IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 { if (pulse_counter == 0) { @@ -898,7 +990,7 @@ irsnd_ISR (void) { pulse_len = pulse_0_len; - if (frame_counter < n_frames) + if (auto_repetition_counter < n_auto_repetitions) { pause_len = pause_0_len; } @@ -932,12 +1024,12 @@ irsnd_ISR (void) if (current_bit >= complete_data_len + has_stop_bit) { current_bit = 0xFF; - frame_counter++; + auto_repetition_counter++; - if (frame_counter == n_frames) + if (auto_repetition_counter == n_auto_repetitions) { irsnd_busy = FALSE; - frame_counter = 0; + auto_repetition_counter = 0; } new_frame = TRUE; } @@ -947,76 +1039,58 @@ irsnd_ISR (void) } break; } +#endif + #if IRSND_SUPPORT_RC5_PROTOCOL == 1 case IRMP_RC5_PROTOCOL: - { - uint8_t first_pulse; - uint8_t next_bit = FALSE; +#endif +#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 + case IRMP_SIEMENS_PROTOCOL: +#endif +#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 + case IRMP_GRUNDIG_PROTOCOL: +#endif +#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 + case IRMP_NOKIA_PROTOCOL: +#endif - if (current_bit == 0xFF) // 1 start bit - { - first_pulse = FALSE; - } - else // send n'th bit +#if IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 + { + if (pulse_counter == pulse_len && pause_counter == pause_len) { - first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? FALSE : TRUE; - } + current_bit++; - if (first_pulse) - { - if (pulse_counter < RC5_BIT_LEN) - { - if (pulse_counter == 0) - { - irsnd_on (); - } - pulse_counter++; - } - else if (pause_counter < RC5_BIT_LEN) - { - if (pause_counter == 0) - { - irsnd_off (); - } - pause_counter++; - } - else + if (current_bit >= complete_data_len) { - next_bit = TRUE; - } - } - else - { - if (pause_counter < RC5_BIT_LEN) - { - if (pause_counter == 0) + current_bit = 0xFF; + +#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 + if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL || irsnd_protocol == IRMP_NOKIA_PROTOCOL) { - irsnd_off (); + auto_repetition_counter++; + + if (repeat_counter > 0) + { // set 117 msec pause time + auto_repetition_pause_len = GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN; + } + + if (repeat_counter < n_repeat_frames) // tricky: repeat n info frames per auto repetition before sending last stop frame + { + n_auto_repetitions++; // increment number of auto repetitions + repeat_counter++; + } + else if (auto_repetition_counter == n_auto_repetitions) + { + irsnd_busy = FALSE; + auto_repetition_counter = 0; + } } - pause_counter++; - } - else if (pulse_counter < RC5_BIT_LEN) - { - if (pulse_counter == 0) + else +#endif { - irsnd_on (); + irsnd_busy = FALSE; } - pulse_counter++; - } - else - { - next_bit = TRUE; - } - } - if (next_bit) - { - current_bit++; - - if (current_bit >= RC5_COMPLETE_DATA_LEN) - { - current_bit = 0xFF; - irsnd_busy = FALSE; new_frame = TRUE; irsnd_off (); } @@ -1024,58 +1098,50 @@ irsnd_ISR (void) pulse_counter = 0; pause_counter = 0; } - break; - } -#endif // IRSND_SUPPORT_RC5_PROTOCOL - -#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 - case IRMP_GRUNDIG_PROTOCOL: - case IRMP_NOKIA_PROTOCOL: - { - uint8_t next_bit = FALSE; - if (current_bit == 0xFF || // start bit of 1st frame - (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL && current_bit == 15) || // start bit of 2nd frame (Grundig) - (irsnd_protocol == IRMP_NOKIA_PROTOCOL && (current_bit == 23 || current_bit == 47))) // start bit of 2nd/3rd frame (Nokia) + if (! new_frame) { - if (pulse_counter == 0) - { - pulse_len = startbit_pulse_len; - pause_len = startbit_pause_len; - } + uint8_t first_pulse; - if (pulse_counter < pulse_len) +#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 + if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL || irsnd_protocol == IRMP_NOKIA_PROTOCOL) { - if (pulse_counter == 0) + if (current_bit == 0xFF || // start bit of start-frame + (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL && current_bit == 15) || // start bit of info-frame (Grundig) + (irsnd_protocol == IRMP_NOKIA_PROTOCOL && (current_bit == 23 || current_bit == 47))) // start bit of info- or stop-frame (Nokia) { - irsnd_on (); + pulse_len = startbit_pulse_len; + pause_len = startbit_pause_len; + first_pulse = TRUE; } - pulse_counter++; - } - else if (pause_counter < pause_len) - { - if (pause_counter == 0) + else // send n'th bit { - irsnd_off (); + pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; + pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; + first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; } - pause_counter++; } - else + else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_SIEMENS_PROTOCOL) +#endif { - current_bit++; - pulse_counter = 0; - pause_counter = 0; - } - } - else // send n'th bit - { - uint8_t first_pulse; + if (current_bit == 0xFF) // 1 start bit + { + first_pulse = TRUE; + } + else // send n'th bit + { + first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; + } - first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; + if (irsnd_protocol == IRMP_RC5_PROTOCOL) + { + first_pulse = first_pulse ? FALSE : TRUE; + } + } if (first_pulse) { - if (pulse_counter < GRUNDIG_OR_NOKIA_BIT_LEN) + if (pulse_counter < pulse_len) { if (pulse_counter == 0) { @@ -1083,7 +1149,7 @@ irsnd_ISR (void) } pulse_counter++; } - else if (pause_counter < GRUNDIG_OR_NOKIA_BIT_LEN) + else // if (pause_counter < pause_len) { if (pause_counter == 0) { @@ -1091,14 +1157,10 @@ irsnd_ISR (void) } pause_counter++; } - else - { - next_bit = TRUE; - } } else { - if (pause_counter < GRUNDIG_OR_NOKIA_BIT_LEN) + if (pause_counter < pause_len) { if (pause_counter == 0) { @@ -1106,7 +1168,7 @@ irsnd_ISR (void) } pause_counter++; } - else if (pulse_counter < GRUNDIG_OR_NOKIA_BIT_LEN) + else // if (pulse_counter < pulse_len) { if (pulse_counter == 0) { @@ -1114,38 +1176,11 @@ irsnd_ISR (void) } pulse_counter++; } - else - { - next_bit = TRUE; - } - } - - if (next_bit) - { - current_bit++; - - if (current_bit >= complete_data_len) - { - current_bit = 0xFF; - frame_counter++; - - if (frame_counter == n_frames) - { - irsnd_busy = FALSE; - frame_counter = 0; - } - - new_frame = TRUE; - irsnd_off (); - } - - pulse_counter = 0; - pause_counter = 0; } } break; } -#endif // IRSND_SUPPORT_GRUNDIG_PROTOCOL || IRSND_SUPPORT_NOKIA_PROTOCOL +#endif // IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 default: { @@ -1154,6 +1189,20 @@ irsnd_ISR (void) } } } + + if (! irsnd_busy) + { + if (repeat_counter < n_repeat_frames) + { + repeat_counter++; + irsnd_busy = TRUE; + } + else + { + n_repeat_frames = 0; + repeat_counter = 0; + } + } } #ifdef DEBUG @@ -1183,16 +1232,14 @@ int main (int argc, char ** argv) { int idx; - int cnt; int protocol; int address; int command; - int repeat = 1; IRMP_DATA irmp_data; - if (argc != 4) + if (argc != 4 && argc != 5) { - fprintf (stderr, "usage: %s protocol hex-address hex-command > filename\n", argv[0]); + fprintf (stderr, "usage: %s protocol hex-address hex-command [repeat] > filename\n", argv[0]); return 1; } @@ -1204,16 +1251,26 @@ main (int argc, char ** argv) irmp_data.address = address; irmp_data.command = command; + if (argc == 5) + { + irmp_data.flags = atoi (argv[4]); + } + else + { + irmp_data.flags = 0; + } + irsnd_init (); - for (cnt = 0; cnt < repeat; cnt++) - { - (void) irsnd_send_data (&irmp_data); + (void) irsnd_send_data (&irmp_data); - for (idx = 0; idx < 3000; idx++) - { - irsnd_ISR (); - } + while (irsnd_busy) + { + irsnd_ISR (); + } + for (idx = 0; idx < 20; idx++) + { + irsnd_ISR (); } putchar ('\n'); diff --git a/irsnd.exe b/irsnd.exe index e265b359fd60ea0f2423b6519709e9eb4c2ee4a6..0ba3dc21d2a8fa40648822703cbb26fc7815bf4d 100644 GIT binary patch delta 6739 zcmc&Zdt6l2x_b`{pfC<0BgjKQ!B9NiUQM*=lk{&3xhl39UQx96#?AHs;YDPL%r<-A!`+ncrL!xzmzkC0>o8PzA zUf=t%*0=U(^`dHbqmBNq$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%X0O3cG~;!Xe?9@Qv`Da8bA-+!R^_l^82_61#}`Vu47BqWFwBP#hwT6kid` z#Mi`GqDx#LR*B2R55=|OCb3rhQfw5@h|S`UqU$H|ff!|uH$P$SY|b}RW~=!R=3(YC zvuyszywSYPTyH*VK4HFOzHI*0OjwdFoh*Yb!!6@2Q!LXh9!rH~vE@UH-}05E$#Tka z)^gqwvRt#=vfQ;OmRLzI8Kg8RTk0+qNQ`8Wo|OhlqoopQwzN=MEUl2%OPgKNR%y3X zCk3R#(sAh<>7sO5x-R`H5!Mb?#yY?{#yZ9Nj@4_Gt*fo;t)E(VSoc~RtzTQewFa#> zt%OZud&V}*HqrK)&23w3TWwXcm>P-OW*YSt<)cGIjdJO$G?WPydi|F_1mGqzKztDf9x6@zH z_4Gmd7=4C5Pya;UrhlbXOaha_WHC=OBy?1N=0#>GGlg+YXLd1vX9CO-<}~vibCZc> zli8=Beg42!vhT6A><;!MJBxdVdyo4YSH~UTNS@^-{$+jxznT9xpCaT4y#z*(gy)56 zf>Uq{3xq|&`@%|Ljj&$$L_oJB&OEW3+)p-=SIHaXBI6Rs4PnYQSxk17Y1`0l<*NS% DYv3m5 diff --git a/irsndconfig.h b/irsndconfig.h index f08506e..c2a8e2d 100644 --- a/irsndconfig.h +++ b/irsndconfig.h @@ -3,7 +3,7 @@ * * Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de * - * $Id: irsndconfig.h,v 1.3 2010/05/26 08:34:30 fm Exp $ + * $Id: irsndconfig.h,v 1.5 2010/06/02 13:25:22 fm Exp $ * * ATMEGA88 @ 8 MHz * @@ -27,15 +27,15 @@ #define IRSND_SUPPORT_MATSUSHITA_PROTOCOL 1 // flag: support Matsushita uses ~150 bytes #define IRSND_SUPPORT_KASEIKYO_PROTOCOL 0 // flag: support Kaseikyo NOT SUPPORTED YET! #define IRSND_SUPPORT_RECS80_PROTOCOL 1 // flag: support RECS80 uses ~100 bytes -#define IRSND_SUPPORT_RC5_PROTOCOL 1 // flag: support RC5 uses ~250 bytes +#define IRSND_SUPPORT_RC5_PROTOCOL 1 // flag: support RC5 uses ~150 bytes #define IRSND_SUPPORT_DENON_PROTOCOL 1 // flag: support DENON uses ~200 bytes #define IRSND_SUPPORT_RC6_PROTOCOL 0 // flag: support RC6 NOT SUPPORTED YET! #define IRSND_SUPPORT_RECS80EXT_PROTOCOL 1 // flag: support RECS80EXT uses ~100 bytes #define IRSND_SUPPORT_NUBERT_PROTOCOL 1 // flag: support NUBERT uses ~100 bytes #define IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL 1 // flag: support Bang&Olufsen uses ~250 bytes -#define IRSND_SUPPORT_GRUNDIG_PROTOCOL 1 // flag: support Grundig uses ~250 bytes -#define IRSND_SUPPORT_NOKIA_PROTOCOL 1 // flag: support Nokia uses ~150 bytes - +#define IRSND_SUPPORT_GRUNDIG_PROTOCOL 1 // flag: support Grundig uses ~300 bytes +#define IRSND_SUPPORT_NOKIA_PROTOCOL 1 // flag: support Nokia uses ~400 bytes +#define IRSND_SUPPORT_SIEMENS_PROTOCOL 1 // flag: support Siemens, e.g. Gigaset uses ~150 bytes /*--------------------------------------------------------------------------------------------------------------------------------------------------- * Change hardware pin here: diff --git a/irsndmain.c b/irsndmain.c index 5979030..9a25c8f 100644 --- a/irsndmain.c +++ b/irsndmain.c @@ -115,8 +115,9 @@ main (void) for (;;) { irmp_data.protocol = IRMP_NEC_PROTOCOL; - irmp_data.address = 0x00FF; - irmp_data.command = 0x0001; + irmp_data.address = 0x00FF; + irmp_data.command = 0x0001; + irmp_data.flags = 0; irsnd_send_data (&irmp_data); _delay_ms (1000); @@ -138,8 +139,9 @@ main (void) for (;;) { irmp_data.protocol = IRMP_NEC_PROTOCOL; - irmp_data.address = 0x00FF; - irmp_data.command = 0x0001; + irmp_data.address = 0x00FF; + irmp_data.command = 0x0001; + irmp_data.flags = 0; irsnd_send_data (&irmp_data); _delay_ms (1000); -- 2.39.2