Fix doc path
[opentx.git] / radio / src / templates.h
blob2fe5a34fa30c765d0b3160cc450e58bc61ac1655
1 /*
2 * Copyright (C) OpenTX
4 * Based on code named
5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
22 * ============================================================
23 * Templates file
25 * eccpm
26 * crow
27 * throttle cut
28 * flaperon
29 * elevon
30 * v-tail
31 * throttle hold
32 * Aileron Differential
33 * Spoilers
34 * Snap Roll
35 * ELE->Flap
36 * Flap->ELE
40 #ifndef _TEMPLATES_H_
41 #define _TEMPLATES_H_
43 #include <inttypes.h>
45 #define STK_RUD 1
46 #define STK_ELE 2
47 #define STK_THR 3
48 #define STK_AIL 4
49 #define STK_P1 5
50 #define STK_P2 6
51 #define STK_P3 7
53 #define CV(x) (CURVE_BASE+(x)-1)
54 #define CC(x) (MIXSRC_Rud - 1 + channel_order(x)) // need to invert this to work with dest
56 #if defined(PCBTARANIS)
57 #define mixSetCurve(mix, idx) mix->curve.type=CURVE_REF_CUSTOM; mix->curve.value=idx
58 #else
59 #define mixSetCurve(mix, idx) mix->curveMode=MODE_CURVE; mix->curveParam=CURVE_BASE+idx
60 #endif
62 enum Templates {
63 TMPL_CLEAR_MIXES,
64 TMPL_SIMPLE_4CH,
65 TMPL_STI_THR_CUT,
66 TMPL_V_TAIL,
67 TMPL_ELEVON_DELTA,
68 TMPL_ECCPM,
69 #if defined(HELI) && defined(CURVES)
70 TMPL_HELI_SETUP,
71 #endif
72 TMPL_SERVO_TEST,
73 TMPL_COUNT
76 void clearMixes();
77 void clearCurves();
78 void applyTemplate(uint8_t idx);
80 #endif // _TEMPLATES_H_