Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1149 - 1
/*****************************************************************************
2
 *   Copyright (C) 2008 Thomas Kaiser, thomas@ft-fanpage.de                  *
3
 *   Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net                  *
4
 *                                                                           *
5
 *   This program is free software; you can redistribute it and/or modify    *
6
 *   it under the terms of the GNU General Public License as published by    *
7
 *   the Free Software Foundation; either version 2 of the License.          *
8
 *                                                                           *
9
 *   This program is distributed in the hope that it will be useful,         *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
12
 *   GNU General Public License for more details.                            *
13
 *                                                                           *
14
 *   You should have received a copy of the GNU General Public License       *
15
 *   along with this program; if not, write to the                           *
16
 *   Free Software Foundation, Inc.,                                         *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.               *
18
 *                                                                           *
19
 *                                                                           *
20
 *   Credits to:                                                             *
21
 *   Holger Buss & Ingo Busker from mikrokopter.de for the MK project + SVN  *
22
 *                          http://www.mikrokopter.de                        *
23
 *   Gregor "killagreg" Stobrawa for his version of the MK code              *
24
 *   Thomas Kaiser "thkais" for the original project. See                    *
25
 *                          http://www.ft-fanpage.de/mikrokopter/            *
26
 *                          http://forum.mikrokopter.de/topic-4061-1.html    *
27
 *   Claas Anders "CaScAdE" Rathje for providing the font and his C-OSD code *
28
 *                          http://www.mylifesucks.de/oss/c-osd/             *
29
 *****************************************************************************/
30
 
31
#ifndef _MAIN_H
32
#define _MAIN_H
33
 
34
 
35
/* Fusebits für Hardware 1.2 D7 DF FF */
36
/* Fusebits für Hardware 1.3 */
37
/* Fusebits für Hardware 3.x */
38
 
39
/*****************************************************************************/
40
/* hier die entsprechende Hardwareversion der Leiterplatte einstellen */
41
 
42
//#define HWVERSION1_2  /* Hardware sebseb7*/
43
//#define HWVERSION1_3  /* Hardware sebseb7*/
44
#define HWVERSION3_1  /* Hardware Cebra Juni 2011*/
45
 
46
/*****************************************************************************/
47
 
48
#define set_cs()    (PORTB |=  (1 << PB4))
49
#define clr_cs()    (PORTB &= ~(1 << PB4))
50
#define set_reset() (PORTB |=  (1 << PB2))
51
#define clr_reset() (PORTB &= ~(1 << PB2))
52
#define set_A0()    (PORTB |=  (1 << PB3))                      // Data
53
#define clr_A0()    (PORTB &= ~(1 << PB3))                      // Command
54
#define set_scl()   (PORTB |=  (1 << PB7))
55
#define clr_scl()   (PORTB &= ~(1 << PB7))
56
#define set_si()    (PORTB |=  (1 << PB5))
57
#define clr_si()    (PORTB &= ~(1 << PB5))
58
 
59
#define set_LED1()      (PORTC &= ~(1 << PC3))
60
#define clr_LED1()      (PORTC |=  (1 << PC3))
61
#define set_LED2()      (PORTC &= ~(1 << PC2))
62
#define clr_LED2()      (PORTC |=  (1 << PC2))
63
#define set_LED3()      (PORTB &= ~(1 << PB1))
64
#define clr_LED3()      (PORTB |=  (1 << PB1))
65
#define set_LED4()      (PORTB &= ~(1 << PB0))
66
#define clr_LED4()      (PORTB |=  (1 << PB0))
67
 
68
#ifdef HWVERSION3_1
69
#define set_BEEP()      (PORTC &= ~(1 << PC6))
70
#define clr_BEEP()      (PORTC |=  (1 << PC6))
71
#endif
72
 
73
#ifdef HWVERSION3_3
74
#define set_BEEP()      (PORTC &= ~(1 << PC7))
75
#define clr_BEEP()      (PORTC |=  (1 << PC7))
76
#endif
77
 
78
#define set_D_LIGHT()   (PORTD |= (1 << PD7))
79
#define clr_D_LIGHT()   (PORTD &= ~(1 << PD7))
80
#define set_WI232CMD()  (PORTD &= ~(1 << PD6))
81
#define clr_WI232CMD()  (PORTD |=  (1 << PD6))
82
 
83
#define NO              0
84
#define NC              1
85
#define FC              2
86
#define MK3MAG  3
87
#define MKGPS   4
88
#define Wi232   5
89
 
90
#define ENABLE_PWM
91
 
92
 
93
 
94
//*****************************************************************************
95
// 
96
extern volatile uint8_t mode;
97
extern uint8_t hardware;
98
extern uint8_t current_hardware;
99
 
100
#endif