Subversion Repositories FlightCtrl

Rev

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

Rev Author Line No. Line
595 hbuss 1
 #ifndef _UART_H
1 ingob 2
 #define _UART_H
3
 
4
#define MAX_SENDE_BUFF     150
5
#define MAX_EMPFANGS_BUFF  150
492 hbuss 6
#define DUB_KEY_UP     4
7
#define DUB_KEY_DOWN   8
8
#define DUB_KEY_RIGHT  32
9
#define DUB_KEY_LEFT   16
10
#define DUB_KEY_FIRE   64
1 ingob 11
 
304 ingob 12
void BearbeiteRxDaten(void);
13
 
1 ingob 14
extern unsigned char DebugGetAnforderung;
15
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF];
16
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF];
17
extern unsigned volatile char UebertragungAbgeschlossen;
18
extern unsigned volatile char PC_DebugTimeout;
19
extern unsigned volatile char NeueKoordinateEmpfangen;
20
extern unsigned char MeineSlaveAdresse;
21
extern unsigned char PcZugriff;
499 hbuss 22
extern unsigned char RemotePollDisplayLine;
693 hbuss 23
extern int Debug_Timer,Kompass_Timer;
1 ingob 24
extern void UART_Init (void);
25
extern int uart_putchar (char c);
26
extern void boot_program_page (uint32_t page, uint8_t *buf);
27
extern void DatenUebertragung(void);
28
extern void DecodeNMEA(void);
395 hbuss 29
extern void BearbeiteRxDaten(void);
1 ingob 30
extern unsigned char MotorTest[4];
595 hbuss 31
extern unsigned char DubWiseKeys[4];
1 ingob 32
struct str_DebugOut
33
{
173 holgerb 34
 unsigned char Digital[2];
35
 unsigned int Analog[32];    // Debugwerte
1 ingob 36
};
37
 
38
extern struct str_DebugOut    DebugOut;
39
 
693 hbuss 40
struct str_WinkelOut
41
{
42
 unsigned int Winkel[2];
43
};
44
extern struct str_WinkelOut  WinkelOut;
45
 
46
 
595 hbuss 47
struct str_ExternControl
1 ingob 48
{
49
 unsigned char Digital[2];
50
 unsigned char RemoteTasten;
595 hbuss 51
 signed char   Nick;
52
 signed char   Roll;
53
 signed char   Gier;
54
 unsigned char Gas;
55
 signed char   Hight;
56
 unsigned char free;
57
 unsigned char Frame;
58
 unsigned char Config;
1 ingob 59
};
595 hbuss 60
extern struct str_ExternControl   ExternControl;
1 ingob 61
 
62
struct str_VersionInfo
63
{
64
  unsigned char Hauptversion;
65
  unsigned char Nebenversion;
66
  unsigned char PCKompatibel;
67
  unsigned char Rserved[7];
68
};  
69
extern struct str_VersionInfo VersionInfo;
70
 
71
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud
72
//#define BAUD_RATE 9600                //Baud Rate für die Serielle Schnittstelle      
73
//#define BAUD_RATE 14400               //Baud Rate für die Serielle Schnittstelle      
74
//#define BAUD_RATE 28800               //Baud Rate für die Serielle Schnittstelle      
75
//#define BAUD_RATE 38400               //Baud Rate für die Serielle Schnittstelle      
76
#define BAUD_RATE 57600         //Baud Rate für die Serielle Schnittstelle      
77
 
78
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird
79
#if defined (__AVR_ATmega128__)
80
#       define USR UCSR0A
81
#       define UCR UCSR0B
82
#       define UDR UDR0
83
#       define UBRR UBRR0L
84
#       define EICR EICRB
85
#endif
86
 
87
#if defined (__AVR_ATmega32__)
88
#       define USR UCSRA
89
#       define UCR UCSRB
90
#       define UBRR UBRRL
91
#       define EICR EICRB
92
#   define INT_VEC_RX  SIG_UART_RECV
93
#   define INT_VEC_TX  SIG_UART_TRANS
94
#endif
95
 
96
#if defined (__AVR_ATmega644__)
97
#       define USR  UCSR0A
98
#       define UCR  UCSR0B
99
#       define UDR  UDR0
100
#       define UBRR UBRR0L
101
#       define EICR EICR0B
102
#   define TXEN TXEN0
103
#   define RXEN RXEN0
104
#   define RXCIE RXCIE0
105
#   define TXCIE TXCIE0
106
#   define U2X  U2X0
107
#   define UCSRB UCSR0B
108
#   define UDRE UDRE0
109
#   define INT_VEC_RX  SIG_USART_RECV
110
#   define INT_VEC_TX  SIG_USART_TRANS
111
#endif
112
 
113
 
114
#endif //_UART_H