]>
cloudbase.mooo.com Git - irmp.git/blob - irmpsystem.h
4d822861b014cf77f5b5d9dc79a2abec6c65cb2b
1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmpsystem.h - system specific includes and defines
4 * Copyright (c) 2009-2013 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmpsystem.h,v 1.8 2013/01/17 07:33:13 fm Exp $
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *---------------------------------------------------------------------------------------------------------------------------------------------------
15 #ifndef _IRMPSYSTEM_H_
16 #define _IRMPSYSTEM_H_
18 #if !defined(_IRMP_H_) && !defined(_IRSND_H_)
19 # error please include only irmp.h or irsnd.h, not irmpsystem.h
22 #if defined(__18CXX) // Microchip PIC C18 compiler
24 #elif defined(__PCM__) || defined(__PCB__) || defined(__PCH__) // CCS PIC compiler
26 #elif defined(STM32L1XX_MD) || defined(STM32L1XX_MDP) || defined(STM32L1XX_HD) // ARM STM32
27 # include <stm32l1xx.h>
29 # define ARM_STM32L1XX
30 #elif defined(STM32F10X_LD) || defined(STM32F10X_LD_VL) \
31 || defined(STM32F10X_MD) || defined(STM32F10X_MD_VL) \
32 || defined(STM32F10X_HD) || defined(STM32F10X_HD_VL) \
33 || defined(STM32F10X_XL) || defined(STM32F10X_CL) // ARM STM32
34 # include <stm32f10x.h>
36 # define ARM_STM32F10X
37 #elif defined(STM32F4XX) // ARM STM32
38 # include <stm32f4xx.h>
40 # define ARM_STM32F4XX
41 #elif defined(TARGET_IS_BLIZZARD_RA2) // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)
42 # define STELLARIS_ARM_CORTEX_M4
43 # define F_CPU (SysCtlClockGet())
44 #elif defined(unix) || defined(WIN32) // Unix/Linux or Windows
45 # define UNIX_OR_WINDOWS
47 # define ATMEL_AVR // ATMEL AVR
52 #ifdef UNIX_OR_WINDOWS // Analyze on Unix/Linux or Windows
55 # define F_CPU 8000000L
61 typedef unsigned char uint8_t;
62 typedef unsigned short uint16_t;
67 #if defined(ATMEL_AVR)
71 # include <util/delay.h>
72 # include <avr/pgmspace.h>
73 # include <avr/interrupt.h>
74 # define IRSND_OC2 0 // OC2
75 # define IRSND_OC2A 1 // OC2A
76 # define IRSND_OC2B 2 // OC2B
77 # define IRSND_OC0 3 // OC0
78 # define IRSND_OC0A 4 // OC0A
79 # define IRSND_OC0B 5 // OC0B
80 #elif defined(STELLARIS_ARM_CORTEX_M4)
81 # include "inc/hw_ints.h"
82 # include "inc/hw_memmap.h"
83 # include "inc/hw_types.h"
84 # include "inc/hw_gpio.h"
85 # include "driverlib/fpu.h"
86 # include "driverlib/sysctl.h"
87 # include "driverlib/interrupt.h"
88 # include "driverlib/gpio.h"
89 # include "driverlib/rom.h"
90 # include "driverlib/systick.h"
91 # include "driverlib/pin_map.h"
92 # include "driverlib/timer.h"
93 # define PROGMEM volatile
94 # define memcpy_P memcpy
95 # define APP_SYSTICKS_PER_SEC 32
98 # define memcpy_P memcpy
101 #if defined(PIC_CCS) || defined(PIC_C18) || defined(ARM_STM32) || defined(STELLARIS_ARM_CORTEX_M4)
102 typedef unsigned char uint8_t;
103 typedef unsigned short uint16_t;
106 #if defined (PIC_C18)
107 # include <p18cxxx.h> // main PIC18 h file
108 # include <timers.h> // timer lib
109 # include <pwm.h> // pwm lib
110 # define IRSND_PIC_CCP1 1 // PIC C18 RC2 = PWM1 module
111 # define IRSND_PIC_CCP2 2 // PIC C18 RC1 = PWM2 module
121 uint8_t protocol
; // protocol, i.e. NEC_PROTOCOL
122 uint16_t address
; // address
123 uint16_t command
; // command
124 uint8_t flags
; // flags, e.g. repetition
127 #endif // _IRMPSYSTEM_H_