]>
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 |
061e654c | 6 | * $Id: irmp.h,v 1.90 2015/01/19 10:54:37 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 |
061e654c | 64 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && (IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1)\r |
65 | # warning DENON protocol conflicts wih RUWIDO/SIEMENS, please enable only one of both protocols\r | |
08f2dd9d | 66 | # warning RUWIDO protocol disabled\r |
061e654c | 67 | # warning SIEMENS protocol disabled\r |
68 | # warning DENON protocol stays enabled\r | |
08f2dd9d | 69 | # undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r |
70 | # define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r | |
061e654c | 71 | # undef IRMP_SUPPORT_SIEMENS_PROTOCOL\r |
72 | # define IRMP_SUPPORT_SIEMENS_PROTOCOL 0\r | |
73 | #endif\r | |
74 | \r | |
75 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && (IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1)\r | |
76 | # warning MERLIN protocol conflicts wih RUWIDO/SIEMENS, please enable only one of both protocols\r | |
77 | # warning RUWIDO protocol disabled\r | |
78 | # warning SIEMENS protocol disabled\r | |
79 | # warning MERLIN protocol stays enabled\r | |
80 | # undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r | |
81 | # define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r | |
82 | # undef IRMP_SUPPORT_SIEMENS_PROTOCOL\r | |
83 | # define IRMP_SUPPORT_SIEMENS_PROTOCOL 0\r | |
84 | #endif\r | |
85 | \r | |
86 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1\r | |
87 | # warning MERLIN protocol conflicts wih A1TVBOX, please enable only one of both protocols\r | |
88 | # warning A1TVBOX protocol disabled\r | |
89 | # warning MERLIN protocol stays enabled\r | |
90 | # undef IRMP_SUPPORT_A1TVBOX_PROTOCOL\r | |
91 | # define IRMP_SUPPORT_A1TVBOX_PROTOCOL 0\r | |
08f2dd9d | 92 | #endif\r |
b5ea7869 | 93 | \r |
40ca4604 | 94 | #if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r |
95 | # warning RC6 protocol conflicts wih ROOMBA, please enable only one of both protocols\r | |
96 | # warning ROOMBA protocol disabled\r | |
97 | # undef IRMP_SUPPORT_ROOMBA_PROTOCOL\r | |
98 | # define IRMP_SUPPORT_ROOMBA_PROTOCOL 0\r | |
99 | #endif\r | |
100 | \r | |
cb93f9e9 | 101 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r |
102 | # warning RC5 protocol conflicts wih ORTEK, please enable only one of both protocols\r | |
103 | # warning ORTEK protocol disabled\r | |
104 | # undef IRMP_SUPPORT_ORTEK_PROTOCOL\r | |
105 | # define IRMP_SUPPORT_ORTEK_PROTOCOL 0\r | |
106 | #endif\r | |
107 | \r | |
108 | #if IRMP_SUPPORT_FDC_PROTOCOL == 1 && IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
109 | # warning FDC protocol conflicts wih ORTEK, please enable only one of both protocols\r | |
110 | # warning ORTEK protocol disabled\r | |
111 | # undef IRMP_SUPPORT_ORTEK_PROTOCOL\r | |
112 | # define IRMP_SUPPORT_ORTEK_PROTOCOL 0\r | |
113 | #endif\r | |
114 | \r | |
115 | #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1 && IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r | |
116 | # warning ORTEK protocol conflicts wih NETBOX, please enable only one of both protocols\r | |
117 | # warning NETBOX protocol disabled\r | |
118 | # undef IRMP_SUPPORT_NETBOX_PROTOCOL\r | |
119 | # define IRMP_SUPPORT_NETBOX_PROTOCOL 0\r | |
120 | #endif\r | |
121 | \r | |
08f2dd9d | 122 | #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
123 | # warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000)\r | |
124 | # undef IRMP_SUPPORT_SIEMENS_PROTOCOL\r | |
125 | # define IRMP_SUPPORT_SIEMENS_PROTOCOL 0\r | |
126 | #endif\r | |
9e16d699 | 127 | \r |
08f2dd9d | 128 | #if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
129 | # warning F_INTERRUPTS too low, RUWIDO protocol disabled (should be at least 15000)\r | |
130 | # undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r | |
131 | # define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r | |
132 | #endif\r | |
770a1a9d | 133 | \r |
08f2dd9d | 134 | #if IRMP_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
135 | # warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000)\r | |
136 | # undef IRMP_SUPPORT_RECS80_PROTOCOL\r | |
137 | # define IRMP_SUPPORT_RECS80_PROTOCOL 0\r | |
138 | #endif\r | |
9405f84a | 139 | \r |
08f2dd9d | 140 | #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000\r |
141 | # warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000)\r | |
142 | # undef IRMP_SUPPORT_RECS80EXT_PROTOCOL\r | |
143 | # define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0\r | |
144 | #endif\r | |
111d6191 | 145 | \r |
08f2dd9d | 146 | #if IRMP_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000\r |
147 | # warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000)\r | |
148 | # undef IRMP_SUPPORT_LEGO_PROTOCOL\r | |
149 | # define IRMP_SUPPORT_LEGO_PROTOCOL 0\r | |
150 | #endif\r | |
deba2a0a | 151 | \r |
956ea3ea | 152 | #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 0\r |
153 | # warning SAMSUNG48 protocol needs also SAMSUNG protocol, SAMSUNG protocol enabled\r | |
154 | # undef IRMP_SUPPORT_SAMSUNG_PROTOCOL\r | |
155 | # define IRMP_SUPPORT_SAMSUNG_PROTOCOL 1\r | |
156 | #endif\r | |
157 | \r | |
08f2dd9d | 158 | #if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r |
159 | # warning JVC protocol needs also NEC protocol, NEC protocol enabled\r | |
160 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
161 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
162 | #endif\r | |
f50e01e7 | 163 | \r |
08f2dd9d | 164 | #if IRMP_SUPPORT_NEC16_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r |
165 | # warning NEC16 protocol needs also NEC protocol, NEC protocol enabled\r | |
166 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
167 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
168 | #endif\r | |
beda975f | 169 | \r |
08f2dd9d | 170 | #if IRMP_SUPPORT_NEC42_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r |
171 | # warning NEC42 protocol needs also NEC protocol, NEC protocol enabled\r | |
172 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
173 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
69da6090 | 174 | #endif\r |
175 | \r | |
176 | #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r | |
177 | # warning LGAIR protocol needs also NEC protocol, NEC protocol enabled\r | |
178 | # undef IRMP_SUPPORT_NEC_PROTOCOL\r | |
179 | # define IRMP_SUPPORT_NEC_PROTOCOL 1\r | |
08f2dd9d | 180 | #endif\r |
4225a882 | 181 | \r |
cb93f9e9 | 182 | #if IRMP_SUPPORT_RCMM_PROTOCOL == 1 && F_INTERRUPTS < 20000\r |
183 | # warning F_INTERRUPTS too low, RCMM protocol disabled (should be at least 20000)\r | |
184 | # undef IRMP_SUPPORT_RCMM_PROTOCOL\r | |
185 | # define IRMP_SUPPORT_RCMM_PROTOCOL 0\r | |
186 | #endif\r | |
187 | \r | |
08f2dd9d | 188 | #if F_INTERRUPTS > 20000\r |
189 | #error F_INTERRUPTS too high (should be not greater than 20000)\r | |
190 | #endif\r | |
4225a882 | 191 | \r |
08f2dd9d | 192 | #include "irmpprotocols.h"\r |
4225a882 | 193 | \r |
08f2dd9d | 194 | #define IRMP_FLAG_REPETITION 0x01\r |
4225a882 | 195 | \r |
1f54e86c | 196 | extern void irmp_init (void);\r |
061e654c | 197 | extern uint_fast8_t irmp_get_data (IRMP_DATA *);\r |
198 | extern uint_fast8_t irmp_is_busy (void);\r | |
199 | extern uint_fast8_t irmp_ISR (void);\r | |
4225a882 | 200 | \r |
1f54e86c | 201 | #if IRMP_PROTOCOL_NAMES == 1\r |
622f5f59 | 202 | extern const char * const irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM;\r |
4225a882 | 203 | #endif\r |
204 | \r | |
7644ac04 | 205 | #if IRMP_USE_CALLBACK == 1\r |
061e654c | 206 | extern void irmp_set_callback_ptr (void (*cb)(uint_fast8_t));\r |
08f2dd9d | 207 | #endif // IRMP_USE_CALLBACK == 1\r |
7644ac04 | 208 | \r |
08f2dd9d | 209 | #endif /* _IRMP_H_ */\r |