Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / target / OMNIBUSF4 / config.c
blobf09d280bfd2e6cd20522f197d39733a146673493
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 #include <stdbool.h>
22 #include <stdint.h>
24 #include "platform.h"
26 #ifdef USE_TARGET_CONFIG
28 #include "config_helper.h"
30 #include "io/serial.h"
32 #include "pg/max7456.h"
33 #include "pg/pg.h"
35 #ifdef SYNERGYF4
36 #include "io/vtx.h"
37 #include "io/ledstrip.h"
38 #include "config/config.h"
39 #include "pg/piniobox.h"
40 #include "common/axis.h"
41 #include "sensors/barometer.h"
42 #include "sensors/compass.h"
43 #include "sensors/gyro.h"
44 #include "flight/pid.h"
45 #include "drivers/pwm_output.h"
46 #include "pg/motor.h"
48 static targetSerialPortFunction_t targetSerialPortFunction[] = {
49 { SERIAL_PORT_USART1, FUNCTION_RX_SERIAL },
50 { SERIAL_PORT_USART3, FUNCTION_VTX_SMARTAUDIO },
52 #endif
53 #ifdef EXUAVF4PRO
54 static targetSerialPortFunction_t targetSerialPortFunction[] = {
55 { SERIAL_PORT_USART1, FUNCTION_TELEMETRY_SMARTPORT },
56 { SERIAL_PORT_USART3, FUNCTION_VTX_TRAMP },
57 { SERIAL_PORT_UART4, FUNCTION_RCDEVICE },
58 { SERIAL_PORT_USART6, FUNCTION_RX_SERIAL },
60 #endif
62 void targetConfiguration(void)
64 #ifdef OMNIBUSF4BASE
65 // OMNIBUS F4 AIO (1st gen) has a AB7456 chip that is detected as MAX7456
66 max7456ConfigMutable()->clockConfig = MAX7456_CLOCK_CONFIG_FULL;
67 #endif
69 #ifdef EXUAVF4PRO
70 targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction));
71 #endif
72 #ifdef SYNERGYF4
73 pinioBoxConfigMutable()->permanentId[0] = 40;
74 vtxSettingsConfigMutable()->pitModeFreq = 0;
75 ledStripStatusModeConfigMutable()->ledConfigs[0] = DEFINE_LED(0, 0, 0, 0, LF(COLOR), LO(VTX), 0);
76 targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction));
77 motorConfigMutable()->dev.motorPwmProtocol = PWM_TYPE_DSHOT600;
78 pidConfigMutable()->pid_process_denom = 1; // 8kHz PID
79 #endif
81 #endif