Subversion Repositories MK3Mag

Rev

Rev 21 | Rev 29 | Go to most recent revision | 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 Debug_Timer;


void USART0_Init (void);
void USART0_EnableTXD(void);
void USART0_DisableTXD(void);
void USART0_TransmitTxData(void);
void USART0_ProcessRxData(void);
int uart_putchar (int8_t c);



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

extern struct DebugOut_t DebugOut;



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

extern struct ExternData_t  ExternData;


struct ExternControl_t
{
        uint8_t Digital[2];
        uint8_t RemoteButtons;
        int8_t  Nick;
        int8_t  Roll;
        int8_t  Yaw;
        uint8_t Gas;
        int8_t  Height;
        uint8_t Par1;
        uint8_t Par2;
        uint8_t Par3;
} ;

extern struct ExternControl_t  ExternControl;


struct VersionInfo_t
{
        uint8_t Major;
        uint8_t Minor;
        uint8_t PCCompatible;
        uint8_t Reserved[7];
}  VersionInfo_t;

extern struct VersionInfo_t VersionInfo;


#endif //_UART_H_