Subversion Repositories FlightCtrl

Rev

Rev 1775 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1775 Rev 1821
Line 11... Line 11...
11
#define SPI_CMD_MISC            12
11
#define SPI_CMD_MISC            12
12
#define SPI_CMD_PARAMETER1      13
12
#define SPI_CMD_PARAMETER1      13
13
#define SPI_CMD_VERSION         14
13
#define SPI_CMD_VERSION         14
Line 14... Line 14...
14
 
14
 
15
typedef struct {
15
typedef struct {
16
  uint8_t Sync1;
16
        uint8_t Sync1;
17
  uint8_t Sync2;
17
        uint8_t Sync2;
18
  uint8_t Command;
18
        uint8_t Command;
19
  int16_t IntegralPitch;
19
        int16_t IntegralPitch;
20
  int16_t IntegralRoll;
20
        int16_t IntegralRoll;
21
  int16_t AccPitch;
21
        int16_t AccPitch;
22
  int16_t AccRoll;
22
        int16_t AccRoll;
23
  int16_t GyroHeading;
23
        int16_t GyroHeading;
24
  int16_t GyroPitch;
24
        int16_t GyroPitch;
25
  int16_t GyroRoll;
25
        int16_t GyroRoll;
26
  int16_t GyroYaw;
26
        int16_t GyroYaw;
27
  union {
27
        union {
28
    int8_t  sByte[12];
28
                int8_t sByte[12];
29
    uint8_t Byte[12];
29
                uint8_t Byte[12];
30
    int16_t Int[6];
30
                int16_t Int[6];
31
    int32_t Long[3];
31
                int32_t Long[3];
32
    float   Float[3];
32
                float Float[3];
33
  } Param;
33
        } Param;
34
  uint8_t Chksum;
34
        uint8_t Chksum;
Line 35... Line 35...
35
} __attribute__((packed)) ToNaviCtrl_t;
35
}__attribute__((packed)) ToNaviCtrl_t;
36
 
36
 
37
#define SPI_CMD_OSD_DATA        100
37
#define SPI_CMD_OSD_DATA        100
38
#define SPI_CMD_GPS_POS         101
38
#define SPI_CMD_GPS_POS         101
Line 39... Line 39...
39
#define SPI_CMD_GPS_TARGET      102
39
#define SPI_CMD_GPS_TARGET      102
40
#define SPI_KALMAN                      103
40
#define SPI_KALMAN                      103
41
 
41
 
42
typedef struct {
42
typedef struct {
43
  uint8_t Command;
43
        uint8_t Command;
44
  int16_t GPSStickPitch;
44
        int16_t GPSStickPitch;
45
  int16_t GPSStickRoll;
45
        int16_t GPSStickRoll;
46
  int16_t GPS_Yaw;
46
        int16_t GPS_Yaw;
47
  int16_t CompassHeading;
47
        int16_t CompassHeading;
48
  int16_t Status;
48
        int16_t Status;
49
  uint16_t BeepTime;
49
        uint16_t BeepTime;
50
  union {
50
        union {
51
    int8_t  Byte[12];
51
                int8_t Byte[12];
52
    int16_t Int[6];
52
                int16_t Int[6];
53
    int32_t Long[3];
53
                int32_t Long[3];
54
    float   Float[3];
54
                float Float[3];
Line 55... Line 55...
55
  } Param;
55
        } Param;
56
  uint8_t Chksum;
56
        uint8_t Chksum;
57
} __attribute__((packed)) FromNaviCtrl_t;
57
}__attribute__((packed)) FromNaviCtrl_t;
58
 
58
 
59
typedef struct {
59
typedef struct {
60
  uint8_t Major;
60
        uint8_t Major;
61
  uint8_t Minor;
61
        uint8_t Minor;
Line 62... Line 62...
62
  uint8_t Patch;
62
        uint8_t Patch;
63
  uint8_t Compatible;
63
        uint8_t Compatible;
Line 64... Line 64...
64
  //    unsigned char Hardware;
64
//    unsigned char Hardware;
65
} __attribute__((packed)) SPI_VersionInfo_t;
65
}__attribute__((packed)) SPI_VersionInfo_t;
66
 
66
 
67
extern ToNaviCtrl_t                     toNaviCtrl;
67
extern ToNaviCtrl_t toNaviCtrl;
68
extern FromNaviCtrl_t                   fromNaviCtrl;
68
extern FromNaviCtrl_t fromNaviCtrl;
69
 
69
 
Line 70... Line 70...
70
typedef struct {
70
typedef struct {
71
  int8_t        KalmanK;
71
        int8_t KalmanK;
Line 72... Line 72...
72
  int8_t        KalmanMaxDrift;
72
        int8_t KalmanMaxDrift;