From fe17c4eabd8892299835280ee22f50923b90da9e Mon Sep 17 00:00:00 2001 From: H-ChuWu <754152299@qq.com> Date: Wed, 2 Apr 2025 11:16:37 +0800 Subject: [PATCH 1/5] BROTHERHOBBYH743 --- .vscode/settings.json | 5 +- .../target/BROTHERHOBBYH743/CMakeLists.txt | 1 + src/main/target/BROTHERHOBBYH743/config.c | 32 +++ src/main/target/BROTHERHOBBYH743/target.c | 54 +++++ src/main/target/BROTHERHOBBYH743/target.h | 187 ++++++++++++++++++ 5 files changed, 278 insertions(+), 1 deletion(-) create mode 100644 src/main/target/BROTHERHOBBYH743/CMakeLists.txt create mode 100644 src/main/target/BROTHERHOBBYH743/config.c create mode 100644 src/main/target/BROTHERHOBBYH743/target.c create mode 100644 src/main/target/BROTHERHOBBYH743/target.h diff --git a/.vscode/settings.json b/.vscode/settings.json index 5de759a0db4..7882c26ab7b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,6 +13,9 @@ "editor.insertSpaces": true, "editor.detectIndentation": false, "editor.expandTabs": true, - "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, BreakBeforeBraces: Mozilla }" + "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, BreakBeforeBraces: Mozilla }", + "cSpell.words": [ + "BROTHERHOBBYH" + ] } \ No newline at end of file diff --git a/src/main/target/BROTHERHOBBYH743/CMakeLists.txt b/src/main/target/BROTHERHOBBYH743/CMakeLists.txt new file mode 100644 index 00000000000..b40fef552fe --- /dev/null +++ b/src/main/target/BROTHERHOBBYH743/CMakeLists.txt @@ -0,0 +1 @@ +target_stm32h743xi(BROTHERHOBBYH743) diff --git a/src/main/target/BROTHERHOBBYH743/config.c b/src/main/target/BROTHERHOBBYH743/config.c new file mode 100644 index 00000000000..1065971614a --- /dev/null +++ b/src/main/target/BROTHERHOBBYH743/config.c @@ -0,0 +1,32 @@ +/* + * This file is part of Cleanflight. + * + * Cleanflight is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Cleanflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Cleanflight. If not, see . + */ + +#include + +#include "platform.h" + +#include "fc/fc_msp_box.h" +#include "fc/config.h" + +#include "io/piniobox.h" + +void targetConfiguration(void) +{ + pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1; + pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2; + beeperConfigMutable()->pwmMode = true; +} diff --git a/src/main/target/BROTHERHOBBYH743/target.c b/src/main/target/BROTHERHOBBYH743/target.c new file mode 100644 index 00000000000..77164058b20 --- /dev/null +++ b/src/main/target/BROTHERHOBBYH743/target.c @@ -0,0 +1,54 @@ +/* + * This file is part of INAV. + * + * INAV is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * INAV is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with INAV. If not, see . + */ + + #include + + #include "platform.h" + + #include "drivers/bus.h" + #include "drivers/io.h" + #include "drivers/pwm_mapping.h" + #include "drivers/timer.h" + #include "drivers/pinio.h" + #include "drivers/sensor.h" + + BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); + BUSDEV_REGISTER_SPI_TAG(busdev_icm42605_2, DEVHW_ICM42605, ICM42605_SPI_BUS_2, ICM42605_CS_PIN_2, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN_2); + + timerHardware_t timerHardware[] = { + DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1 + DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 1), // S2 + + DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3 + DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4 + DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 4), // S5 + DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 5), // S6 + + DEF_TIM(TIM4, CH1, PD12, TIM_USE_OUTPUT_AUTO, 0, 6), // S7 + DEF_TIM(TIM4, CH2, PD13, TIM_USE_OUTPUT_AUTO, 0, 7), // S8 + DEF_TIM(TIM4, CH3, PD14, TIM_USE_OUTPUT_AUTO, 0, 0), // S9 + DEF_TIM(TIM4, CH4, PD15, TIM_USE_OUTPUT_AUTO, 0, 0), // S10 DMA_NONE + + DEF_TIM(TIM15, CH1, PE5, TIM_USE_OUTPUT_AUTO, 0, 0), // S11 + DEF_TIM(TIM15, CH2, PE6, TIM_USE_OUTPUT_AUTO, 0, 0), // S12 DMA_NONE + + DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 9), // LED_2812 + DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM + }; + + const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]); + \ No newline at end of file diff --git a/src/main/target/BROTHERHOBBYH743/target.h b/src/main/target/BROTHERHOBBYH743/target.h new file mode 100644 index 00000000000..e8e6d06e6ac --- /dev/null +++ b/src/main/target/BROTHERHOBBYH743/target.h @@ -0,0 +1,187 @@ +/* + * This file is part of INAV Project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Alternatively, the contents of this file may be used under the terms + * of the GNU General Public License Version 3, as described below: + * + * This file is free software: you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + + #pragma once + + #define TARGET_BOARD_IDENTIFIER "BROT" + #define USBD_PRODUCT_STRING "BROTHERHOBBYH743" + + #define USE_TARGET_CONFIG + + #define LED0 PE9 + #define LED1 PA7 + + #define BEEPER PA15 + #define BEEPER_INVERTED + #define BEEPER_PWM_FREQUENCY 2000 + + // *************** IMU generic *********************** + #define USE_DUAL_GYRO + #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS + + // *************** SPI1 IMU0 ICM42605 **************** + #define USE_SPI + #define USE_SPI_DEVICE_1 + #define SPI1_SCK_PIN PA5 + #define SPI1_MISO_PIN PA6 + #define SPI1_MOSI_PIN PD7 + + #define USE_IMU_ICM42605 + + #define IMU_ICM42605_ALIGN CW90_DEG + #define ICM42605_SPI_BUS BUS_SPI1 + #define ICM42605_CS_PIN PC15 + + // *************** SPI4 IMU1 ICM42605 ************** + #define USE_SPI_DEVICE_4 + #define SPI4_SCK_PIN PE12 + #define SPI4_MISO_PIN PE13 + #define SPI4_MOSI_PIN PE14 + + #define USE_IMU_ICM42605 + + #define IMU_ICM42605_ALIGN_2 CW0_DEG + #define ICM42605_SPI_BUS_2 BUS_SPI4 + #define ICM42605_CS_PIN_2 PE11 + + // *************** SPI2 OSD *********************** + #define USE_SPI_DEVICE_2 + #define SPI2_SCK_PIN PB13 + #define SPI2_MISO_PIN PB14 + #define SPI2_MOSI_PIN PB15 + + #define USE_MAX7456 + #define MAX7456_SPI_BUS BUS_SPI2 + #define MAX7456_CS_PIN PB12 + + // *************** SPI3 ************************ + #define USE_SPI_DEVICE_3 + #define SPI3_SCK_PIN PB3 + #define SPI3_MISO_PIN PB4 + #define SPI3_MOSI_PIN PB5 + + // *************** I2C /Baro/Mag ********************* + #define USE_I2C + #define USE_I2C_DEVICE_1 + #define I2C1_SCL PB6 + #define I2C1_SDA PB7 + + #define USE_I2C_DEVICE_2 + #define I2C2_SCL PB10 + #define I2C2_SDA PB11 + + #define USE_BARO + #define BARO_I2C_BUS BUS_I2C2 + #define USE_BARO_ALL + + #define USE_MAG + #define MAG_I2C_BUS BUS_I2C1 + #define USE_MAG_ALL + + #define TEMPERATURE_I2C_BUS BUS_I2C2 + #define PITOT_I2C_BUS BUS_I2C2 + + #define USE_RANGEFINDER + #define RANGEFINDER_I2C_BUS BUS_I2C1 + // *************** UART ***************************** + #define USE_VCP + + #define USE_UART1 + #define UART1_TX_PIN PA9 + #define UART1_RX_PIN PA10 + + #define USE_UART2 + #define UART2_TX_PIN PD5 + #define UART2_RX_PIN PD6 + + #define USE_UART3 + #define UART3_TX_PIN PD8 + #define UART3_RX_PIN PD9 + + #define USE_UART4 + #define UART4_TX_PIN PB9 + #define UART4_RX_PIN PB8 + + #define USE_UART6 + #define UART6_TX_PIN PC6 + #define UART6_RX_PIN PC7 + + #define USE_UART7 + #define UART7_TX_PIN PE8 + #define UART7_RX_PIN PE7 + + #define USE_UART8 + #define UART8_TX_PIN PE1 + #define UART8_RX_PIN PE0 + + #define SERIAL_PORT_COUNT 8 + + #define DEFAULT_RX_TYPE RX_TYPE_SERIAL + #define SERIALRX_PROVIDER SERIALRX_CRSF + #define SERIALRX_UART SERIAL_PORT_USART2 + + // *************** SDIO SD BLACKBOX******************* + #define USE_SDCARD + #define USE_SDCARD_SDIO + #define SDCARD_SDIO_DEVICE SDIODEV_1 + #define SDCARD_SDIO_4BIT + + #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT + + // *************** ADC ***************************** + #define USE_ADC + #define ADC_INSTANCE ADC1 + + #define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1 + #define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1 + #define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI + + #define VBAT_ADC_CHANNEL ADC_CHN_1 + #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 + #define RSSI_ADC_CHANNEL ADC_CHN_3 + + // *************** PINIO *************************** + #define USE_PINIO + #define USE_PINIOBOX + #define PINIO1_PIN PD10 + #define PINIO2_PIN PD11 + + // *************** LEDSTRIP ************************ + #define USE_LED_STRIP + #define WS2811_PIN PA8 + + #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX) + #define CURRENT_METER_SCALE 250 + + #define USE_SERIAL_4WAY_BLHELI_INTERFACE + + #define TARGET_IO_PORTA (0xffff & ~(BIT(14) | BIT(13))) + #define TARGET_IO_PORTB 0xffff + #define TARGET_IO_PORTC 0xffff + #define TARGET_IO_PORTD 0xffff + #define TARGET_IO_PORTE 0xffff + + #define MAX_PWM_OUTPUT_PORTS 15 + #define USE_DSHOT + #define USE_ESC_SENSOR From 2fdcbeeba3a3664a4a72914bc29e6382b66c5dd6 Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Sun, 6 Apr 2025 17:02:26 -0500 Subject: [PATCH 2/5] remov3e extraneous leading and trailing spaces --- src/main/target/BROTHERHOBBYH743/target.c | 11 +- src/main/target/BROTHERHOBBYH743/target.h | 320 +++++++++++----------- 2 files changed, 165 insertions(+), 166 deletions(-) diff --git a/src/main/target/BROTHERHOBBYH743/target.c b/src/main/target/BROTHERHOBBYH743/target.c index 77164058b20..8d9596cc162 100644 --- a/src/main/target/BROTHERHOBBYH743/target.c +++ b/src/main/target/BROTHERHOBBYH743/target.c @@ -18,14 +18,14 @@ #include #include "platform.h" - + #include "drivers/bus.h" #include "drivers/io.h" #include "drivers/pwm_mapping.h" #include "drivers/timer.h" #include "drivers/pinio.h" #include "drivers/sensor.h" - + BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); BUSDEV_REGISTER_SPI_TAG(busdev_icm42605_2, DEVHW_ICM42605, ICM42605_SPI_BUS_2, ICM42605_CS_PIN_2, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN_2); @@ -33,7 +33,7 @@ DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1 DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 1), // S2 - DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3 + DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3 DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4 DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 4), // S5 DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 5), // S6 @@ -49,6 +49,5 @@ DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 9), // LED_2812 DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM }; - - const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]); - \ No newline at end of file + +const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]); diff --git a/src/main/target/BROTHERHOBBYH743/target.h b/src/main/target/BROTHERHOBBYH743/target.h index e8e6d06e6ac..f40e38eeaf8 100644 --- a/src/main/target/BROTHERHOBBYH743/target.h +++ b/src/main/target/BROTHERHOBBYH743/target.h @@ -25,163 +25,163 @@ #pragma once #define TARGET_BOARD_IDENTIFIER "BROT" - #define USBD_PRODUCT_STRING "BROTHERHOBBYH743" - - #define USE_TARGET_CONFIG - - #define LED0 PE9 - #define LED1 PA7 - - #define BEEPER PA15 - #define BEEPER_INVERTED - #define BEEPER_PWM_FREQUENCY 2000 - - // *************** IMU generic *********************** - #define USE_DUAL_GYRO - #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS - - // *************** SPI1 IMU0 ICM42605 **************** - #define USE_SPI - #define USE_SPI_DEVICE_1 - #define SPI1_SCK_PIN PA5 - #define SPI1_MISO_PIN PA6 - #define SPI1_MOSI_PIN PD7 - - #define USE_IMU_ICM42605 - - #define IMU_ICM42605_ALIGN CW90_DEG - #define ICM42605_SPI_BUS BUS_SPI1 - #define ICM42605_CS_PIN PC15 - - // *************** SPI4 IMU1 ICM42605 ************** - #define USE_SPI_DEVICE_4 - #define SPI4_SCK_PIN PE12 - #define SPI4_MISO_PIN PE13 - #define SPI4_MOSI_PIN PE14 - - #define USE_IMU_ICM42605 - - #define IMU_ICM42605_ALIGN_2 CW0_DEG - #define ICM42605_SPI_BUS_2 BUS_SPI4 - #define ICM42605_CS_PIN_2 PE11 - - // *************** SPI2 OSD *********************** - #define USE_SPI_DEVICE_2 - #define SPI2_SCK_PIN PB13 - #define SPI2_MISO_PIN PB14 - #define SPI2_MOSI_PIN PB15 - - #define USE_MAX7456 - #define MAX7456_SPI_BUS BUS_SPI2 - #define MAX7456_CS_PIN PB12 - - // *************** SPI3 ************************ - #define USE_SPI_DEVICE_3 - #define SPI3_SCK_PIN PB3 - #define SPI3_MISO_PIN PB4 - #define SPI3_MOSI_PIN PB5 - - // *************** I2C /Baro/Mag ********************* - #define USE_I2C - #define USE_I2C_DEVICE_1 - #define I2C1_SCL PB6 - #define I2C1_SDA PB7 - - #define USE_I2C_DEVICE_2 - #define I2C2_SCL PB10 - #define I2C2_SDA PB11 - - #define USE_BARO - #define BARO_I2C_BUS BUS_I2C2 - #define USE_BARO_ALL - - #define USE_MAG - #define MAG_I2C_BUS BUS_I2C1 - #define USE_MAG_ALL - - #define TEMPERATURE_I2C_BUS BUS_I2C2 - #define PITOT_I2C_BUS BUS_I2C2 - - #define USE_RANGEFINDER - #define RANGEFINDER_I2C_BUS BUS_I2C1 - // *************** UART ***************************** - #define USE_VCP - - #define USE_UART1 - #define UART1_TX_PIN PA9 - #define UART1_RX_PIN PA10 - - #define USE_UART2 - #define UART2_TX_PIN PD5 - #define UART2_RX_PIN PD6 - - #define USE_UART3 - #define UART3_TX_PIN PD8 - #define UART3_RX_PIN PD9 - - #define USE_UART4 - #define UART4_TX_PIN PB9 - #define UART4_RX_PIN PB8 - - #define USE_UART6 - #define UART6_TX_PIN PC6 - #define UART6_RX_PIN PC7 - - #define USE_UART7 - #define UART7_TX_PIN PE8 - #define UART7_RX_PIN PE7 - - #define USE_UART8 - #define UART8_TX_PIN PE1 - #define UART8_RX_PIN PE0 - - #define SERIAL_PORT_COUNT 8 - - #define DEFAULT_RX_TYPE RX_TYPE_SERIAL - #define SERIALRX_PROVIDER SERIALRX_CRSF - #define SERIALRX_UART SERIAL_PORT_USART2 - - // *************** SDIO SD BLACKBOX******************* - #define USE_SDCARD - #define USE_SDCARD_SDIO - #define SDCARD_SDIO_DEVICE SDIODEV_1 - #define SDCARD_SDIO_4BIT - - #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT - - // *************** ADC ***************************** - #define USE_ADC - #define ADC_INSTANCE ADC1 - - #define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1 - #define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1 - #define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI - - #define VBAT_ADC_CHANNEL ADC_CHN_1 - #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 - #define RSSI_ADC_CHANNEL ADC_CHN_3 - - // *************** PINIO *************************** - #define USE_PINIO - #define USE_PINIOBOX - #define PINIO1_PIN PD10 - #define PINIO2_PIN PD11 - - // *************** LEDSTRIP ************************ - #define USE_LED_STRIP - #define WS2811_PIN PA8 - - #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX) - #define CURRENT_METER_SCALE 250 - - #define USE_SERIAL_4WAY_BLHELI_INTERFACE - - #define TARGET_IO_PORTA (0xffff & ~(BIT(14) | BIT(13))) - #define TARGET_IO_PORTB 0xffff - #define TARGET_IO_PORTC 0xffff - #define TARGET_IO_PORTD 0xffff - #define TARGET_IO_PORTE 0xffff - - #define MAX_PWM_OUTPUT_PORTS 15 - #define USE_DSHOT - #define USE_ESC_SENSOR + #define USBD_PRODUCT_STRING"BROTHERHOBBYH743" + +#define USE_TARGET_CONFIG + +#define LED0 PE9 +#define LED1 PA7 + +#define BEEPER PA15 +#define BEEPER_INVERTED +#define BEEPER_PWM_FREQUENCY 2000 + +// *************** IMU generic *********************** +#define USE_DUAL_GYRO +#define USE_TARGET_IMU_HARDWARE_DESCRIPTORS + +// *************** SPI1 IMU0 ICM42605 **************** +#define USE_SPI +#define USE_SPI_DEVICE_1 +#define SPI1_SCK_PIN PA5 +#define SPI1_MISO_PIN PA6 +#define SPI1_MOSI_PIN PD7 + +#define USE_IMU_ICM42605 + +#define IMU_ICM42605_ALIGN CW90_DEG +#define ICM42605_SPI_BUS BUS_SPI1 +#define ICM42605_CS_PIN PC15 + +// *************** SPI4 IMU1 ICM42605 ************** +#define USE_SPI_DEVICE_4 +#define SPI4_SCK_PIN PE12 +#define SPI4_MISO_PIN PE13 +#define SPI4_MOSI_PIN PE14 + +#define USE_IMU_ICM42605 + +#define IMU_ICM42605_ALIGN_2 CW0_DEG +#define ICM42605_SPI_BUS_2 BUS_SPI4 +#define ICM42605_CS_PIN_2 PE11 + + // *************** SPI2 OSD *********************** +#define USE_SPI_DEVICE_2 +#define SPI2_SCK_PIN PB13 +#define SPI2_MISO_PIN PB14 +#define SPI2_MOSI_PIN PB15 + +#define USE_MAX7456 +#define MAX7456_SPI_BUS BUS_SPI2 +#define MAX7456_CS_PIN PB12 + + // *************** SPI3 ************************ +#define USE_SPI_DEVICE_3 +#define SPI3_SCK_PIN PB3 +#define SPI3_MISO_PIN PB4 +#define SPI3_MOSI_PIN PB5 + +// *************** I2C /Baro/Mag ********************* +#define USE_I2C +#define USE_I2C_DEVICE_1 +#define I2C1_SCL PB6 +#define I2C1_SDA PB7 + +#define USE_I2C_DEVICE_2 +#define I2C2_SCL PB10 +#define I2C2_SDA PB11 + +#define USE_BARO +#define BARO_I2C_BUS BUS_I2C2 +#define USE_BARO_ALL + +#define USE_MAG +#define MAG_I2C_BUS BUS_I2C1 +#define USE_MAG_ALL + +#define TEMPERATURE_I2C_BUS BUS_I2C2 +#define PITOT_I2C_BUS BUS_I2C2 + +#define USE_RANGEFINDER +#define RANGEFINDER_I2C_BUS BUS_I2C1 +// *************** UART ***************************** +#define USE_VCP + +#define USE_UART1 +#define UART1_TX_PIN PA9 +#define UART1_RX_PIN PA10 + +#define USE_UART2 +#define UART2_TX_PIN PD5 +#define UART2_RX_PIN PD6 + +#define USE_UART3 +#define UART3_TX_PIN PD8 +#define UART3_RX_PIN PD9 + +#define USE_UART4 +#define UART4_TX_PIN PB9 +#define UART4_RX_PIN PB8 + +#define USE_UART6 +#define UART6_TX_PIN PC6 +#define UART6_RX_PIN PC7 + +#define USE_UART7 +#define UART7_TX_PIN PE8 +#define UART7_RX_PIN PE7 + +#define USE_UART8 +#define UART8_TX_PIN PE1 +#define UART8_RX_PIN PE0 + +#define SERIAL_PORT_COUNT 8 + +#define DEFAULT_RX_TYPE RX_TYPE_SERIAL +#define SERIALRX_PROVIDER SERIALRX_CRSF +#define SERIALRX_UART SERIAL_PORT_USART2 + +// *************** SDIO SD BLACKBOX******************* +#define USE_SDCARD +#define USE_SDCARD_SDIO +#define SDCARD_SDIO_DEVICE SDIODEV_1 +#define SDCARD_SDIO_4BIT + +#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT + +// *************** ADC ***************************** +#define USE_ADC +#define ADC_INSTANCE ADC1 + +#define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1 +#define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1 +#define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI + +#define VBAT_ADC_CHANNEL ADC_CHN_1 +#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 +#define RSSI_ADC_CHANNEL ADC_CHN_3 + +// *************** PINIO *************************** +#define USE_PINIO +#define USE_PINIOBOX +#define PINIO1_PIN PD10 +#define PINIO2_PIN PD11 + +// *************** LEDSTRIP ************************ +#define USE_LED_STRIP +#define WS2811_PIN PA8 + +#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX) +#define CURRENT_METER_SCALE 250 + +#define USE_SERIAL_4WAY_BLHELI_INTERFACE + +#define TARGET_IO_PORTA (0xffff & ~(BIT(14) | BIT(13))) +#define TARGET_IO_PORTB 0xffff +#define TARGET_IO_PORTC 0xffff +#define TARGET_IO_PORTD 0xffff +#define TARGET_IO_PORTE 0xffff + +#define MAX_PWM_OUTPUT_PORTS 15 +#define USE_DSHOT +#define USE_ESC_SENSOR From a79c912b074c0e74141b26a4843e9c95a511391e Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Sun, 6 Apr 2025 17:15:32 -0500 Subject: [PATCH 3/5] more trailing whitepace --- src/main/target/BROTHERHOBBYH743/target.c | 24 +++++++++++------------ src/main/target/BROTHERHOBBYH743/target.h | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/target/BROTHERHOBBYH743/target.c b/src/main/target/BROTHERHOBBYH743/target.c index 8d9596cc162..f9aff080788 100644 --- a/src/main/target/BROTHERHOBBYH743/target.c +++ b/src/main/target/BROTHERHOBBYH743/target.c @@ -15,21 +15,21 @@ * along with INAV. If not, see . */ - #include +#include - #include "platform.h" +#include "platform.h" - #include "drivers/bus.h" - #include "drivers/io.h" - #include "drivers/pwm_mapping.h" - #include "drivers/timer.h" - #include "drivers/pinio.h" - #include "drivers/sensor.h" +#include "drivers/bus.h" +#include "drivers/io.h" +#include "drivers/pwm_mapping.h" +#include "drivers/timer.h" +#include "drivers/pinio.h" +#include "drivers/sensor.h" - BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); - BUSDEV_REGISTER_SPI_TAG(busdev_icm42605_2, DEVHW_ICM42605, ICM42605_SPI_BUS_2, ICM42605_CS_PIN_2, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN_2); +BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); +BUSDEV_REGISTER_SPI_TAG(busdev_icm42605_2, DEVHW_ICM42605, ICM42605_SPI_BUS_2, ICM42605_CS_PIN_2, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN_2); - timerHardware_t timerHardware[] = { +timerHardware_t timerHardware[] = { DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1 DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 1), // S2 @@ -48,6 +48,6 @@ DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 9), // LED_2812 DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM - }; +}; const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]); diff --git a/src/main/target/BROTHERHOBBYH743/target.h b/src/main/target/BROTHERHOBBYH743/target.h index f40e38eeaf8..8cca3a9a39c 100644 --- a/src/main/target/BROTHERHOBBYH743/target.h +++ b/src/main/target/BROTHERHOBBYH743/target.h @@ -22,10 +22,10 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ - #pragma once +#pragma once - #define TARGET_BOARD_IDENTIFIER "BROT" - #define USBD_PRODUCT_STRING"BROTHERHOBBYH743" +#define TARGET_BOARD_IDENTIFIER "BROT" +#define USBD_PRODUCT_STRING "BROTHERHOBBYH743" #define USE_TARGET_CONFIG @@ -65,7 +65,7 @@ #define ICM42605_SPI_BUS_2 BUS_SPI4 #define ICM42605_CS_PIN_2 PE11 - // *************** SPI2 OSD *********************** +// *************** SPI2 OSD *********************** #define USE_SPI_DEVICE_2 #define SPI2_SCK_PIN PB13 #define SPI2_MISO_PIN PB14 @@ -75,7 +75,7 @@ #define MAX7456_SPI_BUS BUS_SPI2 #define MAX7456_CS_PIN PB12 - // *************** SPI3 ************************ +// *************** SPI3 ************************ #define USE_SPI_DEVICE_3 #define SPI3_SCK_PIN PB3 #define SPI3_MISO_PIN PB4 From 691fd3925599d025ff100e4d2238bc6a8651ac47 Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Mon, 7 Apr 2025 00:29:57 -0500 Subject: [PATCH 4/5] brother correct i2c bus for pitot and temperature --- src/main/target/BROTHERHOBBYH743/target.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/target/BROTHERHOBBYH743/target.h b/src/main/target/BROTHERHOBBYH743/target.h index 8cca3a9a39c..b069f0ccfd0 100644 --- a/src/main/target/BROTHERHOBBYH743/target.h +++ b/src/main/target/BROTHERHOBBYH743/target.h @@ -99,8 +99,8 @@ #define MAG_I2C_BUS BUS_I2C1 #define USE_MAG_ALL -#define TEMPERATURE_I2C_BUS BUS_I2C2 -#define PITOT_I2C_BUS BUS_I2C2 +#define TEMPERATURE_I2C_BUS BUS_I2C1 +#define PITOT_I2C_BUS BUS_I2C1 #define USE_RANGEFINDER #define RANGEFINDER_I2C_BUS BUS_I2C1 From 7f09524a3d16f362005a3fdff34207d8a590d562 Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Mon, 7 Apr 2025 00:33:26 -0500 Subject: [PATCH 5/5] Do not change .vscode options --- .vscode/settings.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7882c26ab7b..5de759a0db4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,9 +13,6 @@ "editor.insertSpaces": true, "editor.detectIndentation": false, "editor.expandTabs": true, - "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, BreakBeforeBraces: Mozilla }", - "cSpell.words": [ - "BROTHERHOBBYH" - ] + "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, BreakBeforeBraces: Mozilla }" } \ No newline at end of file