MAV'RIC
turnigy.h
1 /*
2  * turnigy.h
3  *
4  * Created on: Aug 27, 2013
5  * Author: ndousse
6  */
7 
8 #ifndef TURNIGY_H_
9 #define TURNIGY_H_
10 
11 #include "compiler.h"
12 #include "buffer.h"
13 #include "stabilisation.h"
14 
15 #define BAUD_REMOTE 115200
16 
17 #define RC_THROTTLE 0
18 #define RC_THROTTLE_DIR 1
19 
20 #define RC_ROLL 1
21 #define RC_ROLL_DIR 1
22 
23 #define RC_PITCH 2
24 #define RC_PITCH_DIR -1
25 
26 #define RC_YAW 3
27 #define RC_YAW_DIR 1
28 
29 #define RC_SAFETY 4
30 #define RC_ID_MODE 5
31 #define RC_TRIM_P3 6
32 #define RC_TRIM_P1 7
33 #define RC_TRIM_P2 8
34 
35 #define DEADZONE 30.0
36 
37 #define RC_SCALEFACTOR 1.0/880.0
38 
39 /*
40 typedef struct Turnigy_Receiver {
41  buffer_t receiver;
42  uint16_t channels[16];
43  uint32_t last_update;
44  uint8_t valid;
45  uint32_t last_time;
46  uint32_t duration;
47 } Turnigy_Receiver_t;
48 
49 void turnigy_init (void);
50 int16_t getChannel_turnigy(uint8_t index);
51 void centerChannel_turnigy(uint8_t index);
52 int16_t getChannelNeutral_turnigy(uint8_t index);
53 int8_t checkReceiver1_turnigy(void);
54 int8_t checkReceiver2_turnigy(void);
55 int8_t checkReceivers_turnigy(void);
56 
57 control_command_t get_command_from_turnigy();
58 float get_roll_from_turnigy();
59 float get_pitch_from_turnigy();
60 float get_yaw_from_turnigy();
61 float get_thrust_from_turnigy();
62 
63 void get_channel_mode_turnigy(uint8_t* chan_switch);
64 */
65 #endif //TURNIGY_H_