X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp.git/blobdiff_plain/2ac088b274ff067eae9e5e391c9b3fddb5929624..c2b70f0bf049613af736f73d9117327a5e3cf00b:/irmp.h diff --git a/irmp.h b/irmp.h index 9579250..8e906e0 100644 --- a/irmp.h +++ b/irmp.h @@ -1,11 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmp.h * - * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.h,v 1.81 2013/01/17 07:33:13 fm Exp $ - * - * ATMEGA88 @ 8 MHz + * $Id: irmp.h,v 1.95 2015/05/29 08:23:56 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 @@ -23,7 +21,19 @@ # include "irmpconfig.h" #endif -#if defined (ATMEL_AVR) +#if defined (__AVR_XMEGA__) +# define _CONCAT(a,b) a##b +# define CONCAT(a,b) _CONCAT(a,b) +# define IRMP_PORT_PRE CONCAT(PORT, IRMP_PORT_LETTER) +# define IRMP_DDR_PRE CONCAT(PORT, IRMP_PORT_LETTER) +# define IRMP_PIN_PRE CONCAT(PORT, IRMP_PORT_LETTER) +# define IRMP_PORT IRMP_PORT_PRE.OUT +# define IRMP_DDR IRMP_DDR_PRE.DIR +# define IRMP_PIN IRMP_PIN_PRE.IN +# define IRMP_BIT IRMP_BIT_NUMBER +# define input(x) ((x) & (1 << IRMP_BIT)) + +#elif defined (ATMEL_AVR) # define _CONCAT(a,b) a##b # define CONCAT(a,b) _CONCAT(a,b) # define IRMP_PORT CONCAT(PORT, IRMP_PORT_LETTER) @@ -31,10 +41,10 @@ # define IRMP_PIN CONCAT(PIN, IRMP_PORT_LETTER) # define IRMP_BIT IRMP_BIT_NUMBER # define input(x) ((x) & (1 << IRMP_BIT)) -#elif defined (PIC_C18) -# define input(x) (x) -#elif defined (PIC_CCS) + +#elif defined (PIC_C18) || defined (PIC_CCS) # define input(x) (x) + #elif defined (ARM_STM32) # define _CONCAT(a,b) a##b # define CONCAT(a,b) _CONCAT(a,b) @@ -52,6 +62,7 @@ # ifndef USE_STDPERIPH_DRIVER # warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration. # endif + #elif defined (STELLARIS_ARM_CORTEX_M4) # define _CONCAT(a,b) a##b # define CONCAT(a,b) _CONCAT(a,b) @@ -61,6 +72,7 @@ # define IRMP_PIN IRMP_PORT_PIN # define input(x) ((uint8_t)(ROM_GPIOPinRead(IRMP_PORT_BASE, IRMP_PORT_PIN))) # define sei() IntMasterEnable() + #endif #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 @@ -70,6 +82,48 @@ # define IRMP_SUPPORT_RUWIDO_PROTOCOL 0 #endif +#if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1 +# warning RC6 protocol conflicts wih ROOMBA, please enable only one of both protocols +# warning ROOMBA protocol disabled +# undef IRMP_SUPPORT_ROOMBA_PROTOCOL +# define IRMP_SUPPORT_ROOMBA_PROTOCOL 0 +#endif + +#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1 +# warning RC5 protocol conflicts wih ORTEK, please enable only one of both protocols +# warning ORTEK protocol disabled +# undef IRMP_SUPPORT_ORTEK_PROTOCOL +# define IRMP_SUPPORT_ORTEK_PROTOCOL 0 +#endif + +#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_S100_PROTOCOL == 1 +# warning RC5 protocol conflicts wih S100, please enable only one of both protocols +# warning S100 protocol disabled +# undef IRMP_SUPPORT_S100_PROTOCOL +# define IRMP_SUPPORT_S100_PROTOCOL 0 +#endif + +#if IRMP_SUPPORT_NUBERT_PROTOCOL == 1 && IRMP_SUPPORT_FAN_PROTOCOL == 1 +# warning NUBERT protocol conflicts wih FAN, please enable only one of both protocols +# warning FAN protocol disabled +# undef IRMP_SUPPORT_FAN_PROTOCOL +# define IRMP_SUPPORT_FAN_PROTOCOL 0 +#endif + +#if IRMP_SUPPORT_FDC_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1 +# warning FDC protocol conflicts wih ORTEK, please enable only one of both protocols +# warning ORTEK protocol disabled +# undef IRMP_SUPPORT_ORTEK_PROTOCOL +# define IRMP_SUPPORT_ORTEK_PROTOCOL 0 +#endif + +#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1 && IRMP_SUPPORT_NETBOX_PROTOCOL == 1 +# warning ORTEK protocol conflicts wih NETBOX, please enable only one of both protocols +# warning NETBOX protocol disabled +# undef IRMP_SUPPORT_NETBOX_PROTOCOL +# define IRMP_SUPPORT_NETBOX_PROTOCOL 0 +#endif + #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000 # warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000) # undef IRMP_SUPPORT_SIEMENS_PROTOCOL @@ -100,6 +154,12 @@ # define IRMP_SUPPORT_LEGO_PROTOCOL 0 #endif +#if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 0 +# warning SAMSUNG48 protocol needs also SAMSUNG protocol, SAMSUNG protocol enabled +# undef IRMP_SUPPORT_SAMSUNG_PROTOCOL +# define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1 +#endif + #if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 # warning JVC protocol needs also NEC protocol, NEC protocol enabled # undef IRMP_SUPPORT_NEC_PROTOCOL @@ -118,6 +178,18 @@ # define IRMP_SUPPORT_NEC_PROTOCOL 1 #endif +#if IRMP_SUPPORT_LGAIR_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0 +# warning LGAIR protocol needs also NEC protocol, NEC protocol enabled +# undef IRMP_SUPPORT_NEC_PROTOCOL +# define IRMP_SUPPORT_NEC_PROTOCOL 1 +#endif + +#if IRMP_SUPPORT_RCMM_PROTOCOL == 1 && F_INTERRUPTS < 20000 +# warning F_INTERRUPTS too low, RCMM protocol disabled (should be at least 20000) +# undef IRMP_SUPPORT_RCMM_PROTOCOL +# define IRMP_SUPPORT_RCMM_PROTOCOL 0 +#endif + #if F_INTERRUPTS > 20000 #error F_INTERRUPTS too high (should be not greater than 20000) #endif @@ -127,16 +199,15 @@ #define IRMP_FLAG_REPETITION 0x01 extern void irmp_init (void); -extern uint8_t irmp_get_data (IRMP_DATA *); -extern uint8_t irmp_is_busy (void); -extern uint8_t irmp_ISR (void); +extern uint_fast8_t irmp_get_data (IRMP_DATA *); +extern uint_fast8_t irmp_ISR (void); #if IRMP_PROTOCOL_NAMES == 1 -extern char * irmp_protocol_names[IRMP_N_PROTOCOLS + 1]; +extern const char * const irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM; #endif #if IRMP_USE_CALLBACK == 1 -extern void irmp_set_callback_ptr (void (*cb)(uint8_t)); +extern void irmp_set_callback_ptr (void (*cb)(uint_fast8_t)); #endif // IRMP_USE_CALLBACK == 1 #endif /* _IRMP_H_ */