Rev 935 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 935 | Rev 936 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | #define _SPI_H |
3 | #define _SPI_H |
Line 4... | Line 4... | ||
4 | 4 | ||
5 | //#include <util/delay.h> |
5 | //#include <util/delay.h> |
Line 6... | Line -... | ||
6 | #include <inttypes.h> |
- | |
Line 7... | Line 6... | ||
7 | 6 | #include <inttypes.h> |
|
Line 8... | Line 7... | ||
8 | #define USE_SPI_COMMUNICATION |
7 | |
9 | 8 | ||
Line 52... | Line 51... | ||
52 | 51 | ||
53 | 52 | ||
54 | #define SPI_CMD_USER 10 |
53 | #define SPI_CMD_USER 10 |
- | 54 | #define SPI_CMD_STICK 11 |
|
Line 55... | Line 55... | ||
55 | #define SPI_CMD_STICK 11 |
55 | #define SPI_CMD_CAL_COMPASS 12 |
56 | #define SPI_CMD_CAL_COMPASS 12 |
56 | #define SPI_CMD_PARAMETER1 13 |
57 | 57 | ||
58 | typedef struct |
58 | typedef struct |
Line 91... | Line 91... | ||
91 | int16_t GPS_Nick; |
91 | int16_t GPS_Nick; |
92 | int16_t GPS_Roll; |
92 | int16_t GPS_Roll; |
93 | int16_t GPS_Yaw; |
93 | int16_t GPS_Yaw; |
94 | int16_t CompassHeading; |
94 | int16_t CompassHeading; |
95 | int16_t Status; |
95 | int16_t Status; |
96 | uint8_t BeepTime; |
96 | uint16_t BeepTime; |
97 | union |
97 | union |
98 | { |
98 | { |
99 | int8_t Byte[12]; |
99 | int8_t Byte[12]; |
100 | int16_t Int[6]; |
100 | int16_t Int[6]; |
101 | int32_t Long[3]; |
101 | int32_t Long[3]; |
102 | float Float[3]; |
102 | float Float[3]; |
103 | } Param; |
103 | } Param; |
104 | uint8_t Chksum; |
104 | uint8_t Chksum; |
105 | } FromNaviCtrl_t; |
105 | } FromNaviCtrl_t; |
Line 106... | Line -... | ||
106 | - | ||
Line 107... | Line 106... | ||
107 | #ifdef USE_SPI_COMMUNICATION |
106 | |
108 | 107 | ||
Line 109... | Line 108... | ||
109 | extern ToNaviCtrl_t ToNaviCtrl; |
108 | extern ToNaviCtrl_t ToNaviCtrl; |
110 | extern FromNaviCtrl_t FromNaviCtrl; |
109 | extern FromNaviCtrl_t FromNaviCtrl; |
111 | 110 | ||
112 | extern void SPI_MasterInit(void); |
- | |
Line 113... | Line -... | ||
113 | extern void SPI_StartTransmitPacket(void); |
- | |
114 | extern void SPI_TransmitByte(void); |
- | |
115 | #else |
- | |
116 | - | ||
117 | - | ||
118 | // -------------------------------- Dummy ----------------------------------------- |
- | |
119 | #define SPI_MasterInit() ; |
- | |
Line 120... | Line 111... | ||
120 | #define SPI_StartTransmitPacket() ; |
111 | void SPI_MasterInit(void); |