New SPI API supporting DMA
[betaflight.git] / src / main / config / feature.h
blobb62533d5e2ac093f231dc084ca2361742fe2bc9f
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #include "pg/pg.h"
25 #ifndef DEFAULT_FEATURES
26 #define DEFAULT_FEATURES 0
27 #endif
28 #ifndef DEFAULT_RX_FEATURE
29 #define DEFAULT_RX_FEATURE FEATURE_RX_PARALLEL_PWM
30 #endif
32 typedef enum {
33 FEATURE_RX_PPM = 1 << 0,
34 FEATURE_INFLIGHT_ACC_CAL = 1 << 2,
35 FEATURE_RX_SERIAL = 1 << 3,
36 FEATURE_MOTOR_STOP = 1 << 4,
37 FEATURE_SERVO_TILT = 1 << 5,
38 FEATURE_SOFTSERIAL = 1 << 6,
39 FEATURE_GPS = 1 << 7,
40 FEATURE_RANGEFINDER = 1 << 9,
41 FEATURE_TELEMETRY = 1 << 10,
42 FEATURE_3D = 1 << 12,
43 FEATURE_RX_PARALLEL_PWM = 1 << 13,
44 FEATURE_RX_MSP = 1 << 14,
45 FEATURE_RSSI_ADC = 1 << 15,
46 FEATURE_LED_STRIP = 1 << 16,
47 FEATURE_DASHBOARD = 1 << 17,
48 FEATURE_OSD = 1 << 18,
49 FEATURE_CHANNEL_FORWARDING = 1 << 20,
50 FEATURE_TRANSPONDER = 1 << 21,
51 FEATURE_AIRMODE = 1 << 22,
52 FEATURE_RX_SPI = 1 << 25,
53 //FEATURE_SOFTSPI = 1 << 26, (removed)
54 FEATURE_ESC_SENSOR = 1 << 27,
55 FEATURE_ANTI_GRAVITY = 1 << 28,
56 FEATURE_DYNAMIC_FILTER = 1 << 29,
57 } features_e;
59 typedef struct featureConfig_s {
60 uint32_t enabledFeatures;
61 } featureConfig_t;
63 PG_DECLARE(featureConfig_t, featureConfig);
65 void featureInit(void);
66 bool featureIsEnabled(const uint32_t mask);
67 bool featureIsConfigured(const uint32_t mask);
68 void featureEnableImmediate(const uint32_t mask);
69 void featureDisableImmediate(const uint32_t mask);
70 void featureConfigSet(const uint32_t mask);
71 void featureConfigClear(const uint32_t mask);
72 void featureConfigReplace(const uint32_t mask);