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