Subversion Repositories FlightCtrl

Rev

Rev 2159 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2159 Rev 2189
1
#ifndef _UART0_H
1
#ifndef _UART0_H
2
#define _UART0_H
2
#define _UART0_H
3
 
3
 
4
#define TXD_BUFFER_LEN  150
4
#define TXD_BUFFER_LEN  140
5
#define RXD_BUFFER_LEN  150
5
#define RXD_BUFFER_LEN  140
-
 
6
 
6
 
7
#include <inttypes.h>
7
#include <inttypes.h>
8
#include <stdio.h>
8
#include "ubx.h"
9
#include "ubx.h"
9
 
10
 
10
//Baud rate of the USART
11
//Baud rate of the USART
11
#define USART0_BAUD 57600
12
#define USART0_BAUD 57600
12
 
13
 
13
extern void usart0_init(void);
14
extern void usart0_init(void);
14
extern void usart0_transmitTxData(void);
15
extern void usart0_transmitTxData(void);
15
extern void usart0_processRxData(void);
16
extern void usart0_processRxData(void);
16
extern int16_t uart_putchar(int8_t c);
17
//extern int16_t uart_putchar(int8_t c);
-
 
18
 
-
 
19
extern int uart_putchar(char c, FILE* fims);
17
 
20
 
18
// extern uint8_t remotePollDisplayLine;
21
// extern uint8_t remotePollDisplayLine;
19
 
22
 
20
extern uint8_t motorTestActive;
23
extern uint8_t outputTestActive;
21
extern uint8_t motorTest[16];
24
extern uint8_t outputTest[16];
-
 
25
 
-
 
26
typedef struct {
-
 
27
  float pitchRate;  // in radians
-
 
28
  float rollRate;   // in radians
22
 
29
  float yawRate;    // in radians
23
typedef struct {
30
 
24
  int16_t anglePitch; // in 0.1 deg
31
  float pitch; // in radians
-
 
32
  float roll;  // in radians
-
 
33
  float heading;    // in radians
-
 
34
 
25
  int16_t angleRoll;  // in 0.1 deg
35
  float xAcc;
26
  int16_t heading;    // in 0.1 deg
36
  float yAcc;
27
  uint8_t reserved[8];
37
  float zAcc;
28
}__attribute__((packed)) Data3D_t;
38
}__attribute__((packed)) IMUData;
29
 
39
 
30
typedef struct {
40
typedef struct {
31
  Data3D_t attitude;
41
  IMUData imuData;
32
  GPS_INFO_t GPSInfo;
42
  GPS_INFO_t GPSInfo;
33
  int32_t airpressureHeight;
43
  int32_t airpressureHeight;
34
  int16_t batteryVoltage;
44
  int16_t batteryVoltage;
35
}__attribute__((packed)) OSDData_t;
45
}__attribute__((packed)) OSDData_t;
36
 
46
 
37
#endif //_UART0_H
47
#endif //_UART0_H
38
 
48