Skip to content

Commit 32ca1a9

Browse files
committed
Mamba F405 - FURYF4OSD BF target
1 parent 2ea69cf commit 32ca1a9

File tree

3 files changed

+235
-0
lines changed

3 files changed

+235
-0
lines changed

src/main/target/FURYF4OSD/target.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* This file is part of Cleanflight.
3+
*
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.
8+
*
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.
13+
*
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/>.
16+
*/
17+
18+
#include <stdbool.h>
19+
#include <platform.h>
20+
#include "drivers/io.h"
21+
#include "drivers/pwm_mapping.h"
22+
#include "drivers/timer.h"
23+
24+
const timerHardware_t timerHardware[] = {
25+
26+
DEF_TIM(TIM8, CH4, PC9, TIM_USE_PPM, 0, 0 ), // PPM IN
27+
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 1 ), // S1_OUT - DMA1_ST6_CH3
28+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S2_OUT - DMA1_ST7_CH5
29+
DEF_TIM(TIM1, CH3N, PB1, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S3_OUT - DMA2_ST6_CH0
30+
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 0 ), // S4_OUT - DMA1_ST1_CH3
31+
DEF_TIM(TIM2, CH3, PB10, TIM_USE_ANY, 0, 0),
32+
DEF_TIM(TIM2, CH4, PB11, TIM_USE_ANY, 0, 0),
33+
DEF_TIM(TIM5, CH1, PA0, TIM_USE_LED, 0, 0 ), // LED_STRIP - DMA1_ST2_CH6
34+
};
35+
36+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

