*\r
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irmp.h,v 1.62 2011/05/20 09:31:25 fm Exp $\r
+ * $Id: irmp.h,v 1.65 2011/09/08 13:22:16 fm Exp $\r
*\r
* ATMEGA88 @ 8 MHz\r
*\r
#ifndef _WC_IRMP_H_\r
#define _WC_IRMP_H_\r
\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif\r
-\r
/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* timing constants:\r
*---------------------------------------------------------------------------------------------------------------------------------------------------\r
#define IRMP_LEGO_PROTOCOL 29 // LEGO Power Functions RC\r
#define IRMP_THOMSON_PROTOCOL 30 // Thomson\r
#define IRMP_MERLIN_PROTOCOL 31 // Pollin Merlin keyboard (bitserial)\r
+\r
+#define IRMP_N_PROTOCOLS 31 // number of supported protocols\r
+\r
#define IRMP_IMON_PROTOCOL 99 // Imon (bitserial) PROTOTYPE!\r
\r
// some flags of struct IRMP_PARAMETER:\r
#define RC5_BIT_TIME 889.0e-6 // 889 usec pulse/pause\r
#define RC5_FRAME_REPEAT_PAUSE_TIME 45.0e-3 // frame repeat after 45ms\r
\r
-#define RC5_ADDRESS_OFFSET 2 // skip 2 bits (2nd start + 1 toggle)\r
-#define RC5_ADDRESS_LEN 5 // read 5 address bits\r
+#define RC5_ADDRESS_OFFSET 1 // skip 1 bit (2nd start)\r
+#define RC5_ADDRESS_LEN 6 // read 1 toggle bit (for key repetition detection) + 5 address bits\r
#define RC5_COMMAND_OFFSET 7 // skip 5 bits (2nd start + 1 toggle + 5 address)\r
#define RC5_COMMAND_LEN 6 // read 6 command bits\r
#define RC5_COMPLETE_DATA_LEN 13 // complete length\r
\r
#define NIKON_START_BIT_PULSE_TIME 2200.0e-6 // 2200 usec pulse\r
#define NIKON_START_BIT_PAUSE_TIME 27100.0e-6 // 27100 usec pause\r
-#define NIKON_PULSE_TIME 500.0e-6 // 520 usec pulse\r
+#define NIKON_PULSE_TIME 500.0e-6 // 500 usec pulse\r
#define NIKON_1_PAUSE_TIME 3500.0e-6 // 3500 usec pause\r
#define NIKON_0_PAUSE_TIME 1500.0e-6 // 1500 usec pause\r
#define NIKON_FRAME_REPEAT_PAUSE_TIME 60.0e-3 // frame repeat after 60ms\r
uint8_t flags; // flags, e.g. repetition\r
} IRMP_DATA;\r
\r
+extern void irmp_init (void);\r
+extern uint8_t irmp_get_data (IRMP_DATA *);\r
+extern uint8_t irmp_is_busy (void);\r
+extern uint8_t irmp_ISR (void);\r
\r
-/**\r
- * Initialize IRMP decoder\r
- * @details Configures IRMP input pin\r
- */\r
-extern void irmp_init (void);\r
-\r
-/**\r
- * Get IRMP data\r
- * @details gets decoded IRMP data\r
- * @param pointer in order to store IRMP data\r
- * @return TRUE: successful, FALSE: failed\r
- */\r
-extern uint8_t irmp_get_data (IRMP_DATA *);\r
-\r
-/**\r
- * ISR routine\r
- * @details ISR routine, called 10000 times per second\r
- */\r
-extern uint8_t irmp_ISR (void);\r
-\r
-#ifdef __cplusplus\r
-}\r
+#if IRMP_PROTOCOL_NAMES == 1\r
+extern char * irmp_protocol_names[IRMP_N_PROTOCOLS + 1];\r
#endif\r
\r
+#if IRMP_USE_CALLBACK == 1\r
+extern void irmp_set_callback_ptr (void (*cb)(uint8_t));\r
+#endif // IRSND_USE_CALLBACK == 1\r
+\r
#endif /* _WC_IRMP_H_ */\r