Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1470 | - | 1 | /***************************************************************************** |
2 | * Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de * |
||
3 | * Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net * |
||
4 | * Copyright (C) 2011 Christian "Cebra" Brandtner, brandtner@brandtner.net * |
||
5 | * Copyright (C) 2011 Harald Bongartz * |
||
6 | * * |
||
7 | * This program is free software; you can redistribute it and/or modify * |
||
8 | * it under the terms of the GNU General Public License as published by * |
||
9 | * the Free Software Foundation; either version 2 of the License. * |
||
10 | * * |
||
11 | * This program is distributed in the hope that it will be useful, * |
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
14 | * GNU General Public License for more details. * |
||
15 | * * |
||
16 | * You should have received a copy of the GNU General Public License * |
||
17 | * along with this program; if not, write to the * |
||
18 | * Free Software Foundation, Inc., * |
||
19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
20 | * * |
||
21 | * * |
||
22 | * Credits to: * |
||
23 | * Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN * |
||
24 | * http://www.mikrokopter.de * |
||
25 | * Gregor "killagreg" Stobrawa for his version of the MK code * |
||
26 | * Thomas Kaiser "thkais" for the original project. See * |
||
27 | * http://www.ft-fanpage.de/mikrokopter/ * |
||
28 | * http://forum.mikrokopter.de/topic-4061-1.html * |
||
29 | * Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code * |
||
30 | * http://www.mylifesucks.de/oss/c-osd/ * |
||
31 | * Harald Bongartz "HaraldB" for providing his Ideas and Code for usibility* |
||
32 | *****************************************************************************/ |
||
33 | |||
34 | |||
35 | // * Hardwareabhängige Definitionen und Prozeduren |
||
36 | // * Hardware Leiterplatte V3.2 Cebra |
||
37 | // * USB,Wi232,LED |
||
38 | |||
39 | |||
40 | /* Hardware 3.1 Portbelegung |
||
41 | |||
42 | Servo PD4 Pin 13 |
||
43 | Servo PD5 Pin 14 |
||
44 | Wi.232 CMD PD6 Pin 15 aktiv low |
||
45 | Displaybeleuchtung PD7 Pin 16 LED an + |
||
46 | I2C PC0 Pin 19 |
||
47 | I2C PC1 Pin 20 |
||
48 | LED2 PC2 Pin 21 LED an + |
||
49 | LED1 PC3 Pin 22 LED an + |
||
50 | Summer PC6 Pin 25 Summer an + |
||
51 | LED3 PB1 Pin 41 LED an + |
||
52 | LED4 PB0 Pin 40 LED an + |
||
53 | |||
54 | */ |
||
55 | #ifndef HAL_HW3_2_H_ |
||
56 | #define HAL_HW3_2_H_ |
||
57 | |||
58 | #define set_cs() (PORTB |= (1 << PB4)) // Display |
||
59 | #define clr_cs() (PORTB &= ~(1 << PB4)) |
||
60 | #define set_reset() (PORTB |= (1 << PB2)) |
||
61 | #define clr_reset() (PORTB &= ~(1 << PB2)) |
||
62 | #define set_A0() (PORTB |= (1 << PB3)) // Data |
||
63 | #define clr_A0() (PORTB &= ~(1 << PB3)) // Command |
||
64 | #define set_scl() (PORTB |= (1 << PB7)) |
||
65 | #define clr_scl() (PORTB &= ~(1 << PB7)) |
||
66 | #define set_si() (PORTB |= (1 << PB5)) |
||
67 | #define clr_si() (PORTB &= ~(1 << PB5)) |
||
68 | |||
69 | #define set_LED1() (PORTC &= ~(1 << PC3)) // Leds |
||
70 | #define clr_LED1() (PORTC |= (1 << PC3)) |
||
71 | #define set_LED2() (PORTC &= ~(1 << PC2)) |
||
72 | #define clr_LED2() (PORTC |= (1 << PC2)) |
||
73 | #define set_LED3() (PORTB &= ~(1 << PB1)) |
||
74 | #define clr_LED3() (PORTB |= (1 << PB1)) |
||
75 | #define set_LED4() (PORTB &= ~(1 << PB0)) |
||
76 | #define clr_LED4() (PORTB |= (1 << PB0)) |
||
77 | |||
78 | |||
79 | #define set_BEEP() (PORTC &= ~(1 << PC6)) //Summer |
||
80 | #define clr_BEEP() (PORTC |= (1 << PC6)) |
||
81 | |||
82 | |||
83 | #define set_D_LIGHT() (PORTD |= (1 << PD7)) // Displaybeleuchtung |
||
84 | #define clr_D_LIGHT() (PORTD &= ~(1 << PD7)) |
||
85 | #define set_WI232CMD() (PORTD &= ~(1 << PD6)) |
||
86 | #define clr_WI232CMD() (PORTD |= (1 << PD6)) |
||
87 | |||
88 | |||
89 | #define KEY_PIN PINA |
||
90 | |||
91 | //#if defined HWVERSION1_2 || defined HWVERSION1_3 || defined HWVERSION3_2 |
||
92 | //#define KEY_ENTER PA7 |
||
93 | //#define KEY_ESC PA6 |
||
94 | //#define KEY_PLUS PA5 |
||
95 | //#define KEY_MINUS PA4 |
||
96 | //#endif |
||
97 | |||
98 | /*in der Hardwareversion sind die Tasten im Layout verdreht*/ |
||
99 | #define KEY_ENTER PA4 |
||
100 | #define KEY_ESC PA5 |
||
101 | #define KEY_PLUS PA6 |
||
102 | #define KEY_MINUS PA7 |
||
103 | |||
104 | |||
105 | |||
106 | void InitHWPorts(void); |
||
107 | |||
108 | #endif /* HAL_HW3_2_H_ */ |