NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
feature.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 // Keep synchronized with featureNames[] in serial_cli.c
21 typedef enum {
22  FEATURE_RX_PPM = 1 << 0,
23  FEATURE_VBAT = 1 << 1,
29  FEATURE_GPS = 1 << 7,
30  FEATURE_FAILSAFE = 1 << 8,
31  FEATURE_SONAR = 1 << 9,
32  FEATURE_TELEMETRY = 1 << 10,
34  FEATURE_3D = 1 << 12,
36  FEATURE_RX_MSP = 1 << 14,
37  FEATURE_RSSI_ADC = 1 << 15,
38  FEATURE_LED_STRIP = 1 << 16,
39  FEATURE_DISPLAY = 1 << 17,
40  FEATURE_ONESHOT125 = 1 << 18,
41  FEATURE_BLACKBOX = 1 << 19,
44 } features_e;
45 
47  uint32_t enabledFeatures;
48 } __attribute__((packed)) ;
49 
50 struct config;
51 bool feature(const struct config *self, uint32_t mask);
52 void featureSet(struct config *self, uint32_t mask);
53 void featureClear(struct config *self, uint32_t mask);
54 void featureClearAll(struct config *self);
55 uint32_t featureMask(const struct config *self);
Definition: feature.h:33
uint32_t enabledFeatures
Definition: feature.h:47
Definition: feature.h:39
Definition: config.h:81
features_e
Definition: feature.h:21
Definition: feature.h:41
Definition: feature.h:40
Definition: feature.h:25
Definition: feature.h:30
void featureSet(struct config *self, uint32_t mask)
Definition: feature.c:30
Definition: feature.h:27
Definition: feature.h:22
Definition: feature.h:26
Definition: feature.h:36
bool feature(const struct config *self, uint32_t mask)
Definition: feature.c:26
Definition: feature.h:37
Definition: feature.h:29
Definition: feature.h:46
Definition: feature.h:35
Definition: feature.h:28
Definition: feature.h:23
void featureClear(struct config *self, uint32_t mask)
Definition: feature.c:34
Definition: feature.h:32
typedef __attribute__
Definition: feature.h:31
Definition: feature.h:38
Definition: feature.h:43
void featureClearAll(struct config *self)
Definition: feature.c:38
Definition: feature.h:24
Definition: feature.h:42
Definition: feature.h:34
uint32_t featureMask(const struct config *self)
Definition: feature.c:42