Subversion Repositories MK3Mag

Rev

Rev 29 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
19 killagreg 1
#ifndef _UART_H_
2
#define _UART_H_
1 ingob 3
 
19 killagreg 4
#include <inttypes.h>
1 ingob 5
 
3 ingob 6
#define NICK 0
7
#define ROLL 1
1 ingob 8
 
9
 
19 killagreg 10
#define BAUD_RATE 57600
1 ingob 11
 
19 killagreg 12
 
13
extern uint16_t Debug_Timer;
14
 
15
 
16
void USART0_Init (void);
17
void USART0_EnableTXD(void);
18
void USART0_DisableTXD(void);
19
void USART0_TransmitTxData(void);
20
void USART0_ProcessRxData(void);
29 killagreg 21
int16_t USART0_putchar(int8_t c);
22
void USART0_Print(int8_t *msg);
19 killagreg 23
 
24
 
25
 
30 killagreg 26
typedef struct
1 ingob 27
{
19 killagreg 28
        uint8_t Digital[2];
29
        uint16_t Analog[32];    // Debugvalues
30 killagreg 30
}  DebugOut_t;
1 ingob 31
 
30 killagreg 32
extern DebugOut_t DebugOut;
1 ingob 33
 
34
 
35
 
30 killagreg 36
typedef struct
19 killagreg 37
{
26 killagreg 38
        int16_t Attitude[2];  // nick and roll angle in 0.1 deg
19 killagreg 39
        uint8_t UserParam[2];
40
        uint8_t CalState;
41
        uint8_t Orientation;
30 killagreg 42
}  ExternData_t;
1 ingob 43
 
30 killagreg 44
extern ExternData_t  ExternData;
1 ingob 45
 
46
 
30 killagreg 47
typedef struct
19 killagreg 48
{
49
        uint8_t Digital[2];
50
        uint8_t RemoteButtons;
51
        int8_t  Nick;
52
        int8_t  Roll;
53
        int8_t  Yaw;
54
        uint8_t Gas;
55
        int8_t  Height;
56
        uint8_t Par1;
57
        uint8_t Par2;
58
        uint8_t Par3;
30 killagreg 59
}  ExternControl_t;
1 ingob 60
 
30 killagreg 61
extern ExternControl_t  ExternControl;
1 ingob 62
 
63
 
30 killagreg 64
typedef struct
19 killagreg 65
{
66
        uint8_t Major;
67
        uint8_t Minor;
68
        uint8_t PCCompatible;
69
        uint8_t Reserved[7];
70
}  VersionInfo_t;
1 ingob 71
 
30 killagreg 72
extern VersionInfo_t VersionInfo;
19 killagreg 73
 
29 killagreg 74
extern uint8_t PC_Connected;
75
extern uint8_t FC_Connected;
19 killagreg 76
 
77
#endif //_UART_H_