]>
Commit | Line | Data |
---|---|---|
4225a882 | 1 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r |
2 | * irmp.h\r | |
3 | *\r | |
7fe8188d | 4 | * Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de\r |
4225a882 | 5 | *\r |
622f5f59 | 6 | * $Id: irmp.h,v 1.89 2014/09/15 10:27:38 fm Exp $\r |
4225a882 | 7 | *\r |
8 | * This program is free software; you can redistribute it and/or modify\r | |
9 | * it under the terms of the GNU General Public License as published by\r | |
10 | * the Free Software Foundation; either version 2 of the License, or\r | |
11 | * (at your option) any later version.\r | |
12 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
13 | */\r | |
14 | \r | |
08f2dd9d | 15 | #ifndef _IRMP_H_\r |
16 | #define _IRMP_H_\r | |
4225a882 | 17 | \r |
08f2dd9d | 18 | #include "irmpsystem.h"\r |
93ba2e01 | 19 | \r |
08f2dd9d | 20 | #ifndef IRMP_USE_AS_LIB\r |
21 | # include "irmpconfig.h"\r | |
9405f84a | 22 | #endif\r |
c7a47e89 | 23 | \r |
08f2dd9d | 24 | #if defined (ATMEL_AVR)\r |
25 | # define _CONCAT(a,b) a##b\r | |
26 | # define CONCAT(a,b) _CONCAT(a,b)\r | |
27 | # define IRMP_PORT CONCAT(PORT, IRMP_PORT_LETTER)\r | |
28 | # define IRMP_DDR CONCAT(DDR, IRMP_PORT_LETTER)\r | |
29 | # define IRMP_PIN CONCAT(PIN, IRMP_PORT_LETTER)\r | |
30 | # define IRMP_BIT IRMP_BIT_NUMBER\r | |
31 | # define input(x) ((x) & (1 << IRMP_BIT))\r | |
32 | #elif defined (PIC_C18)\r | |
33 | # define input(x) (x)\r | |
34 | #elif defined (PIC_CCS)\r | |
35 | # define input(x) (x)\r | |
36 | #elif defined (ARM_STM32)\r | |
37 | # define _CONCAT(a,b) a##b\r | |
38 | # define CONCAT(a,b) _CONCAT(a,b)\r | |
39 | # define IRMP_PORT CONCAT(GPIO, IRMP_PORT_LETTER)\r | |
40 | # if defined (ARM_STM32L1XX)\r | |
41 | # define IRMP_PORT_RCC CONCAT(RCC_AHBPeriph_GPIO, IRMP_PORT_LETTER)\r | |
42 | # elif defined (ARM_STM32F10X)\r | |
43 | # define IRMP_PORT_RCC CONCAT(RCC_APB2Periph_GPIO, IRMP_PORT_LETTER)\r | |
44 | # elif defined (ARM_STM32F4XX)\r | |
45 | # define IRMP_PORT_RCC CONCAT(RCC_AHB1Periph_GPIO, IRMP_PORT_LETTER)\r | |
46 | # endif\r | |
47 | # define IRMP_BIT CONCAT(GPIO_Pin_, IRMP_BIT_NUMBER)\r | |
48 | # define IRMP_PIN IRMP_PORT // for use with input(x) below\r | |
49 | # define input(x) (GPIO_ReadInputDataBit(x, IRMP_BIT))\r | |
50 | # ifndef USE_STDPERIPH_DRIVER\r | |
51 | # warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration.\r | |
52 | # endif\r | |
afd1e690 | 53 | #elif defined (STELLARIS_ARM_CORTEX_M4)\r |
54 | # define _CONCAT(a,b) a##b\r | |
55 | # define CONCAT(a,b) _CONCAT(a,b)\r | |
56 | # define IRMP_PORT_PERIPH CONCAT(SYSCTL_PERIPH_GPIO, IRMP_PORT_LETTER)\r | |
57 | # define IRMP_PORT_BASE CONCAT(GPIO_PORT, CONCAT(IRMP_PORT_LETTER, _BASE))\r | |
58 | # define IRMP_PORT_PIN CONCAT(GPIO_PIN_, IRMP_BIT_NUMBER)\r | |
59 | # define IRMP_PIN IRMP_PORT_PIN\r | |
60 | # define input(x) ((uint8_t)(ROM_GPIOPinRead(IRMP_PORT_BASE, IRMP_PORT_PIN)))\r | |
61 | # define sei() IntMasterEnable()\r | |
08f2dd9d | 62 | #endif\r |
a7054daf | 63 | \r |
08f2dd9d | 64 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r |
65 | # warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols\r | |
66 | # warning RUWIDO protocol disabled\r | |
67 | # undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r | |
68 | # define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r | |
69 | #endif\r | |
b5ea7869 | 70 | \r |
40ca4604 | 71 | #if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r |
72 | # warning RC6 protocol conflicts wih ROOMBA, please enable only one of both protocols\r | |
73 | # warning ROOMBA protocol disabled\r | |
74 | # undef IRMP_SUPPORT_ROOMBA_PROTOCOL\r | |
75 | # define IRMP_SUPPORT_ROOMBA_PROTOCOL 0\r | |
76 | #endif\r | |
77 | \r | |
cb93f9e9 | 78 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r |
79 | # warning RC5 protocol conflicts wih ORTEK, please enable only one of both protocols\r | |
80 | # warning ORTEK protocol disabled\r | |
81 | # undef IRMP_SUPPORT_ORTEK_PROTOCOL\r | |
82 | # define IRMP_SUPPORT_ORTEK_PROTOCOL 0\r | |
83 | #endif\r | |
84 | \r | |
85 | #if IRMP_SUPPORT_FDC_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
86 | # warning FDC protocol conflicts wih ORTEK, please enable only one of both protocols\r | |
87 | # warning ORTEK protocol disabled\r | |
88 | # undef IRMP_SUPPORT_ORTEK_PROTOCOL\r | |
89 | # define IRMP_SUPPORT_ORTEK_PROTOCOL 0\r | |
90 | #endif\r | |
91 | \r | |
92 | #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1 && IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r | |
93 | # warning ORTEK protocol conflicts wih NETBOX, please enable only one of both protocols\r | |
94 | # warning NETBOX protocol disabled\r | |
95 | # undef IRMP_SUPPORT_NETBOX_PROTOCOL\r | |
96 | # define IRMP_SUPPORT_NETBOX_PROTOCOL 0\r | |
97 | #endif\r | |
98 | \r | |
08f2dd9d | 99 | #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
100 | # warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000)\r | |
101 | # undef IRMP_SUPPORT_SIEMENS_PROTOCOL\r | |
102 | # define IRMP_SUPPORT_SIEMENS_PROTOCOL 0\r | |
103 | #endif\r | |
9e16d699 | 104 | \r |
08f2dd9d | 105 | #if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
106 | # warning F_INTERRUPTS too low, RUWIDO protocol disabled (should be at least 15000)\r | |
107 | # undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r | |
108 | # define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r | |
109 | #endif\r | |
770a1a9d | 110 | \r |
08f2dd9d | 111 | #if IRMP_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
112 | # warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000)\r | |
113 | # undef IRMP_SUPPORT_RECS80_PROTOCOL\r | |
114 | # define IRMP_SUPPORT_RECS80_PROTOCOL 0\r | |
115 | #endif\r | |
9405f84a | 116 | \r |
08f2dd9d | 117 | #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
118 | # warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000)\r | |
119 | # undef IRMP_SUPPORT_RECS80EXT_PROTOCOL\r | |
120 | # define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0\r | |
121 | #endif\r | |
111d6191 | 122 | \r |
08f2dd9d | 123 | #if IRMP_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000\r |
124 | # warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000)\r | |
125 | # undef IRMP_SUPPORT_LEGO_PROTOCOL\r | |
126 | # define IRMP_SUPPORT_LEGO_PROTOCOL 0\r | |
127 | #endif\r | |
deba2a0a | 128 | \r |
956ea3ea | 129 | #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 0\r |
130 | # warning SAMSUNG48 protocol needs also SAMSUNG protocol, SAMSUNG protocol enabled\r | |
131 | # undef IRMP_SUPPORT_SAMSUNG_PROTOCOL\r | |
132 | # define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1\r | |
133 | #endif\r | |
134 | \r | |
08f2dd9d | 135 | #if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r |
136 | # warning JVC protocol needs also NEC protocol, NEC protocol enabled\r | |
137 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
138 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
139 | #endif\r | |
f50e01e7 | 140 | \r |
08f2dd9d | 141 | #if IRMP_SUPPORT_NEC16_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r |
142 | # warning NEC16 protocol needs also NEC protocol, NEC protocol enabled\r | |
143 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
144 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
145 | #endif\r | |
beda975f | 146 | \r |
08f2dd9d | 147 | #if IRMP_SUPPORT_NEC42_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r |
148 | # warning NEC42 protocol needs also NEC protocol, NEC protocol enabled\r | |
149 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
150 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
69da6090 | 151 | #endif\r |
152 | \r | |
153 | #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r | |
154 | # warning LGAIR protocol needs also NEC protocol, NEC protocol enabled\r | |
155 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
156 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
08f2dd9d | 157 | #endif\r |
4225a882 | 158 | \r |
cb93f9e9 | 159 | #if IRMP_SUPPORT_RCMM_PROTOCOL == 1 && F_INTERRUPTS < 20000\r |
160 | # warning F_INTERRUPTS too low, RCMM protocol disabled (should be at least 20000)\r | |
161 | # undef IRMP_SUPPORT_RCMM_PROTOCOL\r | |
162 | # define IRMP_SUPPORT_RCMM_PROTOCOL 0\r | |
163 | #endif\r | |
164 | \r | |
08f2dd9d | 165 | #if F_INTERRUPTS > 20000\r |
166 | #error F_INTERRUPTS too high (should be not greater than 20000)\r | |
167 | #endif\r | |
4225a882 | 168 | \r |
08f2dd9d | 169 | #include "irmpprotocols.h"\r |
4225a882 | 170 | \r |
08f2dd9d | 171 | #define IRMP_FLAG_REPETITION 0x01\r |
4225a882 | 172 | \r |
1f54e86c | 173 | extern void irmp_init (void);\r |
174 | extern uint8_t irmp_get_data (IRMP_DATA *);\r | |
175 | extern uint8_t irmp_is_busy (void);\r | |
176 | extern uint8_t irmp_ISR (void);\r | |
4225a882 | 177 | \r |
1f54e86c | 178 | #if IRMP_PROTOCOL_NAMES == 1\r |
622f5f59 | 179 | extern const char * const irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM;\r |
4225a882 | 180 | #endif\r |
181 | \r | |
7644ac04 | 182 | #if IRMP_USE_CALLBACK == 1\r |
183 | extern void irmp_set_callback_ptr (void (*cb)(uint8_t));\r | |
08f2dd9d | 184 | #endif // IRMP_USE_CALLBACK == 1\r |
7644ac04 | 185 | \r |
08f2dd9d | 186 | #endif /* _IRMP_H_ */\r |