Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1645 | - | 1 | /*********************************************************************************/ |
2 | /* Stick control interface */ |
||
3 | /*********************************************************************************/ |
||
1612 | dongfang | 4 | /* |
1616 | dongfang | 5 | OBSOLETED BY controlMixer.h. But this is how it looked - maybe somebody will find it simpler? |
1612 | dongfang | 6 | |
7 | #ifndef _CONTROL_H |
||
8 | #define _CONTROL_H |
||
9 | |||
10 | #include <inttypes.h> |
||
1645 | - | 11 | #define CONTROL_SCALING 4 |
1612 | dongfang | 12 | |
13 | // defines for lookup staticParams.ChannelAssignment |
||
14 | #define CH_PITCH 0 |
||
1645 | - | 15 | #define CH_ROLL 1 |
16 | #define CH_THROTTLE 2 |
||
17 | #define CH_YAW 3 |
||
1612 | dongfang | 18 | #define CH_POTS 4 |
19 | #define POT_OFFSET 110 |
||
20 | |||
21 | extern int16_t stickPitch, stickRoll, stickYaw, stickThrottle; |
||
22 | extern int16_t stickOffsetNick, stickOffsetRoll; |
||
23 | extern uint16_t maxStickPitch, maxStickRoll; |
||
24 | extern uint8_t loopingPitch, loopingRoll; |
||
25 | |||
26 | // external control |
||
27 | extern int16_t externalStickPitch, externalStickRoll, externalStickYaw; |
||
28 | |||
29 | // current GPS-stick values |
||
30 | extern int16_t GPSStickPitch, GPSStickRoll; |
||
31 | |||
32 | typedef struct { |
||
33 | uint8_t digital[2]; |
||
34 | uint8_t eemoteButtons; |
||
35 | int8_t pitch; |
||
36 | int8_t roll; |
||
37 | int8_t yaw; |
||
38 | uint8_t throttle; |
||
39 | int8_t height; |
||
40 | uint8_t free; |
||
41 | uint8_t frame; |
||
42 | uint8_t config; |
||
43 | } __attribute__((packed)) ExternalControl_t; |
||
44 | |||
45 | extern ExternalControl_t externalControl; |
||
46 | |||
47 | //uint8_t control_getLeftStickCalibrateIndex(void); |
||
48 | //uint8_t control_getLeftStickMotorStartIndex(void); |
||
49 | //uint8_t control_getRightRCStickIndex(void); |
||
50 | void control_initPots(void); |
||
51 | void control_updatePots(void); |
||
52 | |||
53 | void setCompassCalState(void); |
||
54 | void updateCompass(void); |
||
55 | |||
56 | void control_setNeutral(void); |
||
57 | void control_update(void); |
||
58 | |||
59 | #define STICK_COMMAND_UNDEF 0 |
||
60 | #define STICK_COMMAND_START 6 |
||
61 | #define STICK_COMMAND_STOP 8 |
||
62 | #define STICK_COMMAND_GYROCAL 2 |
||
63 | #define STICK_COMMAND_ACCCAL 4 |
||
64 | |||
65 | void control_senseStickCommands(void); |
||
66 | uint8_t control_getStickCommand(void); |
||
67 | uint8_t control_isStickCommandRepeated(void); |
||
68 | |||
69 | void control_performPilotCalibrationCommands(uint8_t stickCommand); |
||
70 | |||
71 | extern volatile int16_t RC_Quality; // rc signal quality indicator (0 to 200) |
||
72 | extern uint8_t control_hasNewRCData(void); |
||
73 | |||
74 | #endif //_CONTROL_H |
||
75 | */ |
||
1775 | - | 76 |