summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.txt4
-rw-r--r--irmp.c135
-rw-r--r--irmp.h35
-rw-r--r--irmpconfig.h4
-rw-r--r--irsnd.c67
-rw-r--r--irsnd.h13
-rw-r--r--irsndconfig.h5
7 files changed, 248 insertions, 15 deletions
diff --git a/README.txt b/README.txt
index 378fcb4..7ce68f6 100644
--- a/README.txt
+++ b/README.txt
@@ -1,8 +1,8 @@
IRMP - Infrared Multi Protocol Decoder
--------------------------------------
-Version IRMP: 2.0.0-pre3 20.04.2010
-Version IRSND: 1.9.2 11.04.2010
+Version IRMP: 2.0.0-pre4 20.05.2010
+Version IRSND: 1.9.3 20.05.2010
Dokumentation:
diff --git a/irmp.c b/irmp.c
index 1016dbc..0313571 100644
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.c,v 1.101 2011/04/20 09:09:48 fm Exp $
+ * $Id: irmp.c,v 1.103 2011/05/20 09:31:25 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -29,6 +29,7 @@
* FDC - FDC IR keyboard
* RCCAR - IR remote control for RC cars
* JVC - JVC
+ * THOMSON - Thomson
* NIKON - Nikon cameras
* RUWIDO - T-Home
* KATHREIN - Kathrein
@@ -368,6 +369,7 @@ typedef unsigned int16 uint16_t;
#endif
#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 || \
+ IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \
IRMP_SUPPORT_IMON_PROTOCOL == 1
#define IRMP_SUPPORT_SERIAL 1
#else
@@ -502,6 +504,13 @@ typedef unsigned int16 uint16_t;
#endif
#define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define THOMSON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define THOMSON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define THOMSON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define THOMSON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define THOMSON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define THOMSON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+
#define RC6_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define RC6_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
#define RC6_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
@@ -669,6 +678,15 @@ typedef unsigned int16 uint16_t;
#define LEGO_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
#define LEGO_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
+#define MERLIN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define MERLIN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define MERLIN_PULSE_LEN ((uint8_t)(F_INTERRUPTS * MERLIN_PULSE_TIME))
+#define MERLIN_PAUSE_LEN ((uint8_t)(F_INTERRUPTS * MERLIN_PAUSE_TIME))
+#define MERLIN_PULSE_REST_LEN ((uint8_t)(F_INTERRUPTS * MERLIN_PULSE_TIME / 4))
+#define MERLIN_PAUSE_REST_LEN ((uint8_t)(F_INTERRUPTS * MERLIN_PAUSE_TIME / 4))
+
#define IMON_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * IMON_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define IMON_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * IMON_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
#define IMON_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * IMON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
@@ -1430,6 +1448,56 @@ static PROGMEM IRMP_PARAMETER lego_param =
#endif
+#if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
+
+static PROGMEM IRMP_PARAMETER netbox_param =
+{
+ IRMP_MERLIN_PROTOCOL, // protocol: ir protocol
+ MERLIN_PULSE_LEN, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
+ MERLIN_PULSE_REST_LEN, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
+ MERLIN_PAUSE_LEN, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
+ MERLIN_PAUSE_REST_LEN, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
+ MERLIN_PULSE_LEN, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
+ MERLIN_PULSE_REST_LEN, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
+ MERLIN_PAUSE_LEN, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
+ MERLIN_PAUSE_REST_LEN, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
+ MERLIN_ADDRESS_OFFSET, // address_offset: address offset
+ MERLIN_ADDRESS_OFFSET + MERLIN_ADDRESS_LEN, // address_end: end of address
+ MERLIN_COMMAND_OFFSET, // command_offset: command offset
+ MERLIN_COMMAND_OFFSET + MERLIN_COMMAND_LEN, // command_end: end of command
+ MERLIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
+ MERLIN_STOP_BIT, // stop_bit: flag: frame has stop bit
+ MERLIN_LSB, // lsb_first: flag: LSB first
+ MERLIN_FLAGS // flags: some flags
+};
+
+#endif
+
+#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
+
+static PROGMEM IRMP_PARAMETER thomson_param =
+{
+ IRMP_THOMSON_PROTOCOL, // protocol: ir protocol
+ THOMSON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
+ THOMSON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
+ THOMSON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
+ THOMSON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
+ THOMSON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
+ THOMSON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
+ THOMSON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
+ THOMSON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
+ THOMSON_ADDRESS_OFFSET, // address_offset: address offset
+ THOMSON_ADDRESS_OFFSET + THOMSON_ADDRESS_LEN, // address_end: end of address
+ THOMSON_COMMAND_OFFSET, // command_offset: command offset
+ THOMSON_COMMAND_OFFSET + THOMSON_COMMAND_LEN, // command_end: end of command
+ THOMSON_COMPLETE_DATA_LEN, // complete_len: complete length of frame
+ THOMSON_STOP_BIT, // stop_bit: flag: frame has stop bit
+ THOMSON_LSB, // lsb_first: flag: LSB first
+ THOMSON_FLAGS // flags: some flags
+};
+
+#endif
+
#if IRMP_SUPPORT_IMON_PROTOCOL == 1
static PROGMEM IRMP_PARAMETER imon_param =
@@ -1573,8 +1641,8 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
rtc = TRUE; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
break;
#endif
-#if 1 // squeeze code to 8 bit, upper bit indicates release-key
-#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
+
+#if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
case IRMP_NETBOX_PROTOCOL:
if (irmp_command & 0x1000) // last bit set?
{
@@ -1601,7 +1669,6 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
}
break;
#endif
-#endif // 0
#if IRMP_SUPPORT_LEGO_PROTOCOL == 1
case IRMP_LEGO_PROTOCOL:
{
@@ -2085,6 +2152,20 @@ irmp_ISR (void)
else
#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
+#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
+ if ( (irmp_pulse_time >= THOMSON_PULSE_LEN_MIN && irmp_pulse_time <= THOMSON_PULSE_LEN_MAX) &&
+ ((irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX) ||
+ (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)))
+ { // it's THOMSON
+ ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX,
+ THOMSON_1_PAUSE_LEN_MIN, THOMSON_1_PAUSE_LEN_MAX,
+ THOMSON_0_PAUSE_LEN_MIN, THOMSON_0_PAUSE_LEN_MAX);
+ irmp_param_p = (IRMP_PARAMETER *) &thomson_param;
+ }
+ else
+#endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
+
#if IRMP_SUPPORT_RC6_PROTOCOL == 1
if (irmp_pulse_time >= RC6_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RC6_START_BIT_PULSE_LEN_MAX &&
irmp_pause_time >= RC6_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RC6_START_BIT_PAUSE_LEN_MAX)
@@ -2226,6 +2307,18 @@ irmp_ISR (void)
else
#endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
+#if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
+ if (irmp_pulse_time >= MERLIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MERLIN_START_BIT_PULSE_LEN_MAX &&
+ irmp_pause_time >= MERLIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MERLIN_START_BIT_PAUSE_LEN_MAX)
+ { // it's MERLIN
+ ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
+ MERLIN_START_BIT_PULSE_LEN_MIN, MERLIN_START_BIT_PULSE_LEN_MAX,
+ MERLIN_START_BIT_PAUSE_LEN_MIN, MERLIN_START_BIT_PAUSE_LEN_MAX);
+ irmp_param_p = (IRMP_PARAMETER *) &netbox_param;
+ }
+ else
+#endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
+
#if IRMP_SUPPORT_LEGO_PROTOCOL == 1
if (irmp_pulse_time >= LEGO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= LEGO_START_BIT_PULSE_LEN_MAX &&
irmp_pause_time >= LEGO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= LEGO_START_BIT_PAUSE_LEN_MAX)
@@ -2367,6 +2460,26 @@ irmp_ISR (void)
}
else
#endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
+#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
+ if (irmp_param.protocol == IRMP_THOMSON_PROTOCOL)
+ {
+ ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
+
+ if (irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX)
+ { // pause timings correct for "1"?
+ ANALYZE_PUTCHAR ('1'); // yes, store 1
+ ANALYZE_NEWLINE ();
+ irmp_store_bit (1);
+ }
+ else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
+ { // pause timings correct for "0"?
+ ANALYZE_PUTCHAR ('0'); // yes, store 0
+ ANALYZE_NEWLINE ();
+ irmp_store_bit (0);
+ }
+ }
+ else
+#endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
{
; // else do nothing
}
@@ -2435,6 +2548,15 @@ irmp_ISR (void)
got_light = TRUE; // this is a lie, but helps (generates stop bit)
}
else
+#if 1
+ // MERLIN generates no stop bit, here is the timeout condition:
+ if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) && irmp_param.protocol == IRMP_MERLIN_PROTOCOL &&
+ irmp_pause_time >= MERLIN_PULSE_LEN * (MERLIN_COMPLETE_DATA_LEN - irmp_bit))
+ {
+ got_light = TRUE; // this is a lie, but helps (generates stop bit)
+ }
+ else
+#endif
#endif
#if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && !irmp_param.stop_bit)
@@ -3332,6 +3454,11 @@ print_timings (void)
DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX, DENON_0_PAUSE_LEN_MIN, DENON_0_PAUSE_LEN_MAX,
DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX, DENON_1_PAUSE_LEN_MIN, DENON_1_PAUSE_LEN_MAX);
+ printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX,
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX, THOMSON_0_PAUSE_LEN_MIN, THOMSON_0_PAUSE_LEN_MAX,
+ THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX, THOMSON_1_PAUSE_LEN_MIN, THOMSON_1_PAUSE_LEN_MAX);
+
printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
RC6_START_BIT_PULSE_LEN_MIN, RC6_START_BIT_PULSE_LEN_MAX, RC6_START_BIT_PAUSE_LEN_MIN, RC6_START_BIT_PAUSE_LEN_MAX,
RC6_BIT_PULSE_LEN_MIN, RC6_BIT_PULSE_LEN_MAX, RC6_BIT_PAUSE_LEN_MIN, RC6_BIT_PAUSE_LEN_MAX);
diff --git a/irmp.h b/irmp.h
index cac734f..ed43178 100644
--- a/irmp.h
+++ b/irmp.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.h,v 1.60 2011/04/11 12:54:24 fm Exp $
+ * $Id: irmp.h,v 1.62 2011/05/20 09:31:25 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -77,6 +77,8 @@ typedef uint8_t PAUSE_LEN;
#define IRMP_NEC16_PROTOCOL 27 // NEC with 16 bits (incl. sync)
#define IRMP_NEC42_PROTOCOL 28 // NEC with 42 bits
#define IRMP_LEGO_PROTOCOL 29 // LEGO Power Functions RC
+#define IRMP_THOMSON_PROTOCOL 30 // Thomson
+#define IRMP_MERLIN_PROTOCOL 31 // Pollin Merlin keyboard (bitserial)
#define IRMP_IMON_PROTOCOL 99 // Imon (bitserial) PROTOTYPE!
// some flags of struct IRMP_PARAMETER:
@@ -447,6 +449,22 @@ typedef uint8_t PAUSE_LEN;
#define NETBOX_LSB 1 // LSB
#define NETBOX_FLAGS IRMP_PARAM_FLAG_IS_SERIAL // flags
+#define MERLIN_START_BIT_PULSE_TIME 340.0e-6 // 340 usec pulse
+#define MERLIN_START_BIT_PAUSE_TIME 300.0e-6 // 300 usec pause
+#define MERLIN_PULSE_TIME 380.0e-6 // 380 usec pulse
+#define MERLIN_PAUSE_TIME 310.0e-6 // 310 usec pause
+#define MERLIN_FRAMES 1 // Merlin sends 1 frame
+#define MERLIN_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms
+#define MERLIN_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 35ms
+#define MERLIN_ADDRESS_OFFSET 0 // skip 0 bits
+#define MERLIN_ADDRESS_LEN 9 // read 16 address bits
+#define MERLIN_COMMAND_OFFSET 9 // skip 16 bits
+#define MERLIN_COMMAND_LEN 16 // read 9 bits
+#define MERLIN_COMPLETE_DATA_LEN 25 // complete length
+#define MERLIN_STOP_BIT 0 // has no stop bit
+#define MERLIN_LSB 1 // LSB
+#define MERLIN_FLAGS IRMP_PARAM_FLAG_IS_SERIAL // flags
+
#define LEGO_START_BIT_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz)
#define LEGO_START_BIT_PAUSE_TIME 1026.0e-6 // 1026 usec pause (39 x 1/38kHz)
#define LEGO_PULSE_TIME 158.0e-6 // 158 usec pulse ( 6 x 1/38kHz)
@@ -462,6 +480,21 @@ typedef uint8_t PAUSE_LEN;
#define LEGO_LSB 0 // MSB...LSB
#define LEGO_FLAGS 0 // flags
+#define THOMSON_PULSE_TIME 550.0e-6 // 550 usec pulse
+#define THOMSON_1_PAUSE_TIME 4500.0e-6 // 4500 usec pause
+#define THOMSON_0_PAUSE_TIME 2000.0e-6 // 2000 usec pause
+#define THOMSON_FRAMES 1 // THOMSON sends 1 frame
+#define THOMSON_AUTO_REPETITION_PAUSE_TIME 65.0e-3 // repetition after 65ms
+#define THOMSON_FRAME_REPEAT_PAUSE_TIME 65.0e-3 // frame repeat after 65ms
+#define THOMSON_ADDRESS_OFFSET 0 // skip 0 bits
+#define THOMSON_ADDRESS_LEN 4 // read 4 address bits
+#define THOMSON_COMMAND_OFFSET 5 // skip 4 address bits + 1 toggle bit
+#define THOMSON_COMMAND_LEN 7 // read 7 command bits
+#define THOMSON_COMPLETE_DATA_LEN 12 // complete length
+#define THOMSON_STOP_BIT 1 // has stop bit
+#define THOMSON_LSB 0 // MSB...LSB
+#define THOMSON_FLAGS 0 // flags
+
#define IMON_START_BIT_PULSE_TIME 1333.0e-6 // 1333 usec pulse
#define IMON_START_BIT_PAUSE_TIME 1172.0e-6 // 1333 usec pause
#define IMON_PULSE_TIME 500.0e-6 // 500 usec pulse
diff --git a/irmpconfig.h b/irmpconfig.h
index 43a423f..49502a6 100644
--- a/irmpconfig.h
+++ b/irmpconfig.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmpconfig.h,v 1.66 2011/04/20 09:09:48 fm Exp $
+ * $Id: irmpconfig.h,v 1.69 2011/05/20 09:31:25 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -67,8 +67,10 @@
#define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL 0 // Bang & Olufsen >= 10000 ~200 bytes
#define IRMP_SUPPORT_RECS80_PROTOCOL 0 // RECS80 (SAA3004) >= 15000 ~50 bytes
#define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0 // RECS80EXT (SAA3008) >= 15000 ~50 bytes
+#define IRMP_SUPPORT_THOMSON_PROTOCOL 1 // Thomson >= 10000 ~250 bytes
#define IRMP_SUPPORT_NIKON_PROTOCOL 0 // NIKON camera >= 10000 ~250 bytes
#define IRMP_SUPPORT_NETBOX_PROTOCOL 0 // Netbox keyboard >= 10000 ~400 bytes (PROTOTYPE!)
+#define IRMP_SUPPORT_MERLIN_PROTOCOL 1 // Merlin keyboard >= 10000 ~400 bytes (PROTOTYPE!)
#define IRMP_SUPPORT_IMON_PROTOCOL 0 // IMON keyboard >= 10000 ~400 bytes (PROTOTYPE!)
#define IRMP_SUPPORT_FDC_PROTOCOL 0 // FDC3402 keyboard >= 10000 (better 15000) ~150 bytes (~400 in combination with RC5)
#define IRMP_SUPPORT_RCCAR_PROTOCOL 0 // RC Car >= 10000 (better 15000) ~150 bytes (~500 in combination with RC5)
diff --git a/irsnd.c b/irsnd.c
index fb7e449..214c93d 100644
--- a/irsnd.c
+++ b/irsnd.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irsnd.c,v 1.36 2011/04/20 09:09:48 fm Exp $
+ * $Id: irsnd.c,v 1.37 2011/05/20 09:31:25 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
@@ -195,6 +195,12 @@ typedef uint8_t IRSND_PAUSE_LEN;
#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 THOMSON_PULSE_LEN (uint8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME + 0.5)
+#define THOMSON_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME + 0.5)
+#define THOMSON_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME + 0.5)
+#define THOMSON_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * THOMSON_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t!
+#define THOMSON_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * THOMSON_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)
@@ -445,6 +451,9 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1
static uint8_t toggle_bit_rc6;
#endif
+#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1
+ static uint8_t toggle_bit_thomson;
+#endif
uint16_t address;
uint16_t command;
@@ -461,7 +470,7 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
}
irsnd_protocol = irmp_data_p->protocol;
- irsnd_repeat = irmp_data_p->flags;
+ irsnd_repeat = irmp_data_p->flags & IRSND_REPETITION_MASK;
switch (irsnd_protocol)
{
@@ -673,6 +682,17 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
break;
}
#endif
+#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1
+ case IRMP_THOMSON_PROTOCOL:
+ {
+ toggle_bit_thomson = toggle_bit_thomson ? 0x00 : 0x08;
+
+ irsnd_buffer[0] = ((irmp_data_p->address & 0x0F) << 4) | toggle_bit_thomson | ((irmp_data_p->command & 0x0070) >> 4); // AAAATCCC (1st frame)
+ irsnd_buffer[1] = (irmp_data_p->command & 0x0F) << 4; // CCCC
+ irsnd_busy = TRUE;
+ break;
+ }
+#endif
#if IRSND_SUPPORT_NUBERT_PROTOCOL == 1
case IRMP_NUBERT_PROTOCOL:
{
@@ -805,6 +825,14 @@ irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)
return irsnd_busy;
}
+static volatile uint8_t n_repeat_frames; // number of repetition frames
+
+void
+irsnd_stop (void)
+{
+ n_repeat_frames = 0;
+}
+
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* ISR routine
* @details ISR routine, called 10000 times per second
@@ -829,7 +857,6 @@ irsnd_ISR (void)
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!
@@ -890,7 +917,11 @@ irsnd_ISR (void)
return irsnd_busy;
}
}
+#if 0
else if (repeat_counter > 0 && packet_repeat_pause_counter < repeat_frame_pause_len)
+#else
+ else if (packet_repeat_pause_counter < repeat_frame_pause_len)
+#endif
{
packet_repeat_pause_counter++;
@@ -909,6 +940,12 @@ irsnd_ISR (void)
else
{
n_repeat_frames = irsnd_repeat;
+
+ if (n_repeat_frames == IRSND_ENDLESS_REPETITION)
+ {
+ n_repeat_frames = 255;
+ }
+
packet_repeat_pause_counter = 0;
pulse_counter = 0;
pause_counter = 0;
@@ -1134,6 +1171,24 @@ irsnd_ISR (void)
break;
}
#endif
+#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1
+ case IRMP_THOMSON_PROTOCOL:
+ {
+ startbit_pulse_len = 0x00;
+ startbit_pause_len = 0x00;
+ pulse_1_len = THOMSON_PULSE_LEN;
+ pause_1_len = THOMSON_1_PAUSE_LEN - 1;
+ pulse_0_len = THOMSON_PULSE_LEN;
+ pause_0_len = THOMSON_0_PAUSE_LEN - 1;
+ has_stop_bit = THOMSON_STOP_BIT;
+ complete_data_len = THOMSON_COMPLETE_DATA_LEN;
+ n_auto_repetitions = THOMSON_FRAMES; // only 1 frame
+ auto_repetition_pause_len = THOMSON_AUTO_REPETITION_PAUSE_LEN;
+ repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN;
+ irsnd_set_freq (IRSND_FREQ_38_KHZ);
+ break;
+ }
+#endif
#if IRSND_SUPPORT_NUBERT_PROTOCOL == 1
case IRMP_NUBERT_PROTOCOL:
{
@@ -1357,6 +1412,9 @@ irsnd_ISR (void)
#if IRSND_SUPPORT_DENON_PROTOCOL == 1
case IRMP_DENON_PROTOCOL:
#endif
+#if IRSND_SUPPORT_THOMSON_PROTOCOL == 1
+ case IRMP_THOMSON_PROTOCOL:
+#endif
#if IRSND_SUPPORT_NUBERT_PROTOCOL == 1
case IRMP_NUBERT_PROTOCOL:
#endif
@@ -1383,7 +1441,7 @@ irsnd_ISR (void)
#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 || IRSND_SUPPORT_NEC_PROTOCOL == 1 || IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 || IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 || \
IRSND_SUPPORT_KASEIKYO_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 || IRSND_SUPPORT_FDC_PROTOCOL == 1 || IRSND_SUPPORT_RCCAR_PROTOCOL == 1 || \
- IRSND_SUPPORT_JVC_PROTOCOL == 1 || IRSND_SUPPORT_NIKON_PROTOCOL == 1 || IRSND_SUPPORT_LEGO_PROTOCOL == 1
+ IRSND_SUPPORT_JVC_PROTOCOL == 1 || IRSND_SUPPORT_NIKON_PROTOCOL == 1 || IRSND_SUPPORT_LEGO_PROTOCOL == 1 || IRSND_SUPPORT_THOMSON_PROTOCOL == 1
{
if (pulse_counter == 0)
{
@@ -1804,6 +1862,7 @@ main (int argc, char ** argv)
{
irsnd_ISR ();
}
+
for (idx = 0; idx < 20; idx++)
{
irsnd_ISR ();
diff --git a/irsnd.h b/irsnd.h
index a71b397..f8ece78 100644
--- a/irsnd.h
+++ b/irsnd.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irsnd.h,v 1.4 2011/04/11 12:54:25 fm Exp $
+ * $Id: irsnd.h,v 1.5 2011/05/20 09:31:25 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -17,6 +17,11 @@
#ifndef _WC_IRSND_H_
#define _WC_IRSND_H_
+#define IRSND_NO_REPETITIONS 0 // no repetitions
+#define IRSND_MAX_REPETITIONS 14 // max # of repetitions
+#define IRSND_ENDLESS_REPETITION 15 // endless repetions
+#define IRSND_REPETITION_MASK 0x0F // lower nibble of flags
+
/**
* Initialize ISND encoder
* @details Configures ISDN output pin
@@ -39,6 +44,12 @@ extern uint8_t irsnd_is_busy (void);
extern uint8_t irsnd_send_data (IRMP_DATA *, uint8_t);
/**
+ * Stop sending IRMP data
+ * @details stops sending IRMP data
+ */
+extern void irsnd_stop (void);
+
+/**
* ISR routine
* @details ISR routine, called 10000 times per second
*/
diff --git a/irsndconfig.h b/irsndconfig.h
index 9f40101..d3575ec 100644
--- a/irsndconfig.h
+++ b/irsndconfig.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2010-2011 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irsndconfig.h,v 1.20 2011/04/11 13:28:12 fm Exp $
+ * $Id: irsndconfig.h,v 1.22 2011/05/20 09:31:25 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -39,7 +39,7 @@
#define IRSND_SUPPORT_DENON_PROTOCOL 1 // DENON, Sharp >= 10000 ~200 bytes
// more protocols, enable here! Enable Remarks F_INTERRUPTS Program Space
-#define IRSND_SUPPORT_RC5_PROTOCOL 0 // RC5 >= 10000 ~150 bytes
+#define IRSND_SUPPORT_RC5_PROTOCOL 1 // RC5 >= 10000 ~150 bytes
#define IRSND_SUPPORT_RC6_PROTOCOL 0 // RC6 >= 10000 ~250 bytes
#define IRSND_SUPPORT_RC6A_PROTOCOL 0 // RC6A >= 10000 ~250 bytes
#define IRSND_SUPPORT_JVC_PROTOCOL 0 // JVC >= 10000 ~150 bytes
@@ -56,6 +56,7 @@
#define IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL 0 // Bang&Olufsen >= 10000 ~250 bytes
#define IRSND_SUPPORT_RECS80_PROTOCOL 0 // RECS80 >= 20000 ~100 bytes
#define IRSND_SUPPORT_RECS80EXT_PROTOCOL 0 // RECS80EXT >= 20000 ~100 bytes
+#define IRSND_SUPPORT_THOMSON_PROTOCOL 1 // Thomson >= 10000 ~250 bytes
#define IRSND_SUPPORT_NIKON_PROTOCOL 0 // NIKON >= 10000 ~150 bytes
#define IRSND_SUPPORT_NETBOX_PROTOCOL 0 // Netbox keyboard >= 10000 DON'T CHANGE, NOT SUPPORTED YET!
#define IRSND_SUPPORT_IMON_PROTOCOL 0 // IMON keyboard >= 10000 DON'T CHANGE, NOT SUPPORTED YET!