X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp.git/blobdiff_plain/7a844aff3755d6d856326c45f8aa0f01921d3205..df24bb50ab88c97e3431d6dad6c04ed79e3794c7:/irmpsystem.h diff --git a/irmpsystem.h b/irmpsystem.h index fdd2fa3..2f02907 100644 --- a/irmpsystem.h +++ b/irmpsystem.h @@ -1,9 +1,9 @@ /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irmpsystem.h - system specific includes and defines * - * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmpsystem.h,v 1.12 2014/07/01 20:08:20 fm Exp $ + * $Id: irmpsystem.h,v 1.21 2015/11/18 08:27:50 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 @@ -30,6 +30,7 @@ # include # define ARM_STM32 # define ARM_STM32L1XX +# define F_CPU (SysCtlClockGet()) #elif defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) \ || defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) \ || defined(STM32F10X_HD) || defined(STM32F10X_HD_VL) \ @@ -37,13 +38,27 @@ # include # define ARM_STM32 # define ARM_STM32F10X +# define F_CPU (SysCtlClockGet()) #elif defined(STM32F4XX) // ARM STM32 # include # define ARM_STM32 # define ARM_STM32F4XX -#elif defined(TARGET_IS_BLIZZARD_RA2) // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio) +#elif defined(__SDCC_stm8) // STM8 +# define SDCC_STM8 +#elif defined(TARGET_IS_BLIZZARD_RA2) // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio) # define STELLARIS_ARM_CORTEX_M4 # define F_CPU (SysCtlClockGet()) +#elif defined(__xtensa__) +# include "ets_sys.h" +# include "osapi.h" +# include "gpio.h" +# include "os_type.h" +# include "c_types.h" +# define uint_fast8_t uint8_t +# define uint_fast16_t uint16_t +#elif defined(TEENSYDUINO) && (defined(__MK20DX256__) || defined(__MK20DX128__)) // Teensy 3.x (tested on Teensy 3.1 in Arduino 1.6.5 / Teensyduino 1.2.5) +# include +# define TEENSY_ARM_CORTEX_M4 #elif defined(unix) || defined(WIN32) || defined(__APPLE__) // Unix/Linux or Windows or Apple # define UNIX_OR_WINDOWS #else @@ -79,7 +94,16 @@ typedef unsigned short uint16_t; # define IRSND_OC0 3 // OC0 # define IRSND_OC0A 4 // OC0A # define IRSND_OC0B 5 // OC0B + +# define IRSND_XMEGA_OC0A 0 // OC0A +# define IRSND_XMEGA_OC0B 1 // OC0B +# define IRSND_XMEGA_OC0C 2 // OC0C +# define IRSND_XMEGA_OC0D 3 // OC0D +# define IRSND_XMEGA_OC1A 4 // OC1A +# define IRSND_XMEGA_OC1B 5 // OC1B + #elif defined(STELLARIS_ARM_CORTEX_M4) + # include "inc/hw_ints.h" # include "inc/hw_memmap.h" # include "inc/hw_types.h" @@ -92,12 +116,36 @@ typedef unsigned short uint16_t; # include "driverlib/systick.h" # include "driverlib/pin_map.h" # include "driverlib/timer.h" -# define PROGMEM volatile -# define memcpy_P memcpy +# define PROGMEM +# define memcpy_P memcpy # define APP_SYSTICKS_PER_SEC 32 + +#elif defined(ARM_STM32F10X) + +# include "stm32f10x_gpio.h" +# include "stm32f10x_rcc.h" +# include "stm32f10x_tim.h" +# include "misc.h" +# define PROGMEM +# define memcpy_P memcpy + +#elif defined(SDCC_STM8) + +# include "stm8s.h" +# define PROGMEM +# define memcpy_P memcpy +# define __attribute__(x) +# define uint_fast8_t uint8_t +# define uint_fast16_t uint16_t + +#elif defined(TEENSY_ARM_CORTEX_M4) +# define PROGMEM +# define memcpy_P memcpy + #else # define PROGMEM # define memcpy_P memcpy + #endif #if defined(PIC_CCS) || defined(PIC_C18) || defined(ARM_STM32) || defined(STELLARIS_ARM_CORTEX_M4) @@ -120,12 +168,12 @@ typedef unsigned short uint16_t; # define FALSE 0 #endif -typedef struct +typedef struct __attribute__ ((__packed__)) { - uint8_t protocol; // protocol, i.e. NEC_PROTOCOL - uint16_t address; // address - uint16_t command; // command - uint8_t flags; // flags, e.g. repetition + uint8_t protocol; // protocol, e.g. NEC_PROTOCOL + uint16_t address; // address + uint16_t command; // command + uint8_t flags; // flags, e.g. repetition } IRMP_DATA; #endif // _IRMPSYSTEM_H_