Skip to content

Commit 1d977fa

Browse files
Add new target DAKEFPVH743_SLIM
1 parent 68546a2 commit 1d977fa

File tree

4 files changed

+293
-0
lines changed

4 files changed

+293
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32h743xi(DAKEFPVH743_SLIM)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV 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+
* INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdbool.h>
19+
#include <stdint.h>
20+
21+
#include <platform.h>
22+
23+
#include "io/serial.h"
24+
#include "rx/rx.h"
25+
26+
#include "io/piniobox.h"
27+
28+
void targetConfiguration(void)
29+
{
30+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
31+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
32+
pinioBoxConfigMutable()->permanentId[2] = BOX_PERMANENT_ID_USER3;
33+
pinioBoxConfigMutable()->permanentId[3] = BOX_PERMANENT_ID_USER4;
34+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV 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+
* INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
20+
#include <platform.h>
21+
#include "drivers/io.h"
22+
#include "drivers/pwm_mapping.h"
23+
#include "drivers/timer.h"
24+
#include "drivers/bus.h"
25+
#include "drivers/sensor.h"
26+
27+
#include "drivers/pwm_output.h"
28+
#include "common/maths.h"
29+
#include "fc/config.h"
30+
// Board hardware definitions - IMU1 slot
31+
32+
BUSDEV_REGISTER_SPI_TAG(busdev_1_mpu6000, DEVHW_MPU6000, IMU_1_SPI_BUS, IMU_1_CS_PIN, IMU_1_IRQ_PIN, 0, DEVFLAGS_NONE, IMU_1_ALIGN);
33+
BUSDEV_REGISTER_SPI_TAG(busdev_1_mpu6500, DEVHW_MPU6500, IMU_1_SPI_BUS, IMU_1_CS_PIN, IMU_1_IRQ_PIN, 0, DEVFLAGS_NONE, IMU_1_ALIGN);
34+
BUSDEV_REGISTER_SPI_TAG(busdev_1_ICM42605, DEVHW_ICM42605, IMU_1_SPI_BUS, IMU_1_CS_PIN, IMU_1_IRQ_PIN, 0, DEVFLAGS_NONE, IMU_1_ALIGN);
35+
BUSDEV_REGISTER_SPI_TAG(busdev_1_BMI270, DEVHW_BMI270, IMU_1_SPI_BUS, IMU_1_CS_PIN, IMU_1_IRQ_PIN, 0, DEVFLAGS_NONE, IMU_1_ALIGN);
36+
37+
// // Board hardware definitions - IMU2 slot
38+
BUSDEV_REGISTER_SPI_TAG(busdev_2_mpu6000, DEVHW_MPU6000, IMU_2_SPI_BUS, IMU_2_CS_PIN, IMU_2_IRQ_PIN, 1, DEVFLAGS_NONE, IMU_2_ALIGN);
39+
BUSDEV_REGISTER_SPI_TAG(busdev_2_mpu6500, DEVHW_MPU6500, IMU_2_SPI_BUS, IMU_2_CS_PIN, IMU_2_IRQ_PIN, 1, DEVFLAGS_NONE, IMU_2_ALIGN);
40+
BUSDEV_REGISTER_SPI_TAG(busdev_2_ICM42605, DEVHW_ICM42605, IMU_2_SPI_BUS, IMU_2_CS_PIN, IMU_2_IRQ_PIN, 1, DEVFLAGS_NONE, IMU_2_ALIGN);
41+
BUSDEV_REGISTER_SPI_TAG(busdev_2_BMI270, DEVHW_BMI270, IMU_2_SPI_BUS, IMU_2_CS_PIN, IMU_2_IRQ_PIN, 1, DEVFLAGS_NONE, IMU_2_ALIGN);
42+
43+
timerHardware_t timerHardware[] = {
44+
DEF_TIM(TIM1, CH1, PE9, TIM_USE_OUTPUT_AUTO, 0, 0), // M1
45+
DEF_TIM(TIM1, CH2, PE11, TIM_USE_OUTPUT_AUTO, 0, 1), // M2
46+
DEF_TIM(TIM1, CH3, PE13, TIM_USE_OUTPUT_AUTO, 0, 2), // M3
47+
DEF_TIM(TIM1, CH4, PE14, TIM_USE_OUTPUT_AUTO, 0, 3), // M4
48+
DEF_TIM(TIM2, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 4), // M5
49+
DEF_TIM(TIM2, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 5), // M6
50+
DEF_TIM(TIM2, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 6), // M7
51+
DEF_TIM(TIM2, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 7), // M8 DMA None
52+
DEF_TIM(TIM4, CH1, PD12, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
53+
DEF_TIM(TIM4, CH2, PD13, TIM_USE_OUTPUT_AUTO, 0, 0), // S2 DMA None
54+
DEF_TIM(TIM4, CH3, PD14, TIM_USE_OUTPUT_AUTO, 0, 0), // S3
55+
DEF_TIM(TIM4, CH4, PD15, TIM_USE_OUTPUT_AUTO, 0, 0), // S4
56+
DEF_TIM(TIM15, CH1, PE5, TIM_USE_ANY, 0, 0), // CAMERA_CONTROL_PIN
57+
DEF_TIM(TIM8, CH3, PC8, TIM_USE_ANY, 0, 0), // GYRO_1_CLKIN_PIN
58+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_LED, 0, 8), // LED_2812
59+
};
60+
61+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV 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+
* INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#pragma once
19+
20+
#define TARGET_BOARD_IDENTIFIER "DAK7"
21+
#define USBD_PRODUCT_STRING "DAKEFPV H743 SLIM"
22+
23+
#define LED0 PD10
24+
#define LED1 PD11
25+
#define LED2 PA8
26+
27+
#define BEEPER_PIN PE10
28+
#define BEEPER_INVERTED
29+
#define USE_DSHOT_DMAR
30+
// Buses
31+
#define USE_SPI
32+
#define USE_SPI_DEVICE_1
33+
34+
#define SPI1_SCK_PIN PA5
35+
#define SPI1_MISO_PIN PA6
36+
#define SPI1_MOSI_PIN PA7
37+
38+
#define USE_SPI_DEVICE_2
39+
#define SPI2_SCK_PIN PB13
40+
#define SPI2_MISO_PIN PC2
41+
#define SPI2_MOSI_PIN PC3
42+
43+
#define USE_SPI_DEVICE_3
44+
#define SPI3_SCK_PIN PC10
45+
#define SPI3_MISO_PIN PC11
46+
#define SPI3_MOSI_PIN PC12
47+
48+
#define USE_SPI_DEVICE_4
49+
#define SPI4_SCK_PIN PE12
50+
#define SPI4_MISO_PIN PE5
51+
#define SPI4_MOSI_PIN PE6
52+
53+
#define USE_I2C
54+
#define USE_I2C_DEVICE_2
55+
#define I2C2_SCL PB10
56+
#define I2C2_SDA PB11
57+
58+
#define DEFAULT_I2C_BUS BUS_I2C2
59+
60+
// GYRO
61+
#define USE_DUAL_GYRO
62+
#define USE_TARGET_IMU_HARDWARE_DESCRIPTORS // Don't use common busdev descriptors for IMU
63+
#define USE_IMU_MPU6500
64+
#define USE_IMU_MPU6000
65+
66+
#define USE_IMU_ICM42605
67+
#define USE_IMU_BMI270
68+
69+
// IMU_1 is verified to work on OBF4V6 and Omnibus Fireworks board
70+
# define IMU_1_CS_PIN PC9
71+
# define IMU_1_IRQ_PIN PD4
72+
# define IMU_1_SPI_BUS BUS_SPI1
73+
# define IMU_1_ALIGN CW0_DEG_FLIP
74+
// IMU_2 is sketchy and was not verified on actual hardware
75+
# define IMU_2_CS_PIN PB1
76+
# define IMU_2_IRQ_PIN PB2
77+
# define IMU_2_SPI_BUS BUS_SPI4
78+
# define IMU_2_ALIGN CW90_DEG_FLIP
79+
80+
// M25P256 flash
81+
#define USE_FLASHFS
82+
#define USE_FLASH_M25P16
83+
84+
#define M25P16_SPI_BUS BUS_SPI3
85+
#define M25P16_CS_PIN PA15
86+
87+
// *************** SDIO SD BLACKBOX*******************
88+
#define USE_SDCARD
89+
#define USE_SDCARD_SDIO
90+
#define SDCARD_SDIO_DEVICE SDIODEV_2
91+
#define SDCARD_SDIO_4BIT
92+
#define SDCARD_SDIO2_CMD_ALT // spare pin
93+
94+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
95+
96+
// OSD
97+
#define USE_MAX7456
98+
#define MAX7456_SPI_BUS BUS_SPI2
99+
#define MAX7456_CS_PIN PB12
100+
101+
// CAMERA_CONTROL
102+
#define CAMERA_CONTROL_PIN PC8 // TIM8 CH3
103+
104+
// Serial ports
105+
#define USE_VCP
106+
107+
#define USE_UART1
108+
#define USE_UART2
109+
#define USE_UART3
110+
#define USE_UART4
111+
#define USE_UART5
112+
#define USE_UART6
113+
#define USE_UART7
114+
#define USE_UART8
115+
#define UART1_TX_PIN PA9
116+
#define UART1_RX_PIN PA10
117+
#define UART2_TX_PIN PD5
118+
#define UART2_RX_PIN PD6
119+
#define UART3_TX_PIN PD8
120+
#define UART3_RX_PIN PD9
121+
#define UART4_TX_PIN PB9
122+
#define UART4_RX_PIN PB8
123+
#define UART5_TX_PIN PB6
124+
#define UART5_RX_PIN PB5
125+
#define UART6_TX_PIN PC6
126+
#define UART6_RX_PIN PC7
127+
#define UART7_TX_PIN PE8
128+
#define UART7_RX_PIN PE7
129+
#define UART8_TX_PIN PE1
130+
#define UART8_RX_PIN PE0
131+
132+
#define SERIAL_PORT_COUNT 9
133+
134+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
135+
#define SERIALRX_PROVIDER SERIALRX_CRSF
136+
#define SERIALRX_UART SERIAL_PORT_USART5
137+
#define GPS_UART SERIAL_PORT_USART1
138+
139+
//Baro
140+
#define USE_BARO
141+
#define USE_BARO_BMP280
142+
#define USE_BARO_DPS310
143+
#define BARO_I2C_BUS DEFAULT_I2C_BUS
144+
145+
// Mag
146+
#define USE_MAG
147+
#define MAG_I2C_BUS DEFAULT_I2C_BUS
148+
#define USE_MAG_ALL
149+
150+
#define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
151+
152+
#define USE_RANGEFINDER
153+
#define USE_RANGEFINDER_MSP
154+
#define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
155+
156+
#define PITOT_I2C_BUS DEFAULT_I2C_BUS
157+
158+
// ADC
159+
#define USE_ADC
160+
#define ADC_INSTANCE ADC1
161+
#define ADC_CHANNEL_1_PIN PA4
162+
#define ADC_CHANNEL_2_PIN PC5
163+
#define ADC_CHANNEL_3_PIN PC0
164+
#define ADC_CHANNEL_4_PIN PC4
165+
#define VBAT_ADC_CHANNEL ADC_CHN_1
166+
#define RSSI_ADC_CHANNEL ADC_CHN_2
167+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
168+
#define AIRSPEED_ADC_CHANNEL ADC_CHN_4
169+
170+
#define USE_LED_STRIP
171+
#define WS2811_PIN PB0 // TIM3 CH3
172+
173+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_LED_STRIP | FEATURE_GPS | FEATURE_BLACKBOX)
174+
175+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
176+
177+
#define TARGET_IO_PORTA 0xffff
178+
#define TARGET_IO_PORTB 0xffff
179+
#define TARGET_IO_PORTC 0xffff
180+
#define TARGET_IO_PORTD 0xffff
181+
#define TARGET_IO_PORTE 0xffff
182+
183+
#define USE_DSHOT
184+
#define USE_ESC_SENSOR
185+
186+
#define MAX_PWM_OUTPUT_PORTS 12
187+
188+
// PINIO
189+
#define USE_PINIO
190+
#define USE_PINIOBOX
191+
#define PINIO1_PIN PE2
192+
#define PINIO2_PIN PE3
193+
#define PINIO3_PIN PE4
194+
#define PINIO4_PIN PD2
195+
196+
// VBAT 10K/160K
197+
#define VBAT_SCALE_DEFAULT 1600

0 commit comments

Comments
 (0)