add SPL06 in Matek targets
[inav/snaewe.git] / src / main / target / common.h
blob6817ec7e37c01065291f255b93cb97fd86488814
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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.
9 * Cleanflight 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.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #if defined(STM32F7) || defined(STM32H7)
21 #define USE_ITCM_RAM
22 #endif
24 #ifdef USE_ITCM_RAM
25 #define FAST_CODE __attribute__((section(".tcm_code")))
26 #define NOINLINE __attribute__((noinline))
27 #else
28 #define FAST_CODE
29 #define NOINLINE
30 #endif
32 #if defined(STM32F3)
33 #define DYNAMIC_HEAP_SIZE 1024
34 #else
35 #define DYNAMIC_HEAP_SIZE 2048
36 #endif
38 #define I2C1_OVERCLOCK false
39 #define I2C2_OVERCLOCK false
40 #define USE_I2C_PULLUP // Enable built-in pullups on all boards in case external ones are too week
42 #define USE_SERIAL_RX
43 #define USE_SERIALRX_SPEKTRUM // Cheap and fairly common protocol
44 #define USE_SERIALRX_SBUS // Very common protocol
45 #define USE_SERIALRX_IBUS // Cheap FlySky & Turnigy receivers
46 #define USE_SERIALRX_FPORT
47 #define USE_SERIALRX_FPORT2
49 #define COMMON_DEFAULT_FEATURES (FEATURE_TX_PROF_SEL)
51 #if defined(STM32F3)
52 #define USE_UNDERCLOCK
53 //save flash for F3 targets
54 #define CLI_MINIMAL_VERBOSITY
55 #define SKIP_CLI_COMMAND_HELP
56 #define SKIP_CLI_RESOURCES
57 #endif
59 #if defined(STM32F4) || defined(STM32F7)
60 #define USE_SERVO_SBUS
61 #endif
63 #define USE_ADC_AVERAGING
64 #define USE_64BIT_TIME
65 #define USE_BLACKBOX
66 #define USE_GPS
67 #define USE_GPS_PROTO_UBLOX
68 #define USE_GPS_PROTO_MSP
69 #define USE_NAV
70 #define USE_TELEMETRY
71 #define USE_TELEMETRY_LTM
72 #define USE_TELEMETRY_FRSKY
74 #if defined(STM_FAST_TARGET)
75 #define SCHEDULER_DELAY_LIMIT 10
76 #else
77 #define SCHEDULER_DELAY_LIMIT 100
78 #endif
80 #if (MCU_FLASH_SIZE > 256)
82 #if defined(MAG_I2C_BUS) || defined(VCM5883_I2C_BUS)
83 #define USE_MAG_VCM5883
84 #endif
86 #define USE_MR_BRAKING_MODE
87 #define USE_PITOT
88 #define USE_PITOT_ADC
90 #define USE_DYNAMIC_FILTERS
91 #define USE_GYRO_KALMAN
92 #define USE_SMITH_PREDICTOR
93 #define USE_RATE_DYNAMICS
94 #define USE_EXTENDED_CMS_MENUS
96 // NAZA GPS support for F4+ only
97 #define USE_GPS_PROTO_NAZA
99 // Allow default rangefinders
100 #define USE_RANGEFINDER
101 #define USE_RANGEFINDER_MSP
102 #define USE_RANGEFINDER_BENEWAKE
103 #define USE_RANGEFINDER_VL53L0X
104 #define USE_RANGEFINDER_VL53L1X
105 #define USE_RANGEFINDER_US42
106 #define USE_RANGEFINDER_TOF10120_I2C
108 // Allow default optic flow boards
109 #define USE_OPFLOW
110 #define USE_OPFLOW_CXOF
111 #define USE_OPFLOW_MSP
113 // Allow default airspeed sensors
114 #define USE_PITOT
115 #define USE_PITOT_MS4525
116 #define USE_PITOT_MSP
118 #define USE_1WIRE
119 #define USE_1WIRE_DS2482
121 #define USE_TEMPERATURE_SENSOR
122 #define USE_TEMPERATURE_LM75
123 #define USE_TEMPERATURE_DS18B20
125 #define USE_MSP_DISPLAYPORT
126 #define USE_DASHBOARD
127 #define DASHBOARD_ARMED_BITMAP
128 #define USE_OLED_UG2864
130 #define USE_OSD
131 #define USE_FRSKYOSD
132 #define USE_DJI_HD_OSD
133 #define USE_SMARTPORT_MASTER
135 #define NAV_NON_VOLATILE_WAYPOINT_CLI
137 #define NAV_AUTO_MAG_DECLINATION_PRECISE
139 #define USE_D_BOOST
140 #define USE_ANTIGRAVITY
142 #define USE_I2C_IO_EXPANDER
144 #define USE_GPS_PROTO_NMEA
145 #define USE_GPS_PROTO_MTK
147 #define USE_TELEMETRY_SIM
148 #define USE_TELEMETRY_MAVLINK
149 #define USE_MSP_OVER_TELEMETRY
151 #define USE_SERIALRX_SRXL2 // Spektrum SRXL2 protocol
152 #define USE_SERIALRX_JETIEXBUS
153 #define USE_SERIALRX_MAVLINK
154 #define USE_TELEMETRY_SRXL
155 #define USE_SPEKTRUM_CMS_TELEMETRY
156 //#define USE_SPEKTRUM_VTX_CONTROL //Some functions from betaflight still not implemented
157 #define USE_SPEKTRUM_VTX_TELEMETRY
159 #define USE_VTX_COMMON
161 #define USE_SERIALRX_GHST
162 #define USE_TELEMETRY_GHST
164 #define USE_SECONDARY_IMU
165 #define USE_IMU_BNO055
167 #define USE_POWER_LIMITS
169 #else // MCU_FLASH_SIZE < 256
170 #define LOG_LEVEL_MAXIMUM LOG_LEVEL_ERROR
171 #endif
173 #if (MCU_FLASH_SIZE > 128)
174 #define NAV_FIXED_WING_LANDING
175 #define USE_SAFE_HOME
176 #define USE_AUTOTUNE_FIXED_WING
177 #define USE_LOG
178 #define USE_STATS
179 #define USE_CMS
180 #define CMS_MENU_OSD
181 #define NAV_GPS_GLITCH_DETECTION
182 #define NAV_NON_VOLATILE_WAYPOINT_STORAGE
183 #define USE_TELEMETRY_IBUS
184 #define USE_TELEMETRY_SMARTPORT
185 #define USE_TELEMETRY_CRSF
186 #define USE_TELEMETRY_JETIEXBUS
187 // These are rather exotic serial protocols
188 #define USE_RX_MSP
189 //#define USE_MSP_RC_OVERRIDE
190 #define USE_SERIALRX_CRSF
191 #define USE_SERIAL_PASSTHROUGH
192 #define NAV_MAX_WAYPOINTS 120
193 #define USE_RCDEVICE
195 //Enable VTX control
196 #define USE_VTX_CONTROL
197 #define USE_VTX_SMARTAUDIO
198 #define USE_VTX_TRAMP
200 #ifndef STM32F3 //F3 series does not have enoug RAM to support logic conditions
201 #define USE_PROGRAMMING_FRAMEWORK
202 #define USE_CLI_BATCH
203 #endif
205 //Enable DST calculations
206 #define RTC_AUTOMATIC_DST
207 // Wind estimator
208 #define USE_WIND_ESTIMATOR
210 #else // MCU_FLASH_SIZE < 128
212 #define SKIP_TASK_STATISTICS
214 #endif
216 //Designed to free space of F722 and F411 MCUs
217 #if (MCU_FLASH_SIZE > 512)
219 #define USE_VTX_FFPV
220 #define USE_PITOT_VIRTUAL
221 #define USE_PWM_DRIVER_PCA9685
222 #define USE_PWM_SERVO_DRIVER
224 #define USE_SERIALRX_SUMD
225 #define USE_SERIALRX_SUMH
226 #define USE_SERIALRX_XBUS
227 #define USE_TELEMETRY_HOTT
228 #define USE_HOTT_TEXTMODE
230 #endif