Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

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