Subversion Repositories FlightCtrl

Rev

Go to most recent revision | Details | 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
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;
22
extern int Debug_Timer;
23
extern void UART_Init (void);
24
extern int uart_putchar (char c);
25
extern void boot_program_page (uint32_t page, uint8_t *buf);
26
extern void DatenUebertragung(void);
27
extern void DecodeNMEA(void);
395 hbuss 28
extern void BearbeiteRxDaten(void);
1 ingob 29
extern unsigned char MotorTest[4];
492 hbuss 30
extern unsigned char DubWiseKeys[3];
1 ingob 31
struct str_DebugOut
32
{
173 holgerb 33
 unsigned char Digital[2];
34
 unsigned int Analog[32];    // Debugwerte
1 ingob 35
};
36
 
37
extern struct str_DebugOut    DebugOut;
38
 
39
struct str_Debug
40
{
41
 unsigned char Digital[2];
42
 unsigned char RemoteTasten;
43
 unsigned int Analog[4];
44
};
45
extern struct str_Debug       DebugIn;
46
 
47
struct str_VersionInfo
48
{
49
  unsigned char Hauptversion;
50
  unsigned char Nebenversion;
51
  unsigned char PCKompatibel;
52
  unsigned char Rserved[7];
53
};  
54
extern struct str_VersionInfo VersionInfo;
55
 
56
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud
57
//#define BAUD_RATE 9600                //Baud Rate für die Serielle Schnittstelle      
58
//#define BAUD_RATE 14400               //Baud Rate für die Serielle Schnittstelle      
59
//#define BAUD_RATE 28800               //Baud Rate für die Serielle Schnittstelle      
60
//#define BAUD_RATE 38400               //Baud Rate für die Serielle Schnittstelle      
61
#define BAUD_RATE 57600         //Baud Rate für die Serielle Schnittstelle      
62
 
63
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird
64
#if defined (__AVR_ATmega128__)
65
#       define USR UCSR0A
66
#       define UCR UCSR0B
67
#       define UDR UDR0
68
#       define UBRR UBRR0L
69
#       define EICR EICRB
70
#endif
71
 
72
#if defined (__AVR_ATmega32__)
73
#       define USR UCSRA
74
#       define UCR UCSRB
75
#       define UBRR UBRRL
76
#       define EICR EICRB
77
#   define INT_VEC_RX  SIG_UART_RECV
78
#   define INT_VEC_TX  SIG_UART_TRANS
79
#endif
80
 
81
#if defined (__AVR_ATmega644__)
82
#       define USR  UCSR0A
83
#       define UCR  UCSR0B
84
#       define UDR  UDR0
85
#       define UBRR UBRR0L
86
#       define EICR EICR0B
87
#   define TXEN TXEN0
88
#   define RXEN RXEN0
89
#   define RXCIE RXCIE0
90
#   define TXCIE TXCIE0
91
#   define U2X  U2X0
92
#   define UCSRB UCSR0B
93
#   define UDRE UDRE0
94
#   define INT_VEC_RX  SIG_USART_RECV
95
#   define INT_VEC_TX  SIG_USART_TRANS
96
#endif
97
 
98
 
99
#endif //_UART_H