Skip to content

Commit ffd3f70

Browse files
authored
Merge pull request #10476 from radiolinkW/RADIOLINKF722
add target RADIOLINKF722
2 parents 1c15fcc + f9a6d7c commit ffd3f70

File tree

5 files changed

+260
-0
lines changed

5 files changed

+260
-0
lines changed

docs/boards/RADIOLINKF722.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# RADIOLINKF722
2+
3+
> Notice: DSHOT does not work on M6 output. If using M6, please use a different motor protocol.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f722xe(RADIOLINKF722)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of Cleanflight and Betaflight.
3+
*
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.
9+
*
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.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this software.
17+
*
18+
* If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
22+
#include <stdbool.h>
23+
#include <stdint.h>
24+
25+
#include "platform.h"
26+
27+
#include "fc/fc_msp_box.h"
28+
#include "io/serial.h"
29+
#include "drivers/pwm_mapping.h"
30+
31+
void targetConfiguration(void)
32+
{
33+
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART4)].functionMask = FUNCTION_ESCSERIAL;
34+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
35+
timerOverridesMutable(timer2id(TIM2))->outputMode = OUTPUT_MODE_MOTORS;
36+
timerOverridesMutable(timer2id(TIM3))->outputMode = OUTPUT_MODE_MOTORS;
37+
timerOverridesMutable(timer2id(TIM4))->outputMode = OUTPUT_MODE_MOTORS;
38+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* This file is part of Cleanflight and Betaflight.
3+
*
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.
9+
*
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.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this software.
17+
*
18+
* If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
#include <stdint.h>
22+
23+
#include "platform.h"
24+
#include "drivers/bus.h"
25+
#include "drivers/io.h"
26+
#include "drivers/pwm_mapping.h"
27+
#include "drivers/timer.h"
28+
#include "drivers/pinio.h"
29+
#include "drivers/sensor.h"
30+
31+
BUSDEV_REGISTER_SPI_TAG(busdev_bmi270, DEVHW_BMI270, BMI270_SPI_BUS, BMI270_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_BMI270_ALIGN);
32+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42605, ICM42688_SPI_BUS, ICM42688_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
33+
34+
timerHardware_t timerHardware[] = {
35+
36+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
37+
DEF_TIM(TIM2, CH2, PB3, TIM_USE_OUTPUT_AUTO, 0, 0), // S2
38+
DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), // S3
39+
DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S4
40+
DEF_TIM(TIM4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 0, 0), // S5
41+
DEF_TIM(TIM3, CH2, PB5, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 Clash with S2, DSHOT does not work
42+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S7
43+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), // S8
44+
45+
DEF_TIM(TIM8, CH3, PC8, TIM_USE_LED, 0, 0), // LED
46+
DEF_TIM(TIM5, CH1, PA0, TIM_USE_ANY, 0, 0), // Camera Control
47+
};
48+
49+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
/*
2+
* This file is part of Cleanflight and Betaflight.
3+
*
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.
9+
*
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.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this software.
17+
*
18+
* If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
#pragma once
22+
23+
#define TARGET_BOARD_IDENTIFIER "RALI"
24+
#define USBD_PRODUCT_STRING "RADIOLINKF722"
25+
26+
#define LED0 PA14
27+
28+
#define USE_BEEPER
29+
#define BEEPER PC13
30+
#define BEEPER_INVERTED
31+
32+
// *************** UART *****************************
33+
#define USB_IO
34+
#define USE_VCP
35+
// #define VBUS_SENSING_PIN PC15
36+
// #define VBUS_SENSING_ENABLED
37+
38+
#define USE_PINIO
39+
#define USE_PINIOBOX
40+
#define PINIO1_PIN PC9
41+
#define PINIO1_FLAGS PINIO_FLAGS_INVERTED
42+
43+
#define USE_UART1
44+
#define UART1_RX_PIN PA10
45+
#define UART1_TX_PIN PA9
46+
47+
#define USE_UART2
48+
#define UART2_RX_PIN PA3
49+
#define UART2_TX_PIN PA2
50+
51+
#define USE_UART3
52+
#define UART3_RX_PIN PB11
53+
#define UART3_TX_PIN PB10
54+
55+
#define USE_UART4
56+
#define UART4_RX_PIN PA1
57+
#define UART4_TX_PIN NONE
58+
59+
#define USE_UART6
60+
#define UART6_RX_PIN PC7
61+
#define UART6_TX_PIN PC6
62+
63+
#define SERIAL_PORT_COUNT 6
64+
65+
// *************** Gyro & ACC **********************
66+
#define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
67+
68+
#define USE_SPI
69+
#define USE_SPI_DEVICE_1
70+
#define SPI1_SCK_PIN PA5
71+
#define SPI1_MISO_PIN PA6
72+
#define SPI1_MOSI_PIN PA7
73+
74+
// ICM42605/ICM42688P
75+
#define USE_IMU_ICM42605
76+
#define IMU_ICM42605_ALIGN CW180_DEG
77+
#define ICM42688_SPI_BUS BUS_SPI1
78+
#define ICM42688_CS_PIN PB2
79+
80+
//BMI270
81+
#define USE_IMU_BMI270
82+
#define IMU_BMI270_ALIGN CW180_DEG
83+
#define BMI270_SPI_BUS BUS_SPI1
84+
#define BMI270_CS_PIN PB2
85+
86+
// *************** I2C(Baro & I2C) **************************
87+
#define USE_I2C
88+
89+
#define USE_I2C_DEVICE_1
90+
#define I2C1_SCL PB8
91+
#define I2C1_SDA PB9
92+
93+
// Baro
94+
#define USE_BARO
95+
#define USE_BARO_BMP280
96+
#define USE_BARO_MS5611
97+
#define USE_BARO_DPS310
98+
#define USE_BARO_SPL06
99+
#define BARO_I2C_BUS BUS_I2C1
100+
101+
// Mag
102+
#define USE_MAG
103+
#define MAG_I2C_BUS BUS_I2C1
104+
#define USE_MAG_ALL
105+
106+
// *************** FLASH **************************
107+
108+
#define USE_SPI_DEVICE_3
109+
#define SPI3_SCK_PIN PC10
110+
#define SPI3_MISO_PIN PC11
111+
#define SPI3_MOSI_PIN PC12
112+
113+
#define W25N01G_SPI_BUS BUS_SPI3
114+
#define W25N01G_CS_PIN PD2
115+
116+
#define USE_BLACKBOX
117+
#define USE_FLASHFS
118+
#define USE_FLASH_W25N01G
119+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
120+
121+
// *************** OSD *****************************
122+
#define USE_OSD
123+
#define USE_SPI_DEVICE_2
124+
#define SPI2_SCK_PIN PB13
125+
#define SPI2_MISO_PIN PB14
126+
#define SPI2_MOSI_PIN PB15
127+
128+
#define USE_MAX7456
129+
#define MAX7456_SPI_BUS BUS_SPI2
130+
#define MAX7456_CS_PIN PB12
131+
132+
// *************** ADC *****************************
133+
#define USE_ADC
134+
#define ADC_CHANNEL_1_PIN PC2
135+
#define ADC_CHANNEL_2_PIN PC0
136+
#define ADC_CHANNEL_3_PIN PC1
137+
138+
#define VBAT_ADC_CHANNEL ADC_CHN_1
139+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
140+
#define RSSI_ADC_CHANNEL ADC_CHN_2
141+
142+
// *************** LED *****************************
143+
#define USE_LED_STRIP
144+
#define WS2811_PIN PC8
145+
146+
// ********** Optiical Flow adn Lidar **************
147+
#define USE_RANGEFINDER
148+
#define USE_RANGEFINDER_MSP
149+
#define RANGEFINDER_I2C_BUS BUS_I2C1
150+
#define USE_OPFLOW
151+
#define USE_OPFLOW_MSP
152+
153+
#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_CURRENT_METER | FEATURE_TELEMETRY | FEATURE_VBAT | FEATURE_OSD | FEATURE_BLACKBOX)
154+
#define USE_DSHOT
155+
#define USE_ESC_SENSOR
156+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
157+
158+
#define SERIALRX_UART SERIAL_PORT_USART2
159+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
160+
#define SERIALRX_PROVIDER SERIALRX_SBUS
161+
162+
#define MAX_PWM_OUTPUT_PORTS 8
163+
164+
#define CURRENT_METER_SCALE 490
165+
166+
#define TARGET_IO_PORTA 0xffff
167+
#define TARGET_IO_PORTB 0xffff
168+
#define TARGET_IO_PORTC 0xffff
169+
#define TARGET_IO_PORTD (BIT(2))

0 commit comments

Comments
 (0)