ardupilot/libraries/AP_HAL_ChibiOS/hwdef/MatekF405-Wing/hwdef.dat

176 lines
3.9 KiB
Plaintext

# hw definition file for processing by chibios_pins.py
# Matek F405-Wing, developed by David Ingraham
# Board configuration borrowed from Inav F405SE target
# There is currently an issue with UART Mapping. For now, reference the table below:
#-----------------------------------------------------------------------------------
# Serial1 - T3/R3
# Serial2 - T4/R4
# Serial3 - T1/R1
# Serial4 - T5/R5
# Serial5 - T6/R6
#################################################
### MCU CONFIGURATION ###
#################################################
# MCU class and specific type
MCU STM32F4xx STM32F405xx
define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_MATEKF405WING
# board ID for firmware load
APJ_BOARD_ID 127
# crystal frequency
OSCILLATOR_HZ 8000000
STM32_PLLM_VALUE 8
define STM32_ST_USE_TIMER 5
define CH_CFG_ST_RESOLUTION 32
# reserve 16k for bootloader, 16k for OSD and 32k for flash storage
FLASH_RESERVE_START_KB 64
FLASH_SIZE_KB 1024
define HAL_STORAGE_SIZE 15360
define STORAGE_FLASH_PAGE 1
# board voltage
STM32_VDD 330U
# I2C Buses
I2C_ORDER I2C1 I2C2
# order of UARTs
UART_ORDER OTG1 USART1 USART3 UART4 UART5 USART6
#################################################
### PIN DEFINITIONS ###
#################################################
PA0 UART4_TX UART4
PA1 UART4_RX UART4
# USART 2 is used for RC Input
# PA2 USART2_TX USART2
# PA3 USART2_RX USART2
PA3 TIM2_CH4 TIM2 RCININT FLOAT LOW
PA4 MPU_CS CS
# IMU SPI
PA5 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1
PA7 SPI1_MOSI SPI1
PA9 USART1_TX USART1
PA10 USART1_RX USART1
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA14 LED_BLUE OUTPUT LOW GPIO(0)
PA13 LED_GREEN OUTPUT LOW GPIO(1) # optional
define HAL_GPIO_A_LED_PIN 0
define HAL_GPIO_B_LED_PIN 1
#pwm output
PB7 TIM4_CH2 TIM4 PWM(1) GPIO(59)
PB6 TIM4_CH1 TIM4 PWM(2) GPIO(58)
PB0 TIM3_CH3 TIM3 PWM(3) GPIO(26)
PB1 TIM3_CH4 TIM3 PWM(4) GPIO(27)
PC8 TIM8_CH3 TIM8 PWM(5) GPIO(39)
PC9 TIM8_CH4 TIM8 PWM(6) GPIO(40)
PB14 TIM1_CH2N TIM1 PWM(7) GPIO(35)
PB15 TIM1_CH3N TIM1 PWM(8) GPIO(36)
PA8 TIM1_CH1 TIM1 PWM(9) GPIO(41)
# SD CARD SPI
PB3 SPI3_SCK SPI3
PB4 SPI3_MISO SPI3
PB5 SPI3_MOSI SPI3
PC14 SDCARD_CS CS
PB8 I2C1_SCL I2C1
PB9 I2C1_SDA I2C1
PB10 I2C2_SCL I2C2
PB11 I2C2_SDA I2C2
# OSD SPI
PB12 OSD_CS CS
PB13 SPI2_SCK SPI2
PC2 SPI2_MISO SPI2
PC3 SPI2_MOSI SPI2
PC0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
PC5 RSSI_ADC_PIN ADC1 SCALE(1)
PC6 USART6_TX USART6
PC7 USART6_RX USART6
PC10 USART3_TX USART3
PC11 USART3_RX USART3
PC12 UART5_TX UART5
PD2 UART5_RX UART5
PC13 VBUS INPUT OPENDRAIN
PC15 BUZZER OUTPUT GPIO(80) LOW
define HAL_BUZZER_PIN 80
define HAL_BUZZER_ON 1
define HAL_BUZZER_OFF 0
#################################################
### DEVICES ###
#################################################
# MPU6000 on SPI
SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 4*MHZ
# OSD on SPI
SPIDEV osd SPI2 DEVID2 OSD_CS MODE0 10*MHZ 10*MHZ
# SD Card on SPI
SPIDEV sdcard SPI3 DEVID3 SDCARD_CS MODE0 400*KHZ 25*MHZ
# Baro on I2C
define HAL_BARO_DEFAULT HAL_BARO_BMP280_I2C
define HAL_BARO_BMP280_BUS 0
define HAL_BARO_BMP280_I2C_ADDR 0x76
define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI
define HAL_INS_DEFAULT_ROTATION ROTATION_YAW_180
define HAL_OS_FATFS_IO 1
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
define HAL_DATAFLASH_FILE_BUFSIZE 8
define HAL_DATAFLASH_MAV_BUFSIZE 2
define HAL_BATT_VOLT_PIN 10
define HAL_BATT_CURR_PIN 11
define HAL_BATT_VOLT_SCALE 11
define HAL_BATT_CURR_SCALE 31.7
define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
define HAL_COMPASS_HMC5843_I2C_BUS 1
define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E
define HAL_COMPASS_HMC5843_ROTATION ROTATION_YAW_90
define ALLOW_ARM_NO_COMPASS
define OSD_ENABLED ENABLED
ROMFS osd_font.bin libraries/AP_OSD/fonts/clarity.bin
define BOARD_PWM_COUNT_DEFAULT 9
define STM32_PWM_USE_ADVANCED TRUE