Subversion Repositories FlightCtrl

Rev

Rev 270 | Details | Compare with Previous | Last modification | View Log | RSS feed

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