Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

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