Subversion Repositories Projects

Rev

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 V1.2 sebseb7
37
 
38
 
39
/* Belegung der Ports*/
40
/*Hardware 1.2 sebseb7 Portbelegung
41
 
42
Servo                           PD4             Pin 13
43
Servo                           PD5             Pin 14
44
Displaybeleuchtung      PD7             Pin 16          LED an +
45
Displaybeleuchtung      PC0             Pin 10          LED an +
46
Displaybeleuchtung      PC1             Pin 20          LED an +
47
Summer                          PC6             Pin 25          Summer an GND
48
Wi232                           PC7             Pin 26          Wi232 CMD Pin
49
 
50
*/
51
 
52
 
53
 
54
 
55
 
56
#ifndef HAL_HW1_2_H_
57
#define HAL_HW1_2_H_
58
 
59
#define set_cs()        (PORTB |=  (1 << PB4))          // Display
60
#define clr_cs()        (PORTB &= ~(1 << PB4))
61
#define set_reset()     (PORTB |=  (1 << PB2))
62
#define clr_reset()     (PORTB &= ~(1 << PB2))
63
#define set_A0()        (PORTB |=  (1 << PB3))          // Data
64
#define clr_A0()        (PORTB &= ~(1 << PB3))          // Command
65
#define set_scl()       (PORTB |=  (1 << PB7))
66
#define clr_scl()       (PORTB &= ~(1 << PB7))
67
#define set_si()        (PORTB |=  (1 << PB5))
68
#define clr_si()        (PORTB &= ~(1 << PB5))
69
 
70
#define set_LED1()      (PORTC &= ~(1 << PC3))          // Leds
71
#define clr_LED1()      (PORTC |=  (1 << PC3))
72
#define set_LED2()      (PORTC &= ~(1 << PC2))
73
#define clr_LED2()      (PORTC |=  (1 << PC2))
74
#define set_LED3()      (PORTB &= ~(1 << PB1))
75
#define clr_LED3()      (PORTB |=  (1 << PB1))
76
#define set_LED4()      (PORTB &= ~(1 << PB0))
77
#define clr_LED4()      (PORTB |=  (1 << PB0))
78
 
79
 
80
#define clr_BEEP()      (PORTC &= ~(1 << PC6))          //Summer
81
#define set_BEEP()      (PORTC |=  (1 << PC6))
82
 
83
#define set_WI232CMD()  (PORTC &= ~(1 << PC7))
84
#define clr_WI232CMD()  (PORTC |=  (1 << PC7))
85
 
86
 
87
#define KEY_PIN                 PINA
88
 
89
#define KEY_ENTER               PA7
90
#define KEY_ESC                 PA6
91
#define KEY_PLUS                PA5
92
#define KEY_MINUS               PA4
93
 
94
void set_D_LIGHT(void); /* Displaybeleuchtung ein*/
95
void clr_D_LIGHT(void); /* Displaybeleuchtung aus*/
96
 
97
void InitHWPorts(void);
98
 
99
#endif /* HAL_HW1_2_H_ */