]> git.zerfleddert.de Git - fnordlicht-mini/blob - firmware/fnordlicht-controller/globals.h
309f04c2fd43773b484fdd61af803b980e6b480a
[fnordlicht-mini] / firmware / fnordlicht-controller / globals.h
1 /* vim:ts=4 sts=4 et tw=80
2 *
3 * fnordlicht firmware
4 *
5 * for additional information please
6 * see http://lochraster.org/fnordlichtmini
7 *
8 * (c) by Alexander Neumann <alexander@bumpern.de>
9 * Lars Noschinski <lars@public.noschinski.de>
10 *
11 * This program is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License version 3 as published by
13 * the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * more details.
19 *
20 * You should have received a copy of the GNU General Public License along with
21 * this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24 #ifndef _FNORDLICHT_GLOBALS_H
25 #define _FNORDLICHT_GLOBALS_H
26
27 #include <avr/version.h>
28 #include "config.h"
29 #include "../common/common.h"
30
31 /* check for avr-libc version */
32 #if __AVR_LIBC_VERSION__ < 10600UL
33 #error "newer libc version (>= 1.6.0) needed!"
34 #endif
35
36 /* check if cpu speed is defined */
37 #ifndef F_CPU
38 #error "please define F_CPU! (see Makefile)"
39 #endif
40
41 /* check if this cpu is supported */
42 #if !(defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__))
43 #error "this cpu is not supported yet!"
44 #endif
45
46 /* fifo size should be a power of 2 and below 128 */
47 #define CONFIG_FIFO_SIZE 64
48
49 /* serial communication is required */
50 #define CONFIG_SERIAL 1
51
52 /* leds */
53 #define LED_PORTNAME B
54 #define LED1_PIN 2
55 #define LED2_PIN 1
56
57 /* buttons */
58 #define BTN_PORTNAME C
59 #define BTN1_PIN 5
60 #define BTN2_PIN 4
61
62 /* infrared receiver */
63 #define IR_PORTNAME C
64 #define IR_PIN 1
65 #define IR_INTNUM 9 /* PC1 is PCINT9 */
66
67 /* convenient naming */
68 #define LED_PORT _OUTPORT(LED_PORTNAME)
69 #define LED_DDR _DDRPORT(LED_PORTNAME)
70
71 #define BTN_PORT _OUTPORT(BTN_PORTNAME)
72 #define BTN_DDR _DDRPORT(BTN_PORTNAME)
73 #define BTN_PIN _INPORT(BTN_PORTNAME)
74
75 #endif /* _FNORDLICHT_CONFIG_H */
Impressum, Datenschutz