Subversion Repositories MK3Mag


Rev 53 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef _UART_H_
#define _UART_H_

#include <inttypes.h>

#define NICK 0
#define ROLL 1

#define BAUD_RATE 57600

extern uint16_t DebugData_Timer;

void USART0_Init (void);
void USART0_EnableTXD(void);
void USART0_DisableTXD(void);
void USART0_TransmitTxData(void);
void USART0_ProcessRxData(void);
int16_t USART0_putchar(int8_t c);
void USART0_Print(int8_t *msg);

typedef struct
        uint8_t Digital[2];
        uint16_t Analog[32];    // Debugvalues
}  DebugOut_t;

extern DebugOut_t DebugOut;

typedef struct
        int16_t Attitude[2];  // nick and roll angle in 0.1 deg
        uint8_t UserParam[2];
        uint8_t CalState;
        uint8_t Orientation;
}  ExternData_t;

extern ExternData_t  ExternData;

typedef struct
        uint8_t Digital[2];
        uint8_t RemoteButtons;
        int8_t  Nick;
        int8_t  Roll;
        int8_t  Yaw;
        uint8_t Gas;
        int8_t  Height;
        uint8_t free;
        uint8_t Frame;
        uint8_t Config;
}  ExternControl_t;

extern ExternControl_t  ExternControl;

typedef struct
        uint8_t SWMajor;
        uint8_t SWMinor;
        uint8_t ProtoMajor;
        uint8_t ProtoMinor;
        uint8_t SWPatch;
        uint8_t Reserved[5];
}  UART_VersionInfo_t;

extern uint16_t PC_Connected;
extern uint16_t FC_Connected;

#endif //_UART_H_