ardupilot/libraries/AP_HAL_ChibiOS/hwdef/SPRacingH7RF/hwdef.dat

181 lines
3.9 KiB
Plaintext
Raw Normal View History

# hw definition file for processing by chibios_pins.py
# for SP/Racing Extreme H7 hardware.
# thanks to betaflight for pin information
# MCU class and specific type
MCU STM32H7xx STM32H730xx
# board ID for firmware load
APJ_BOARD_ID 1108
# crystal frequency, setup to use external oscillator
OSCILLATOR_HZ 8000000
MCU_CLOCKRATE_MHZ 520
env OPTIMIZE -O2
define HAL_WITH_EKF_DOUBLE 0
STM32_ST_USE_TIMER 2
# internal flash is off limits
FLASH_SIZE_KB 128
FLASH_RESERVE_START_KB 0
define HAL_FLASH_PROTECTION 1
EXT_FLASH_SIZE_MB 2
I2C_ORDER I2C1 I2C2
# order of UARTs (and USB)
SERIAL_ORDER OTG1 EMPTY USART2 USART3 UART4 UART5 EMPTY EMPTY UART8
# Buzzer - DMA timer channel use by LEDs
PD7 BUZZER OUTPUT GPIO(80) LOW
define HAL_BUZZER_PIN 80
define HAL_BUZZER_ON 1
define HAL_BUZZER_OFF 0
# USB
PA11 OTG_HS_DM OTG1
PA12 OTG_HS_DP OTG1
# Debug
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
# SPI2 SX1280
# Requires a driver!
PB12 SX1280_CS CS
PD3 SPI2_SCK SPI2
PB14 SPI2_MISO SPI2
PB15 SPI2_MOSI SPI2
# SPI6 ICM42688
PA15 ICM42688_CS CS
PB3 SPI6_SCK SPI6
PB4 SPI6_MISO SPI6
PB5 SPI6_MOSI SPI6
# SPI4 for OSD
PE11 PIXELOSD_CS CS
PE12 SPI4_SCK SPI4
PE13 SPI4_MISO SPI4
PE14 SPI4_MOSI SPI4
# I2C1 for external MAG connection on J8, no pull-ups, external pull-ups REQUIRED
PB8 I2C1_SCL I2C1 PULLUP
PB9 I2C1_SDA I2C1 PULLUP
# I2C2 has BMP388 internally connected, 10k pull-ups
PB10 I2C2_SCL I2C2 PULLUP
PB11 I2C2_SDA I2C2 PULLUP
# ESC1 connector BATT/CURRENT
PC3 BATT_VOLTAGE_SENS ADC2 SCALE(1)
PC1 BATT_CURRENT_SENS ADC2 SCALE(1)
# ESC2 connector CURRENT
PC0 BATT_CURRENT_SENS2 ADC2 SCALE(1) # analog pin 10
# VTX Power control - should be high at startup to ensure power
PC15 VTX_PWR OUTPUT HIGH GPIO(81)
define RELAY2_PIN_DEFAULT 81
# define default battery setup
define HAL_BATT_VOLT_PIN 13
define HAL_BATT_CURR_PIN 11
define HAL_BATT_VOLT_SCALE 10.9
define HAL_BATT_CURR_SCALE 28.5
define HAL_BATT_MONITOR_DEFAULT 4
# USART2
PD6 USART2_RX USART2
PD5 USART2_TX USART2
# USART3
PD9 USART3_RX USART3
PD8 USART3_TX USART3
# UART4
PD0 UART4_RX UART4
PD1 UART4_TX UART4
# UART5 (ESC Telem)
PB13 UART5_TX UART5
# UART8
PE0 UART8_RX UART8
PE1 UART8_TX UART8
# SD card
PC8 SDMMC1_D0 SDMMC1
PC9 SDMMC1_D1 SDMMC1
PC10 SDMMC1_D2 SDMMC1
PC11 SDMMC1_D3 SDMMC1
PC12 SDMMC1_CK SDMMC1
PD2 SDMMC1_CMD SDMMC1
# OctoSPI Flash
PD11 OCTOSPIM_P1_IO0 OCTOSPI1
PD12 OCTOSPIM_P1_IO1 OCTOSPI1
PE2 OCTOSPIM_P1_IO2 OCTOSPI1
PD13 OCTOSPIM_P1_IO3 OCTOSPI1
PE7 OCTOSPIM_P1_IO4 OCTOSPI1
PE8 OCTOSPIM_P1_IO5 OCTOSPI1
PE9 OCTOSPIM_P1_IO6 OCTOSPI1
PE10 OCTOSPIM_P1_IO7 OCTOSPI1
PB6 OCTOSPIM_P1_NCS OCTOSPI1
PB2 OCTOSPIM_P1_CLK OCTOSPI1
# Motors
// On 4in1ESC_1 (Top)
PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50) BIDIR # M1
PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) # M1
PA6 TIM3_CH1 TIM3 PWM(3) GPIO(52) BIDIR # M3
PA7 TIM3_CH2 TIM3 PWM(4) GPIO(53) # M4
// On 4in1ESC_2 (Bottom)
PA0 TIM5_CH1 TIM5 PWM(5) GPIO(54) BIDIR # M5
PA1 TIM5_CH2 TIM5 PWM(6) GPIO(55) # M6
PA2 TIM5_CH3 TIM5 PWM(7) GPIO(56) BIDIR # M7
PA3 TIM5_CH4 TIM5 PWM(8) GPIO(57) # M8
// On
PB7 TIM17_CH1N TIM17 PWM(9) GPIO(58) # LED
# Red LED
PE5 LED0 OUTPUT LOW GPIO(90)
PE6 LED1 OUTPUT LOW GPIO(91)
# spi devices
SPIDEV icm42688 SPI6 DEVID1 ICM42688_CS MODE3 2*MHZ 16*MHZ
#SPIDEV osd SPI4 DEVID4 PIXELOSD_CS MODE0 10*MHZ 10*MHZ
#SPIDEV radio SPI2 DEVID1 SX1280_CS MODE0 10*MHZ 10*MHZ
DMA_PRIORITY SPI6* SPI2* TIM3*
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
define ALLOW_ARM_NO_COMPASS
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
define HAL_I2C_INTERNAL_MASK 2
IMU Invensensev3 SPI:icm42688 ROTATION_YAW_90
define HAL_DEFAULT_INS_FAST_SAMPLE 1
# one BARO
BARO BMP388 I2C:1:0x76
# setup for OSD
#define OSD_ENABLED 1
#define HAL_OSD_TYPE_DEFAULT 1
#ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
define HAL_OS_FATFS_IO 1
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
define BOARD_PWM_COUNT_DEFAULT 9
define HAL_STORAGE_SIZE 16384