Subversion Repositories FlightCtrl

Rev

Rev 712 | Blame | Last modification | View Log | RSS feed

#ifndef _UART_H
#define _UART_H

#define TXD_BUFFER_LEN  150
#define RXD_BUFFER_LEN  150

#define DUB_KEY_UP     4
#define DUB_KEY_DOWN   8
#define DUB_KEY_LEFT   16
#define DUB_KEY_RIGHT  32
#define DUB_KEY_FIRE   64

#include <inttypes.h>

void BearbeiteRxDaten(void);

extern unsigned char DebugGetAnforderung;

//Baud rate of the USART
#define USART0_BAUD 57600


extern void USART0_Init (void);

extern unsigned volatile char txd_buffer[TXD_BUFFER_LEN];
extern unsigned volatile char rxd_buffer[RXD_BUFFER_LEN];

extern unsigned volatile char UebertragungAbgeschlossen;
extern unsigned volatile char PC_DebugTimeout;
extern unsigned volatile char NeueKoordinateEmpfangen;
extern unsigned char MeineSlaveAdresse;
extern unsigned char PcAccess;
extern unsigned char RemotePollDisplayLine;
extern int Debug_Timer;

extern int16_t uart_putchar (int8_t c);
extern void boot_program_page (uint32_t page, uint8_t *buf);
extern void DatenUebertragung(void);

extern void BearbeiteRxDaten(void);
extern unsigned char MotorTest[4];
extern unsigned char DubWiseKeys[4];
struct str_DebugOut
{
 uint8_t Digital[2];
 uint16_t Analog[32];    // Debugwerte
};

extern struct str_DebugOut    DebugOut;

struct str_ExternControl
{
 uint8_t        Digital[2];
 uint8_t        RemoteButtons;
 int8_t         Pitch;
 int8_t         Roll;
 int8_t         Yaw;
 uint8_t        Thrust;
 int8_t         Hight;
 uint8_t        free;
 uint8_t        Frame;
 uint8_t        Config;
};
extern struct str_ExternControl   ExternControl;

struct str_VersionInfo
{
  unsigned char Hauptversion;
  unsigned char Nebenversion;
  unsigned char PCKompatibel;
  unsigned char Rserved[7];
};
extern struct str_VersionInfo VersionInfo;


#endif //_UART_H