src/main/target/FURYF4OSD/target.h

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
/*
2+
* This file is part of Cleanflight.
3+
*
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.
8+
*
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.
13+
*
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/>.
16+
*/
17+
18+
#pragma once
19+
20+
#define TARGET_BOARD_IDENTIFIER "FYF4"
21+
22+
#define USBD_PRODUCT_STRING "FuryF4"
23+
24+
#define LED0 PB5
25+
#define LED1 PB4
26+
27+
#define BEEPER PA8
28+
#define BEEPER_INVERTED
29+
30+
// *************** Gyro & ACC **********************
31+
#define USE_SPI
32+
#define USE_SPI_DEVICE_1
33+
34+
#define MPU6500_CS_PIN PA4
35+
#define MPU6500_SPI_BUS BUS_SPI1
36+
37+
#define MPU6000_CS_PIN PA4
38+
#define MPU6000_SPI_BUS BUS_SPI1
39+
40+
#define USE_EXTI
41+
#define GYRO_INT_EXTI PC4
42+
#define USE_MPU_DATA_READY_SIGNAL
43+
44+
#define USE_GYRO
45+
#define USE_GYRO_MPU6500
46+
#define GYRO_MPU6500_ALIGN CW180_DEG
47+
48+
#define USE_GYRO_MPU6000
49+
#define GYRO_MPU6000_ALIGN CW180_DEG
50+
51+
#define USE_ACC
52+
#define USE_ACC_MPU6500
53+
#define ACC_MPU6500_ALIGN CW180_DEG
54+
55+
#define USE_ACC_MPU6000
56+
#define ACC_MPU6000_ALIGN CW180_DEG
57+
58+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
59+
#define USE_SPI_DEVICE_3
60+
#define SPI3_SCK_PIN PC10
61+
#define SPI3_MISO_PIN PC11
62+
#define SPI3_MOSI_PIN PC12
63+
#define SPI3_CLOCK_LEADING_EDGE
64+
65+
// *************** M25P256 flash ********************
66+
#define USE_FLASHFS
67+
#define USE_FLASH_M25P16
68+
#define M25P16_SPI_BUS BUS_SPI3
69+
#define M25P16_CS_PIN PB3
70+
71+
// *************** OSD *****************************
72+
#define USE_SPI_DEVICE_2
73+
#define SPI2_SCK_PIN PB13
74+
#define SPI2_MISO_PIN PB14
75+
#define SPI2_MOSI_PIN PB15
76+
77+
#define USE_OSD
78+
#define USE_MAX7456
79+
#define MAX7456_SPI_BUS BUS_SPI2
80+
#define MAX7456_CS_PIN PB12
81+
82+
// *************** UART *****************************
83+
#define USE_VCP
84+
#define VBUS_SENSING_PIN PC5
85+
#define VBUS_SENSING_ENABLED
86+
87+
#define USE_UART1
88+
#define UART1_RX_PIN PA10
89+
#define UART1_TX_PIN PA9
90+
91+
#define USE_UART3
92+
#define UART3_RX_PIN PB11
93+
#define UART3_TX_PIN PB10
94+
95+
#define USE_UART6
96+
#define UART6_RX_PIN PC7
97+
#define UART6_TX_PIN PC6
98+
99+
#define USE_SOFTSERIAL1
100+
#define SOFTSERIAL_1_RX_PIN PA1
101+
#define SOFTSERIAL_1_TX_PIN PC9 // PPM
102+
103+
//#define USE_SOFTSERIAL2
104+
//#define SOFTSERIAL_2_RX_PIN PA2
105+
//#define SOFTSERIAL_2_TX_PIN PA2
106+
107+
#define SERIAL_PORT_COUNT 5
108+
109+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
110+
#define SERIALRX_PROVIDER SERIALRX_SBUS
111+
#define SERIALRX_UART SERIAL_PORT_USART1
112+
113+
#define USE_I2C
114+
#define USE_I2C_DEVICE_1
115+
#define I2C1_SCL PB6
116+
#define I2C1_SDA PB7
117+
#define DEFAULT_I2C_BUS BUS_I2C1
118+
119+
#define USE_BARO
120+
#define BARO_I2C_BUS DEFAULT_I2C_BUS
121+
#define USE_BARO_BMP280
122+
#define USE_BARO_MS5611
123+
#define USE_BARO_BMP085
124+
125+
#define USE_MAG
126+
#define MAG_I2C_BUS DEFAULT_I2C_BUS
127+
#define USE_MAG_AK8963
128+
#define USE_MAG_AK8975
129+
#define USE_MAG_HMC5883
130+
#define USE_MAG_QMC5883
131+
#define USE_MAG_IST8310
132+
#define USE_MAG_IST8308
133+
#define USE_MAG_MAG3110
134+
#define USE_MAG_LIS3MDL
135+
136+
#define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
137+
138+
#define USE_OPTICAL_FLOW
139+
#define USE_OPFLOW_MSP
140+
141+
#define USE_RANGEFINDER
142+
#define USE_RANGEFINDER_MSP
143+
#define USE_RANGEFINDER_HCSR04_I2C
144+
#define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
145+
146+
#define PITOT_I2C_BUS DEFAULT_I2C_BUS
147+
148+
// *************** ADC *****************************
149+
#define USE_ADC
150+
#define ADC_INSTANCE ADC1
151+
#define ADC1_DMA_STREAM DMA2_Stream0
152+
#define ADC_CHANNEL_1_PIN PC1
153+
#define ADC_CHANNEL_2_PIN PC2
154+
#define ADC_CHANNEL_3_PIN PC3
155+
#define VBAT_ADC_CHANNEL ADC_CHN_1
156+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
157+
#define RSSI_ADC_CHANNEL ADC_CHN_3
158+
159+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY )
160+
#define CURRENT_METER_SCALE 179
161+
162+
#define USE_LED_STRIP
163+
#define WS2811_PIN PA0
164+
165+
//#define USE_SPEKTRUM_BIND
166+
//#define BIND_PIN PA3 // RX2
167+
168+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
169+
170+
#define TARGET_IO_PORTA 0xffff
171+
#define TARGET_IO_PORTB 0xffff
172+
#define TARGET_IO_PORTC 0xffff
173+
#define TARGET_IO_PORTD (BIT(2))
174+
175+
#define USE_DSHOT
176+
177+
#define MAX_PWM_OUTPUT_PORTS 6
178+
179+
#define PCA9685_I2C_BUS DEFAULT_I2C_BUS
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
F405_TARGETS += $(TARGET)
2+
FEATURES += VCP ONBOARDFLASH
3+
4+
TARGET_SRC = \
5+
drivers/accgyro/accgyro_mpu6500.c \
6+
drivers/accgyro/accgyro_mpu6000.c \
7+
drivers/barometer/barometer_bmp085.c \
8+
drivers/barometer/barometer_bmp280.c \
9+
drivers/barometer/barometer_ms56xx.c \
10+
drivers/compass/compass_ak8963.c \
11+
drivers/compass/compass_ak8975.c \
12+
drivers/compass/compass_hmc5883l.c \
13+
drivers/compass/compass_qmc5883l.c \
14+
drivers/compass/compass_ist8310.c \
15+
drivers/compass/compass_ist8308.c \
16+
drivers/compass/compass_mag3110.c \
17+
drivers/compass/compass_lis3mdl.c \
18+
drivers/pitotmeter_adc.c \
19+
drivers/light_ws2811strip.c \
20+
drivers/max7456.c

0 commit comments

Comments
 (0)