Subversion Repositories MK3Mag

Rev

Rev 18 | Rev 23 | 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);
int16_t uart_putchar(int8_t c);



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

extern DebugOut_t DebugOut;



typedef struct
{
        int16_t Attitude[2];  // nock 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 Par1;
        uint8_t Par2;
        uint8_t Par3;
} ExternControl_t;

extern ExternControl_t  ExternControl;


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

extern VersionInfo_t VersionInfo;


#endif //_UART_H_