2023-06-27 09:35:53 -03:00
|
|
|
# hw definition file for processing by chibios_hwdef.py for A6_YJUAV
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32H7xx STM32H743xx
|
|
|
|
|
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 16000000
|
|
|
|
|
|
|
|
# board ID for firmware load
|
|
|
|
APJ_BOARD_ID 1113
|
|
|
|
|
|
|
|
FLASH_SIZE_KB 2048
|
|
|
|
|
|
|
|
# with 2M flash we can afford to optimize for speed
|
|
|
|
env OPTIMIZE -O2
|
|
|
|
|
|
|
|
# ChibiOS system timer
|
|
|
|
STM32_ST_USE_TIMER 5
|
|
|
|
|
|
|
|
# bootloader takes first sector
|
|
|
|
FLASH_RESERVE_START_KB 128
|
|
|
|
|
|
|
|
# order of UARTs (and USB)
|
|
|
|
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART5 UART8 UART7 OTG2
|
|
|
|
|
|
|
|
# now we define the pins that USB is connected on
|
|
|
|
PA11 OTG_FS_DM OTG1
|
|
|
|
PA12 OTG_FS_DP OTG1
|
|
|
|
|
|
|
|
# USART1 TELEM1
|
|
|
|
PA10 USART1_RX USART1
|
|
|
|
PA9 USART1_TX USART1
|
|
|
|
|
|
|
|
# USART2 TELEM2
|
|
|
|
PD6 USART2_RX USART2
|
|
|
|
PD5 USART2_TX USART2
|
|
|
|
|
|
|
|
# USART3 GPS
|
|
|
|
PD9 USART3_RX USART3 NODMA
|
|
|
|
PD8 USART3_TX USART3 NODMA
|
|
|
|
|
|
|
|
# UART5 GPS2
|
|
|
|
PB5 UART5_RX UART5 NODMA
|
|
|
|
PB13 UART5_TX UART5 NODMA
|
|
|
|
|
|
|
|
# SBUS, DSM port
|
|
|
|
PE0 UART8_RX UART8
|
|
|
|
PE1 UART8_TX UART8
|
|
|
|
|
|
|
|
# UART7 DEBUG
|
|
|
|
PE7 UART7_RX UART7 NODMA
|
|
|
|
PE8 UART7_TX UART7 NODMA
|
|
|
|
|
|
|
|
# these are the pins for SWD debugging with a STlinkv2 or black-magic probe
|
|
|
|
PA13 JTMS-SWDIO SWD
|
|
|
|
PA14 JTCK-SWCLK SWD
|
|
|
|
|
|
|
|
# SPI1 -IMU1 -COMPASS
|
|
|
|
PA5 SPI1_SCK SPI1
|
|
|
|
PA6 SPI1_MISO SPI1
|
|
|
|
PD7 SPI1_MOSI SPI1
|
|
|
|
|
|
|
|
# SPI2 -IMU2 -IMU3
|
|
|
|
PD3 SPI2_SCK SPI2
|
|
|
|
PC2 SPI2_MISO SPI2
|
|
|
|
PB15 SPI2_MOSI SPI2
|
|
|
|
|
|
|
|
# SPI4 -FRAM -BAROMETER
|
|
|
|
PE2 SPI4_SCK SPI4
|
|
|
|
PE5 SPI4_MISO SPI4
|
|
|
|
PE6 SPI4_MOSI SPI4
|
|
|
|
|
|
|
|
# SPI3 -Extra SPI
|
|
|
|
PB3 SPI3_SCK SPI3
|
|
|
|
PB4 SPI3_MISO SPI3
|
|
|
|
PB2 SPI3_MOSI SPI3
|
|
|
|
|
|
|
|
# sensors cs
|
|
|
|
PA8 IMU1_CS CS
|
|
|
|
PD4 IMU2_CS CS
|
|
|
|
PD11 IMU3_CS CS
|
|
|
|
PE4 FRAM_CS CS
|
|
|
|
PE3 BAROMETER_CS CS
|
|
|
|
PD10 COMPASS_CS CS
|
|
|
|
PC15 RESERVE_CS CS
|
|
|
|
|
|
|
|
# Extra SPI CS
|
|
|
|
PE10 EXT_CS CS
|
|
|
|
|
|
|
|
# I2C buses
|
|
|
|
PB10 I2C2_SCL I2C2
|
|
|
|
PB11 I2C2_SDA I2C2
|
|
|
|
|
|
|
|
PD12 I2C4_SCL I2C4
|
|
|
|
PD13 I2C4_SDA I2C4
|
|
|
|
|
|
|
|
# order of I2C buses
|
|
|
|
I2C_ORDER I2C2 I2C4
|
|
|
|
|
|
|
|
NODMA I2C*
|
|
|
|
define STM32_I2C_USE_DMA FALSE
|
|
|
|
define HAL_I2C_INTERNAL_MASK 0
|
|
|
|
|
|
|
|
# PWM channels
|
|
|
|
PE9 TIM1_CH1 TIM1 PWM(1) GPIO(50) BIDIR
|
|
|
|
PE11 TIM1_CH2 TIM1 PWM(2) GPIO(51)
|
|
|
|
PE13 TIM1_CH3 TIM1 PWM(3) GPIO(52) BIDIR
|
|
|
|
PE14 TIM1_CH4 TIM1 PWM(4) GPIO(53)
|
|
|
|
PA15 TIM2_CH1 TIM2 PWM(5) GPIO(54) BIDIR
|
|
|
|
PA1 TIM2_CH2 TIM2 PWM(6) GPIO(55)
|
|
|
|
PA2 TIM2_CH3 TIM2 PWM(7) GPIO(56) BIDIR
|
|
|
|
PA3 TIM2_CH4 TIM2 PWM(8) GPIO(57)
|
|
|
|
PC6 TIM3_CH1 TIM3 PWM(9) GPIO(58)
|
|
|
|
PA7 TIM3_CH2 TIM3 PWM(10) GPIO(59)
|
|
|
|
PB0 TIM3_CH3 TIM3 PWM(11) GPIO(60)
|
|
|
|
PB1 TIM3_CH4 TIM3 PWM(12) GPIO(61)
|
|
|
|
PD14 TIM4_CH3 TIM4 PWM(13) GPIO(62) NODMA
|
|
|
|
PD15 TIM4_CH4 TIM4 PWM(14) GPIO(63) NODMA
|
|
|
|
|
|
|
|
# PWM output for buzzer
|
|
|
|
PB14 TIM12_CH1 TIM12 GPIO(77) ALARM
|
|
|
|
|
|
|
|
# RC input
|
|
|
|
PC7 TIM8_CH2 TIM8 RCININT PULLUP LOW
|
|
|
|
|
|
|
|
# Analog in
|
|
|
|
PC0 BATT_CURRENT_SENS ADC1 SCALE(1)
|
|
|
|
PC1 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
|
|
|
|
|
|
|
# ADC3.3/ADC6.6
|
|
|
|
PC4 SPARE1_ADC1 ADC1 SCALE(1)
|
|
|
|
PC5 SPARE2_ADC1 ADC1 SCALE(2)
|
|
|
|
|
|
|
|
PC3 VDD_5V_SENS ADC1 SCALE(2)
|
|
|
|
PA4 RSSI_IN ADC1 SCALE(1)
|
|
|
|
|
|
|
|
# CAN bus
|
|
|
|
PD0 CAN1_RX CAN1
|
|
|
|
PD1 CAN1_TX CAN1
|
|
|
|
|
|
|
|
PB12 CAN2_RX CAN2
|
|
|
|
PB6 CAN2_TX CAN2
|
|
|
|
|
|
|
|
# GPIOs
|
|
|
|
PC14 HEATER_EN OUTPUT LOW GPIO(80)
|
|
|
|
define HAL_HEATER_GPIO_PIN 80
|
|
|
|
define HAL_HAVE_IMU_HEATER 1
|
|
|
|
|
|
|
|
# enable pins
|
|
|
|
PC13 VDD_3V3_SENSORS_EN OUTPUT LOW
|
|
|
|
|
|
|
|
# red LED marked as B/E
|
|
|
|
PE12 LED_R1 OUTPUT OPENDRAIN HIGH GPIO(0)
|
|
|
|
PE15 LED_G1 OUTPUT OPENDRAIN HIGH GPIO(1)
|
|
|
|
PB9 LED_B1 OUTPUT OPENDRAIN HIGH GPIO(2)
|
|
|
|
|
2024-07-09 00:19:56 -03:00
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_RED_PIN 0
|
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_GREEN_PIN 1
|
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_BLUE_PIN 2
|
2023-06-27 09:35:53 -03:00
|
|
|
|
|
|
|
# use pixracer style 3-LED indicators
|
2024-07-09 00:19:56 -03:00
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_ENABLED 1
|
2023-06-27 09:35:53 -03:00
|
|
|
|
|
|
|
# allow to have have a dedicated safety switch pin
|
|
|
|
define HAL_HAVE_SAFETY_SWITCH 1
|
|
|
|
PB8 LED_SAFETY OUTPUT
|
|
|
|
PB7 SAFETY_IN INPUT PULLDOWN
|
|
|
|
|
|
|
|
# SPI devices
|
|
|
|
SPIDEV imu1 SPI1 DEVID1 IMU1_CS MODE3 2*MHZ 8*MHZ
|
|
|
|
SPIDEV imu2 SPI2 DEVID1 IMU2_CS MODE3 2*MHZ 8*MHZ
|
|
|
|
SPIDEV imu3 SPI2 DEVID2 IMU3_CS MODE3 2*MHZ 8*MHZ
|
|
|
|
SPIDEV ramtron SPI4 DEVID1 FRAM_CS MODE3 8*MHZ 8*MHZ
|
|
|
|
SPIDEV dps310 SPI4 DEVID2 BAROMETER_CS MODE3 5*MHZ 5*MHZ
|
|
|
|
SPIDEV bmp388 SPI4 DEVID3 BAROMETER_CS MODE3 5*MHZ 5*MHZ
|
2024-04-10 02:36:18 -03:00
|
|
|
SPIDEV rm3100 SPI1 DEVID2 COMPASS_CS MODE3 1*MHZ 1*MHZ
|
2023-06-27 09:35:53 -03:00
|
|
|
|
|
|
|
# IMU1
|
|
|
|
IMU Invensense SPI:imu1 ROTATION_PITCH_180_YAW_90
|
|
|
|
IMU Invensensev3 SPI:imu1 ROTATION_PITCH_180_YAW_90
|
|
|
|
|
|
|
|
# IMU2
|
|
|
|
IMU Invensense SPI:imu2 ROTATION_PITCH_180_YAW_90
|
|
|
|
IMU Invensensev3 SPI:imu2 ROTATION_PITCH_180_YAW_90
|
|
|
|
|
|
|
|
# IMU3
|
|
|
|
IMU Invensense SPI:imu3 ROTATION_YAW_90
|
|
|
|
IMU Invensensev3 SPI:imu3 ROTATION_YAW_90
|
|
|
|
|
|
|
|
define HAL_DEFAULT_INS_FAST_SAMPLE 5
|
|
|
|
|
|
|
|
# baro dps310 or bmp388
|
|
|
|
BARO DPS310 SPI:dps310
|
|
|
|
BARO BMP388 SPI:bmp388
|
|
|
|
|
|
|
|
# compasses rm3100
|
|
|
|
COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180
|
|
|
|
|
|
|
|
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
|
|
|
COMPASS IST8310 I2C:ALL_EXTERNAL:0x0E true ROTATION_ROLL_180_YAW_90
|
|
|
|
COMPASS IST8310 I2C:ALL_INTERNAL:0x0E false ROTATION_ROLL_180_YAW_90
|
|
|
|
|
|
|
|
# microSD support
|
|
|
|
PC8 SDMMC1_D0 SDMMC1
|
|
|
|
PC9 SDMMC1_D1 SDMMC1
|
|
|
|
PC10 SDMMC1_D2 SDMMC1
|
|
|
|
PC11 SDMMC1_D3 SDMMC1
|
|
|
|
PC12 SDMMC1_CK SDMMC1
|
|
|
|
PD2 SDMMC1_CMD SDMMC1
|
|
|
|
|
|
|
|
# enable FAT filesystem support (needs a microSD defined via SDMMC)
|
|
|
|
define HAL_OS_FATFS_IO 1
|
|
|
|
|
|
|
|
# enable RAMTROM parameter storage
|
|
|
|
define HAL_STORAGE_SIZE 32768
|
|
|
|
define HAL_WITH_RAMTRON 1
|
|
|
|
|
|
|
|
DMA_PRIORITY SPI1* SPI2* TIM*UP*
|
|
|
|
DMA_NOSHARE SPI1* SPI2* TIM*UP*
|
|
|
|
|
|
|
|
# Enable Sagetech MXS ADSB transponder
|
|
|
|
define HAL_ADSB_SAGETECH_MXS_ENABLED HAL_ADSB_ENABLED
|
|
|
|
|