]> cloudbase.mooo.com Git - irmp.git/blobdiff - irmp.h
Merge branch 'libopencm3' of cu.loc:git/irmp into libopencm3
[irmp.git] / irmp.h
diff --git a/irmp.h b/irmp.h
index 76346cefe6623e860388021fd087dd17e254e41e..c0b3c18cc1c23e22b4fac7ba49f9b203ef465169 100644 (file)
--- a/irmp.h
+++ b/irmp.h
@@ -1,9 +1,9 @@
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * irmp.h\r
  *\r
- * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmp.h,v 1.97 2015/09/19 15:28:31 fm Exp $\r
+ * $Id: irmp.h,v 1.103 2016/09/09 07:53:29 fm Exp $\r
  *\r
  * This program is free software; you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
 #    warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration.\r
 #  endif\r
 \r
+#elif defined (LIBOPENCM3)\r
+#  define _CONCAT(a,b)                          a##b\r
+#  define CONCAT(a,b)                           _CONCAT(a,b)\r
+#  define IRMP_PORT                             CONCAT(GPIO, IRMP_PORT_LETTER)\r
+#  define IRMP_PORT_RCC                         CONCAT(RCC_GPIO, IRMP_PORT_LETTER)\r
+\r
+#  define IRMP_BIT                              CONCAT(GPIO, IRMP_BIT_NUMBER)\r
+#  define IRMP_PIN                              IRMP_PORT   // for use with input(x) below\r
+#  define input(x)                              ((GPIO_IDR(x) & IRMP_BIT) != 0)\r
+\r
 #elif defined (STELLARIS_ARM_CORTEX_M4)\r
 #  define _CONCAT(a,b)                          a##b\r
 #  define CONCAT(a,b)                           _CONCAT(a,b)\r
 #  define input(x)                              ((uint8_t)(ROM_GPIOPinRead(IRMP_PORT_BASE, IRMP_PORT_PIN)))\r
 #  define sei()                                 IntMasterEnable()\r
 \r
+#elif defined(__SDCC_stm8)\r
+#  define _CONCAT(a,b)                          a##b\r
+#  define CONCAT(a,b)                           _CONCAT(a,b)\r
+#  define IRMP_GPIO_STRUCT                      CONCAT(GPIO, IRMP_PORT_LETTER)\r
+#  define IRMP_BIT                              IRMP_BIT_NUMBER\r
+#  define input(x)                              ((x) & (1 << IRMP_BIT))\r
+\r
+#elif defined (TEENSY_ARM_CORTEX_M4)\r
+#  define input(x)                              ((uint8_t)(digitalReadFast(x)))\r
+\r
+#elif defined(__xtensa__)\r
+#  define IRMP_BIT                              IRMP_BIT_NUMBER\r
+#  define input(x)                              GPIO_INPUT_GET(IRMP_BIT_NUMBER)\r
 #endif\r
 \r
 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1\r
 #  define IRMP_SUPPORT_RUWIDO_PROTOCOL          0\r
 #endif\r
 \r
+#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 && IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r
+#  warning KASEIKYO protocol conflicts wih PANASONIC, please enable only one of both protocols\r
+#  warning PANASONIC protocol disabled\r
+#  undef IRMP_SUPPORT_PANASONIC_PROTOCOL\r
+#  define IRMP_SUPPORT_PANASONIC_PROTOCOL       0\r
+#endif\r
+\r
 #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_ACP24_PROTOCOL == 1\r
 #  warning DENON protocol conflicts wih ACP24, please enable only one of both protocols\r
 #  warning ACP24 protocol disabled\r
 #  define IRMP_SUPPORT_ROOMBA_PROTOCOL          0\r
 #endif\r
 \r
+#if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1 && IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r
+#  warning PANASONIC protocol conflicts wih MITSU_HEAVY, please enable only one of both protocols\r
+#  warning MITSU_HEAVY protocol disabled\r
+#  undef IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL\r
+#  define IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL      0\r
+#endif\r
+\r
 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r
 #  warning RC5 protocol conflicts wih ORTEK, please enable only one of both protocols\r
 #  warning ORTEK protocol disabled\r
 \r
 #define IRMP_FLAG_REPETITION            0x01\r
 \r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
 extern void                             irmp_init (void);\r
 extern uint_fast8_t                     irmp_get_data (IRMP_DATA *);\r
 extern uint_fast8_t                     irmp_ISR (void);\r
@@ -222,4 +264,8 @@ extern const char * const               irmp_protocol_names[IRMP_N_PROTOCOLS + 1
 extern void                             irmp_set_callback_ptr (void (*cb)(uint_fast8_t));\r
 #endif // IRMP_USE_CALLBACK == 1\r
 \r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
 #endif /* _IRMP_H_ */\r