Subversion Repositories FlightCtrl

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
595 hbuss 1
 #ifndef _UART_H
1 ingob 2
 #define _UART_H
3
 
4
#define MAX_SENDE_BUFF     150
5
#define MAX_EMPFANGS_BUFF  150
6
 
304 ingob 7
void BearbeiteRxDaten(void);
8
 
1 ingob 9
extern unsigned char DebugGetAnforderung;
10
extern unsigned volatile char SendeBuffer[MAX_SENDE_BUFF];
11
extern unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF];
12
extern unsigned volatile char UebertragungAbgeschlossen;
13
extern unsigned volatile char PC_DebugTimeout;
14
extern unsigned volatile char NeueKoordinateEmpfangen;
15
extern unsigned char MeineSlaveAdresse;
16
extern unsigned char PcZugriff;
499 hbuss 17
extern unsigned char RemotePollDisplayLine;
693 hbuss 18
extern int Debug_Timer,Kompass_Timer;
1 ingob 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);
395 hbuss 24
extern void BearbeiteRxDaten(void);
1 ingob 25
extern unsigned char MotorTest[4];
26
struct str_DebugOut
27
{
173 holgerb 28
 unsigned char Digital[2];
805 hbuss 29
 signed int Analog[32];    // Debugwerte
1 ingob 30
};
31
 
32
extern struct str_DebugOut    DebugOut;
33
 
693 hbuss 34
struct str_WinkelOut
35
{
849 hbuss 36
   signed int  Winkel[2];
819 hbuss 37
 unsigned char UserParameter[2];
1051 killagreg 38
 unsigned char CalcState;
819 hbuss 39
 unsigned char Orientation;
693 hbuss 40
};
41
extern struct str_WinkelOut  WinkelOut;
42
 
595 hbuss 43
struct str_ExternControl
1 ingob 44
{
45
 unsigned char Digital[2];
46
 unsigned char RemoteTasten;
595 hbuss 47
 signed char   Nick;
48
 signed char   Roll;
49
 signed char   Gier;
50
 unsigned char Gas;
51
 signed char   Hight;
52
 unsigned char free;
53
 unsigned char Frame;
54
 unsigned char Config;
1051 killagreg 55
};
595 hbuss 56
extern struct str_ExternControl   ExternControl;
1 ingob 57
 
58
struct str_VersionInfo
59
{
1051 killagreg 60
  unsigned char Major;
61
  unsigned char Minor;
991 ingob 62
  unsigned char Patch;
1051 killagreg 63
  unsigned char Compatible;
64
  unsigned char Reserved[6];
65
};
1 ingob 66
extern struct str_VersionInfo VersionInfo;
67
 
68
//Die Baud_Rate der Seriellen Schnittstelle ist 9600 Baud
1051 killagreg 69
//#define BAUD_RATE 9600                //Baud Rate für die Serielle Schnittstelle
70
//#define BAUD_RATE 14400               //Baud Rate für die Serielle Schnittstelle
71
//#define BAUD_RATE 28800               //Baud Rate für die Serielle Schnittstelle
72
//#define BAUD_RATE 38400               //Baud Rate für die Serielle Schnittstelle
73
#define BAUD_RATE 57600         //Baud Rate für die Serielle Schnittstelle
1 ingob 74
 
75
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird
76
#if defined (__AVR_ATmega128__)
77
#       define USR UCSR0A
78
#       define UCR UCSR0B
79
#       define UDR UDR0
80
#       define UBRR UBRR0L
81
#       define EICR EICRB
82
#endif
83
 
84
#if defined (__AVR_ATmega32__)
85
#       define USR UCSRA
86
#       define UCR UCSRB
87
#       define UBRR UBRRL
88
#       define EICR EICRB
89
#   define INT_VEC_RX  SIG_UART_RECV
90
#   define INT_VEC_TX  SIG_UART_TRANS
91
#endif
92
 
93
#if defined (__AVR_ATmega644__)
94
#       define USR  UCSR0A
95
#       define UCR  UCSR0B
96
#       define UDR  UDR0
97
#       define UBRR UBRR0L
98
#       define EICR EICR0B
99
#   define TXEN TXEN0
100
#   define RXEN RXEN0
101
#   define RXCIE RXCIE0
102
#   define TXCIE TXCIE0
103
#   define U2X  U2X0
104
#   define UCSRB UCSR0B
105
#   define UDRE UDRE0
106
#   define INT_VEC_RX  SIG_USART_RECV
107
#   define INT_VEC_TX  SIG_USART_TRANS
108
#endif
109
 
110
 
111
#endif //_UART_H