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