]> cloudbase.mooo.com Git - irmp.git/blame - irmp.h
Version 2.2.4: added BOSE protocol
[irmp.git] / irmp.h
CommitLineData
4225a882 1/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
2 * irmp.h\r
3 *\r
08f2dd9d 4 * Copyright (c) 2009-2012 Frank Meyer - frank(at)fli4l.de\r
4225a882 5 *\r
08f2dd9d 6 * $Id: irmp.h,v 1.79 2012/05/23 12:26:25 fm Exp $\r
cb8474cc 7 *\r
4225a882 8 * ATMEGA88 @ 8 MHz\r
9 *\r
10 * This program is free software; you can redistribute it and/or modify\r
11 * it under the terms of the GNU General Public License as published by\r
12 * the Free Software Foundation; either version 2 of the License, or\r
13 * (at your option) any later version.\r
14 *---------------------------------------------------------------------------------------------------------------------------------------------------\r
15 */\r
16\r
08f2dd9d 17#ifndef _IRMP_H_\r
18#define _IRMP_H_\r
4225a882 19\r
08f2dd9d 20#include "irmpsystem.h"\r
93ba2e01 21\r
08f2dd9d 22#ifndef IRMP_USE_AS_LIB\r
23# include "irmpconfig.h"\r
9405f84a 24#endif\r
c7a47e89 25\r
08f2dd9d 26#if defined (ATMEL_AVR)\r
27# define _CONCAT(a,b) a##b\r
28# define CONCAT(a,b) _CONCAT(a,b)\r
29# define IRMP_PORT CONCAT(PORT, IRMP_PORT_LETTER)\r
30# define IRMP_DDR CONCAT(DDR, IRMP_PORT_LETTER)\r
31# define IRMP_PIN CONCAT(PIN, IRMP_PORT_LETTER)\r
32# define IRMP_BIT IRMP_BIT_NUMBER\r
33# define input(x) ((x) & (1 << IRMP_BIT))\r
34#elif defined (PIC_C18)\r
35# define input(x) (x)\r
36#elif defined (PIC_CCS)\r
37# define input(x) (x)\r
38#elif defined (ARM_STM32)\r
39# define _CONCAT(a,b) a##b\r
40# define CONCAT(a,b) _CONCAT(a,b)\r
41# define IRMP_PORT CONCAT(GPIO, IRMP_PORT_LETTER)\r
42# if defined (ARM_STM32L1XX)\r
43# define IRMP_PORT_RCC CONCAT(RCC_AHBPeriph_GPIO, IRMP_PORT_LETTER)\r
44# elif defined (ARM_STM32F10X)\r
45# define IRMP_PORT_RCC CONCAT(RCC_APB2Periph_GPIO, IRMP_PORT_LETTER)\r
46# elif defined (ARM_STM32F4XX)\r
47# define IRMP_PORT_RCC CONCAT(RCC_AHB1Periph_GPIO, IRMP_PORT_LETTER)\r
48# endif\r
49# define IRMP_BIT CONCAT(GPIO_Pin_, IRMP_BIT_NUMBER)\r
50# define IRMP_PIN IRMP_PORT // for use with input(x) below\r
51# define input(x) (GPIO_ReadInputDataBit(x, IRMP_BIT))\r
52# ifndef USE_STDPERIPH_DRIVER\r
53# warning The STM32 port of IRMP uses the ST standard peripheral drivers which are not enabled in your build configuration.\r
54# endif\r
55#endif\r
a7054daf 56\r
08f2dd9d 57#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r
58# warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols\r
59# warning RUWIDO protocol disabled\r
60# undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r
61# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r
62#endif\r
b5ea7869 63\r
08f2dd9d 64#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
65# warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000)\r
66# undef IRMP_SUPPORT_SIEMENS_PROTOCOL\r
67# define IRMP_SUPPORT_SIEMENS_PROTOCOL 0\r
68#endif\r
9e16d699 69\r
08f2dd9d 70#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
71# warning F_INTERRUPTS too low, RUWIDO protocol disabled (should be at least 15000)\r
72# undef IRMP_SUPPORT_RUWIDO_PROTOCOL\r
73# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0\r
74#endif\r
770a1a9d 75\r
08f2dd9d 76#if IRMP_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
77# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000)\r
78# undef IRMP_SUPPORT_RECS80_PROTOCOL\r
79# define IRMP_SUPPORT_RECS80_PROTOCOL 0\r
80#endif\r
9405f84a 81\r
08f2dd9d 82#if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
83# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000)\r
84# undef IRMP_SUPPORT_RECS80EXT_PROTOCOL\r
85# define IRMP_SUPPORT_RECS80EXT_PROTOCOL 0\r
86#endif\r
111d6191 87\r
08f2dd9d 88#if IRMP_SUPPORT_LEGO_PROTOCOL == 1 && F_INTERRUPTS < 20000\r
89# warning F_INTERRUPTS too low, LEGO protocol disabled (should be at least 20000)\r
90# undef IRMP_SUPPORT_LEGO_PROTOCOL\r
91# define IRMP_SUPPORT_LEGO_PROTOCOL 0\r
92#endif\r
deba2a0a 93\r
08f2dd9d 94#if IRMP_SUPPORT_JVC_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r
95# warning JVC protocol needs also NEC protocol, NEC protocol enabled\r
96# undef IRMP_SUPPORT_NEC_PROTOCOL\r
97# define IRMP_SUPPORT_NEC_PROTOCOL 1\r
98#endif\r
f50e01e7 99\r
08f2dd9d 100#if IRMP_SUPPORT_NEC16_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r
101# warning NEC16 protocol needs also NEC protocol, NEC protocol enabled\r
102# undef IRMP_SUPPORT_NEC_PROTOCOL\r
103# define IRMP_SUPPORT_NEC_PROTOCOL 1\r
104#endif\r
beda975f 105\r
08f2dd9d 106#if IRMP_SUPPORT_NEC42_PROTOCOL == 1 && IRMP_SUPPORT_NEC_PROTOCOL == 0\r
107# warning NEC42 protocol needs also NEC protocol, NEC protocol enabled\r
108# undef IRMP_SUPPORT_NEC_PROTOCOL\r
109# define IRMP_SUPPORT_NEC_PROTOCOL 1\r
110#endif\r
4225a882 111\r
08f2dd9d 112#if F_INTERRUPTS > 20000\r
113#error F_INTERRUPTS too high (should be not greater than 20000)\r
114#endif\r
4225a882 115\r
08f2dd9d 116#include "irmpprotocols.h"\r
4225a882 117\r
08f2dd9d 118#define IRMP_FLAG_REPETITION 0x01\r
4225a882 119\r
1f54e86c 120extern void irmp_init (void);\r
121extern uint8_t irmp_get_data (IRMP_DATA *);\r
122extern uint8_t irmp_is_busy (void);\r
123extern uint8_t irmp_ISR (void);\r
4225a882 124\r
1f54e86c 125#if IRMP_PROTOCOL_NAMES == 1\r
126extern char * irmp_protocol_names[IRMP_N_PROTOCOLS + 1];\r
4225a882 127#endif\r
128\r
7644ac04 129#if IRMP_USE_CALLBACK == 1\r
130extern void irmp_set_callback_ptr (void (*cb)(uint8_t));\r
08f2dd9d 131#endif // IRMP_USE_CALLBACK == 1\r
7644ac04 132\r
08f2dd9d 133#endif /* _IRMP_H_ */\r