Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
683 killagreg 1
#ifndef _UART_H
2
#define _UART_H
1 ingob 3
 
683 killagreg 4
#define TXD_BUFFER_LEN  150
5
#define RXD_BUFFER_LEN  150
6
 
492 hbuss 7
#define DUB_KEY_UP     4
8
#define DUB_KEY_DOWN   8
9
#define DUB_KEY_RIGHT  32
10
#define DUB_KEY_LEFT   16
11
#define DUB_KEY_FIRE   64
1 ingob 12
 
685 killagreg 13
#include <inttypes.h>
14
 
304 ingob 15
void BearbeiteRxDaten(void);
16
 
1 ingob 17
extern unsigned char DebugGetAnforderung;
683 killagreg 18
 
19
//Baud rate of the USART
20
#define USART0_BAUD 57600
21
 
22
 
23
extern void USART0_Init (void);
24
 
25
extern unsigned volatile char txd_buffer[TXD_BUFFER_LEN];
26
extern unsigned volatile char rxd_buffer[RXD_BUFFER_LEN];
27
 
1 ingob 28
extern unsigned volatile char UebertragungAbgeschlossen;
29
extern unsigned volatile char PC_DebugTimeout;
30
extern unsigned volatile char NeueKoordinateEmpfangen;
31
extern unsigned char MeineSlaveAdresse;
32
extern unsigned char PcZugriff;
499 hbuss 33
extern unsigned char RemotePollDisplayLine;
1 ingob 34
extern int Debug_Timer;
683 killagreg 35
 
36
extern int16_t uart_putchar (int8_t c);
1 ingob 37
extern void boot_program_page (uint32_t page, uint8_t *buf);
38
extern void DatenUebertragung(void);
683 killagreg 39
 
395 hbuss 40
extern void BearbeiteRxDaten(void);
1 ingob 41
extern unsigned char MotorTest[4];
683 killagreg 42
extern unsigned char DubWiseKeys[4];
1 ingob 43
struct str_DebugOut
44
{
173 holgerb 45
 unsigned char Digital[2];
46
 unsigned int Analog[32];    // Debugwerte
1 ingob 47
};
48
 
49
extern struct str_DebugOut    DebugOut;
50
 
595 hbuss 51
struct str_ExternControl
1 ingob 52
{
701 killagreg 53
 uint8_t        Digital[2];
54
 uint8_t        RemoteButtons;
55
 int8_t         Pitch;
56
 int8_t         Roll;
57
 int8_t         Yaw;
58
 uint8_t        Gas;
59
 int8_t         Hight;
60
 uint8_t        free;
61
 uint8_t        Frame;
62
 uint8_t        Config;
683 killagreg 63
};
595 hbuss 64
extern struct str_ExternControl   ExternControl;
1 ingob 65
 
66
struct str_VersionInfo
67
{
68
  unsigned char Hauptversion;
69
  unsigned char Nebenversion;
70
  unsigned char PCKompatibel;
683 killagreg 71
  unsigned char Rserved[7];
72
};
1 ingob 73
extern struct str_VersionInfo VersionInfo;
74
 
75
 
76
#if defined (__AVR_ATmega644__)
77
#       define USR  UCSR0A
78
#       define UCR  UCSR0B
79
#       define UDR  UDR0
80
#       define UBRR UBRR0L
81
#       define EICR EICR0B
82
#   define TXEN TXEN0
83
#   define RXEN RXEN0
84
#   define RXCIE RXCIE0
85
#   define TXCIE TXCIE0
86
#   define U2X  U2X0
87
#   define UCSRB UCSR0B
88
#   define UDRE UDRE0
89
#   define INT_VEC_RX  SIG_USART_RECV
90
#   define INT_VEC_TX  SIG_USART_TRANS
91
#endif
92
 
93
 
94
#endif //_UART_H