]> cloudbase.mooo.com Git - irmp.git/blobdiff - irmpsystem.h
Version 2.9.5: added TECHNICS protocol
[irmp.git] / irmpsystem.h
index d4e5b134900b2b04854f89b8dc2edbe9ba7a0af4..41cd3440ce9d6afcce890c987a53498feb575580 100644 (file)
@@ -1,9 +1,9 @@
 /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
  * irmpsystem.h - system specific includes and defines\r
  *\r
- * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irmpsystem.h,v 1.11 2014/07/01 07:50:33 fm Exp $\r
+ * $Id: irmpsystem.h,v 1.18 2015/05/18 10:51:07 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
@@ -30,6 +30,7 @@
 #  include <stm32l1xx.h>\r
 #  define ARM_STM32\r
 #  define ARM_STM32L1XX\r
+#  define F_CPU (SysCtlClockGet())\r
 #elif defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) \\r
    || defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) \\r
    || defined(STM32F10X_HD) || defined(STM32F10X_HD_VL) \\r
 #  include <stm32f10x.h>\r
 #  define ARM_STM32\r
 #  define ARM_STM32F10X\r
+#  define F_CPU (SysCtlClockGet())\r
 #elif defined(STM32F4XX)                                                            // ARM STM32\r
 #  include <stm32f4xx.h>\r
 #  define ARM_STM32\r
 #  define ARM_STM32F4XX\r
-#elif defined(TARGET_IS_BLIZZARD_RA2)                                                                                           // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)\r
+#elif defined(TARGET_IS_BLIZZARD_RA2)                                               // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)\r
 #  define STELLARIS_ARM_CORTEX_M4\r
 #  define F_CPU (SysCtlClockGet())\r
 #elif defined(unix) || defined(WIN32) || defined(__APPLE__)                         // Unix/Linux or Windows or Apple\r
@@ -79,7 +81,16 @@ typedef unsigned short                  uint16_t;
 #  define IRSND_OC0                     3       // OC0\r
 #  define IRSND_OC0A                    4       // OC0A\r
 #  define IRSND_OC0B                    5       // OC0B\r
+\r
+#  define IRSND_XMEGA_OC0A              0       // OC0A\r
+#  define IRSND_XMEGA_OC0B              1       // OC0B\r
+#  define IRSND_XMEGA_OC0C              2       // OC0C\r
+#  define IRSND_XMEGA_OC0D              3       // OC0D\r
+#  define IRSND_XMEGA_OC1A              4       // OC1A\r
+#  define IRSND_XMEGA_OC1B              5       // OC1B\r
+\r
 #elif defined(STELLARIS_ARM_CORTEX_M4)\r
+\r
 #  include "inc/hw_ints.h"\r
 #  include "inc/hw_memmap.h"\r
 #  include "inc/hw_types.h"\r
@@ -92,12 +103,24 @@ typedef unsigned short                  uint16_t;
 #  include "driverlib/systick.h"\r
 #  include "driverlib/pin_map.h"\r
 #  include "driverlib/timer.h"\r
-#  define PROGMEM volatile\r
-#  define memcpy_P memcpy\r
+#  define PROGMEM\r
+#  define memcpy_P                      memcpy\r
 #  define APP_SYSTICKS_PER_SEC          32\r
+\r
+#elif defined(ARM_STM32F10X)\r
+\r
+#  include "stm32f10x_gpio.h"\r
+#  include "stm32f10x_rcc.h"\r
+#  include "stm32f10x_tim.h"\r
+#  include "misc.h"\r
+#  define PROGMEM\r
+#  define memcpy_P                      memcpy\r
+\r
 #else\r
+\r
 #  define PROGMEM\r
 #  define memcpy_P                      memcpy\r
+\r
 #endif\r
 \r
 #if defined(PIC_CCS) || defined(PIC_C18) || defined(ARM_STM32) || defined(STELLARIS_ARM_CORTEX_M4)\r
@@ -107,8 +130,10 @@ typedef unsigned short                  uint16_t;
 \r
 #if defined (PIC_C18)                                                               // PIC C18 or XC8 compiler\r
 #  include <p18cxxx.h>                                                              // main PIC18 h file\r
+#ifndef __XC8\r
 #  include <timers.h>                                                               // timer lib\r
 #  include <pwm.h>                                                                  // pwm lib\r
+#endif\r
 #  define IRSND_PIC_CCP1                1                                           // PIC C18 RC2 = PWM1 module\r
 #  define IRSND_PIC_CCP2                2                                           // PIC C18 RC1 = PWM2 module\r
 #endif\r
@@ -118,9 +143,9 @@ typedef unsigned short                  uint16_t;
 #  define FALSE                         0\r
 #endif\r
 \r
-typedef struct\r
+typedef struct __attribute__ ((__packed__))\r
 {\r
-  uint8_t                               protocol;                                   // protocol, i.e. NEC_PROTOCOL\r
+  uint8_t                               protocol;                                   // protocol, e.g. NEC_PROTOCOL\r
   uint16_t                              address;                                    // address\r
   uint16_t                              command;                                    // command\r
   uint8_t                               flags;                                      // flags, e.g. repetition\r