From fad5ef6b8c98228a819163b3e2074a72088f37c3 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:46:19 -0500 Subject: [PATCH] [target] JHEF405PRO add BMI270, ICM42688P; retain MPU6000 CW180; retain MPU6500 (questionable) --- src/main/target/JHEF405PRO/target.h | 281 ++++++++++++++------------- src/main/target/JHEF405PRO/target.mk | 8 +- 2 files changed, 153 insertions(+), 136 deletions(-) diff --git a/src/main/target/JHEF405PRO/target.h b/src/main/target/JHEF405PRO/target.h index 39494e436c..ca0e7ffe69 100644 --- a/src/main/target/JHEF405PRO/target.h +++ b/src/main/target/JHEF405PRO/target.h @@ -18,136 +18,151 @@ * If not, see . */ - #pragma once - - #define TARGET_BOARD_IDENTIFIER "JH4P" - #define USBD_PRODUCT_STRING "JHEF405PRO" - #define TARGET_MANUFACTURER_IDENTIFIER "JHEM" - - #define USE_TARGET_CONFIG - - #define LED0_PIN PC14 - - #define USE_BEEPER - #define BEEPER_PIN PC13 - #define BEEPER_INVERTED - - #define ENABLE_DSHOT_DMAR true - - #define USE_EXTI - #define MPU_INT_EXTI PB13 - #define USE_MPU_DATA_READY_SIGNAL - - #define USE_GYRO - #define USE_GYRO_SPI_MPU6000 - #define MPU6000_CS_PIN PB12 - #define MPU6000_SPI_INSTANCE SPI1 - #define GYRO_MPU6000_ALIGN CW180_DEG - #define USE_GYRO_SPI_MPU6500 - #define GYRO_MPU6500_ALIGN CW180_DEG - #define MPU6500_CS_PIN MPU6000_CS_PIN - #define MPU6500_SPI_INSTANCE MPU6000_SPI_INSTANCE - - #define USE_ACC - #define USE_ACC_SPI_MPU6000 - #define ACC_MPU6000_ALIGN CW180_DEG - #define USE_ACC_SPI_MPU6500 - #define ACC_MPU6500_ALIGN CW180_DEG - - - #define USE_BARO - #define USE_BARO_BMP280 - #define USE_BARO_BMP085 - #define USE_BARO_ms5611 - #define BARO_I2C_INSTANCE (I2CDEV_1) - - #define USE_MAG - #define USE_MAG_HMC5883 - #define USE_MAG_QMC5883 - #define MAG_I2C_INSTANCE (I2CDEV_1) - - #define USE_MAX7456 - #define MAX7456_SPI_INSTANCE SPI3 - #define MAX7456_SPI_CS_PIN PB14 - - #define USE_FLASHFS - #define USE_FLASH_M25P16 - #define FLASH_SPI_INSTANCE SPI3 - #define FLASH_CS_PIN PB3 - #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT - - #define USE_VCP - #define USE_USB_DETECT - #define USB_DETECT_PIN PA8 - - #define USE_UART1 - #define UART1_RX_PIN PA10 - #define UART1_TX_PIN PB6 - - #define USE_UART2 - #define UART2_RX_PIN PD6 - #define UART2_TX_PIN PD5 - - #define USE_UART3 - #define UART3_RX_PIN PB11 - #define UART3_TX_PIN PB10 - - #define USE_UART4 - #define UART4_RX_PIN PA1 - #define UART4_TX_PIN PA0 - - #define USE_UART6 - #define UART6_RX_PIN PC7 - #define UART6_TX_PIN PC6 - - #define SERIAL_PORT_COUNT 6 //USB + 5 UARTS - - #define USE_ESCSERIAL //PPM - #define ESCSERIAL_TIMER_TX_PIN PB8 - #define USE_SERIAL_4WAY_BLHELI_INTERFACE - - #define USE_SPI - #define USE_SPI_DEVICE_1 - #define SPI1_SCK_PIN PA5 - #define SPI1_MISO_PIN PA6 - #define SPI1_MOSI_PIN PA7 - - #define USE_SPI_DEVICE_3 - #define SPI3_SCK_PIN PC10 - #define SPI3_MISO_PIN PC11 - #define SPI3_MOSI_PIN PC12 - - #define USE_I2C - #define USE_I2C_DEVICE_1 - #define I2C2_SCL PB8 - #define I2C2_SDA PB9 - #define I2C_DEVICE (I2CDEV_1) - - #define USE_PINIO - #define USE_PINIOBOX - - #define USE_DASHBOARD - #define USE_I2C_OLED_DISPLAY - - #define USE_ADC - #define ADC1_DMA_STREAM DMA2_Stream0 - #define VBAT_ADC_PIN PC3 - #define CURRENT_METER_ADC_PIN PC2 - #define RSSI_ADC_PIN PC0 - #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC - #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC - #define CURRENT_METER_SCALE_DEFAULT 170 - - #define SERIALRX_PROVIDER SERIALRX_SBUS - #define SERIALRX_UART SERIAL_PORT_USART1 - - #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL - #define DEFAULT_FEATURES ( FEATURE_OSD ) - - #define TARGET_IO_PORTA ( 0xffff ) - #define TARGET_IO_PORTB ( 0xffff ) - #define TARGET_IO_PORTC ( 0xffff ) - #define TARGET_IO_PORTD ( 0xffff ) - - #define USABLE_TIMER_CHANNEL_COUNT 9 - #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8)) +#pragma once + +#define BOARD_NAME JHEF405PRO +#define MANUFACTURER_ID JHEF +#define TARGET_BOARD_IDENTIFIER "S405" // generic ID +#define FC_TARGET_MCU STM32F405 // not used in EmuF + +#define USE_TARGET_CONFIG + +#define LED0_PIN PC14 + +#define USE_BEEPER +#define BEEPER_PIN PC13 +#define BEEPER_INVERTED + +#define ENABLE_DSHOT_DMAR true + +#define USE_EXTI +#define MPU_INT_EXTI PB13 +#define USE_MPU_DATA_READY_SIGNAL + +#define USE_GYRO +#define USE_GYRO_SPI_MPU6000 +#define USE_GYRO_SPI_MPU6500 +#define USE_GYRO_SPI_ICM42688P + +#define USE_ACC +#define USE_ACC_SPI_MPU6000 +#define USE_ACC_SPI_MPU6500 +#define USE_ACCGYRO_BMI270 +#define USE_ACC_SPI_ICM42688P + +#define GYRO_MPU6000_ALIGN CW180_DEG +#define ACC_MPU6000_ALIGN CW180_DEG +#define MPU6000_CS_PIN PB12 +#define MPU6000_SPI_INSTANCE SPI1 + +#define GYRO_MPU6500_ALIGN CW180_DEG +#define ACC_MPU6500_ALIGN CW180_DEG +#define MPU6500_CS_PIN PB12 +#define MPU6500_SPI_INSTANCE SPI1 + +#define ACC_ICM42688P_ALIGN CW90_DEG +#define GYRO_ICM42688P_ALIGN CW90_DEG +#define ICM42688P_CS_PIN PB12 +#define ICM42688P_SPI_INSTANCE SPI1 + +#define ACC_BMI270_ALIGN CW90_DEG +#define GYRO_BMI270_ALIGN CW90_DEG +#define BMI270_CS_PIN PB12 +#define BMI270_SPI_INSTANCE SPI1 + +#define USE_BARO +#define USE_BARO_BMP280 +#define USE_BARO_BMP085 +#define USE_BARO_ms5611 +#define BARO_I2C_INSTANCE (I2CDEV_1) + +#define USE_MAG +#define USE_MAG_HMC5883 +#define USE_MAG_QMC5883 +#define MAG_I2C_INSTANCE (I2CDEV_1) + +#define USE_MAX7456 +#define MAX7456_SPI_INSTANCE SPI3 +#define MAX7456_SPI_CS_PIN PB14 + +#define USE_FLASHFS +#define USE_FLASH_M25P16 +#define FLASH_SPI_INSTANCE SPI3 +#define FLASH_CS_PIN PB3 +#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT + +#define USE_VCP +#define USE_USB_DETECT +#define USB_DETECT_PIN PA8 + +#define USE_UART1 +#define UART1_RX_PIN PA10 +#define UART1_TX_PIN PB6 + +#define USE_UART2 +#define UART2_RX_PIN PD6 +#define UART2_TX_PIN PD5 + +#define USE_UART3 +#define UART3_RX_PIN PB11 +#define UART3_TX_PIN PB10 + +#define USE_UART4 +#define UART4_RX_PIN PA1 +#define UART4_TX_PIN PA0 + +#define USE_UART6 +#define UART6_RX_PIN PC7 +#define UART6_TX_PIN PC6 + +#define SERIAL_PORT_COUNT 6 //USB + 5 UARTS + +#define USE_ESCSERIAL //PPM +#define ESCSERIAL_TIMER_TX_PIN PB8 +#define USE_SERIAL_4WAY_BLHELI_INTERFACE + +#define USE_SPI +#define USE_SPI_DEVICE_1 +#define SPI1_SCK_PIN PA5 +#define SPI1_MISO_PIN PA6 +#define SPI1_MOSI_PIN PA7 + +#define USE_SPI_DEVICE_3 +#define SPI3_SCK_PIN PC10 +#define SPI3_MISO_PIN PC11 +#define SPI3_MOSI_PIN PC12 + +#define USE_I2C +#define USE_I2C_DEVICE_1 +#define I2C2_SCL PB8 +#define I2C2_SDA PB9 +#define I2C_DEVICE (I2CDEV_1) + +#define USE_PINIO +#define USE_PINIOBOX + +#define USE_DASHBOARD +#define USE_I2C_OLED_DISPLAY + +#define USE_ADC +#define ADC1_DMA_STREAM DMA2_Stream0 +#define VBAT_ADC_PIN PC3 +#define CURRENT_METER_ADC_PIN PC2 +#define RSSI_ADC_PIN PC0 +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC +#define CURRENT_METER_SCALE_DEFAULT 170 + +#define SERIALRX_PROVIDER SERIALRX_SBUS +#define SERIALRX_UART SERIAL_PORT_USART1 + +#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL +#define DEFAULT_FEATURES ( FEATURE_OSD ) + +#define TARGET_IO_PORTA ( 0xffff ) +#define TARGET_IO_PORTB ( 0xffff ) +#define TARGET_IO_PORTC ( 0xffff ) +#define TARGET_IO_PORTD ( 0xffff ) + +#define USABLE_TIMER_CHANNEL_COUNT 9 +#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8)) diff --git a/src/main/target/JHEF405PRO/target.mk b/src/main/target/JHEF405PRO/target.mk index f0e8fa3671..b4a787048c 100644 --- a/src/main/target/JHEF405PRO/target.mk +++ b/src/main/target/JHEF405PRO/target.mk @@ -4,12 +4,14 @@ FEATURES += VCP ONBOARDFLASH TARGET_SRC = \ drivers/accgyro/accgyro_mpu.c \ drivers/accgyro/accgyro_spi_mpu6000.c \ - drivers/accgyro/accgyro_mpu6500.c \ - drivers/accgyro/accgyro_spi_mpu6500.c \ + drivers/accgyro/accgyro_mpu6500.c \ + drivers/accgyro/accgyro_spi_mpu6500.c \ + drivers/accgyro/accgyro_spi_icm426xx.c \ + drivers/accgyro/accgyro_spi_bmi270.c \ drivers/barometer/barometer_bmp085.c \ drivers/barometer/barometer_bmp280.c \ drivers/barometer/barometer_ms5611.c \ drivers/compass/compass_hmc5883l.c \ drivers/compass/compass_qmc5883l.c \ drivers/max7456.c \ - drivers/light_ws2811strip.c + drivers/light_ws2811strip.c