2018-06-19 04:45:21 -03:00
|
|
|
# hw definition file for processing by chibios_pins.py
|
|
|
|
# Matek F405-Wing, developed by David Ingraham
|
|
|
|
# Board configuration borrowed from Inav F405SE target
|
|
|
|
|
2018-07-11 07:28:36 -03:00
|
|
|
# Read hwdef/fmuv3/hwdef.dat for more info on these options
|
|
|
|
|
|
|
|
# SerialX ports are mapped as printed on the top board
|
|
|
|
# R1/T1 -> Serial1
|
|
|
|
# R2 -> Sbus (T2 not currently used or available)
|
|
|
|
# R3/T3 -> Serial3
|
|
|
|
# R4/T4 -> Serial4
|
|
|
|
# R5/T5 -> Serial5
|
|
|
|
# R6/T6 -> Serial6
|
|
|
|
|
|
|
|
# Note: UART4/Serial4, UART5/Serial5, USART6/Serial6 have no DMA on RX (TX always DMA).
|
|
|
|
# If sending highspeed serial data (eg. 921600 baud) to the board, use Serial1/Serial3.
|
2018-06-19 04:45:21 -03:00
|
|
|
|
|
|
|
#################################################
|
|
|
|
### MCU CONFIGURATION ###
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32F4xx STM32F405xx
|
|
|
|
|
|
|
|
# board ID for firmware load
|
|
|
|
APJ_BOARD_ID 127
|
|
|
|
|
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 8000000
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-06-23 05:00:05 -03:00
|
|
|
define HAL_STORAGE_SIZE 15360
|
2021-10-27 02:32:43 -03:00
|
|
|
STORAGE_FLASH_PAGE 1
|
2018-06-19 04:45:21 -03:00
|
|
|
|
|
|
|
|
|
|
|
# I2C Buses
|
|
|
|
I2C_ORDER I2C1 I2C2
|
|
|
|
|
|
|
|
# order of UARTs
|
2020-04-24 08:10:08 -03:00
|
|
|
SERIAL_ORDER OTG1 USART1 EMPTY USART3 UART4 UART5 USART6 USART2
|
2018-06-19 04:45:21 -03:00
|
|
|
|
|
|
|
#################################################
|
|
|
|
### PIN DEFINITIONS ###
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
PA0 UART4_TX UART4
|
|
|
|
PA1 UART4_RX UART4
|
|
|
|
|
2020-01-02 19:34:39 -04:00
|
|
|
# default to timer for RC input
|
2021-10-10 18:28:57 -03:00
|
|
|
PA3 TIM9_CH2 TIM9 RCININT PULLDOWN LOW
|
2018-06-19 04:45:21 -03:00
|
|
|
|
2020-01-02 19:34:39 -04:00
|
|
|
# alternative using USART2
|
|
|
|
PA2 USART2_TX USART2 NODMA
|
|
|
|
PA3 USART2_RX USART2 NODMA ALT(1)
|
|
|
|
|
2018-06-19 04:45:21 -03:00
|
|
|
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
|
2018-10-31 02:10:16 -03:00
|
|
|
PB7 TIM4_CH2 TIM4 PWM(1) GPIO(50)
|
|
|
|
PB6 TIM4_CH1 TIM4 PWM(2) GPIO(51)
|
|
|
|
PB0 TIM3_CH3 TIM3 PWM(3) GPIO(52)
|
|
|
|
PB1 TIM3_CH4 TIM3 PWM(4) GPIO(53)
|
|
|
|
PC8 TIM8_CH3 TIM8 PWM(5) GPIO(54)
|
|
|
|
PC9 TIM8_CH4 TIM8 PWM(6) GPIO(55)
|
|
|
|
PB14 TIM1_CH2N TIM1 PWM(7) GPIO(56)
|
|
|
|
PB15 TIM1_CH3N TIM1 PWM(8) GPIO(57)
|
|
|
|
PA8 TIM1_CH1 TIM1 PWM(9) GPIO(58)
|
2020-03-29 13:24:33 -03:00
|
|
|
PA15 TIM2_CH1 TIM2 PWM(10) GPIO(59) #on LED pin,allows odd motor groups
|
|
|
|
|
2018-06-19 04:45:21 -03:00
|
|
|
|
|
|
|
# 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
|
2018-06-23 04:11:05 -03:00
|
|
|
SPIDEV osd SPI2 DEVID2 OSD_CS MODE0 10*MHZ 10*MHZ
|
2018-06-19 04:45:21 -03:00
|
|
|
|
|
|
|
# SD Card on SPI
|
|
|
|
SPIDEV sdcard SPI3 DEVID3 SDCARD_CS MODE0 400*KHZ 25*MHZ
|
|
|
|
|
2019-05-29 23:32:51 -03:00
|
|
|
# one IMU
|
|
|
|
IMU Invensense SPI:mpu6000 ROTATION_YAW_180
|
2018-06-19 04:45:21 -03:00
|
|
|
|
2020-12-23 22:02:11 -04:00
|
|
|
# one baro, multiple possible choices for different board variants
|
2019-05-29 23:32:51 -03:00
|
|
|
BARO BMP280 I2C:0:0x76
|
2020-07-09 05:15:37 -03:00
|
|
|
BARO DPS310 I2C:0:0x76
|
2018-06-19 04:45:21 -03:00
|
|
|
|
|
|
|
define HAL_OS_FATFS_IO 1
|
|
|
|
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
|
|
|
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
2018-07-15 17:31:48 -03:00
|
|
|
|
|
|
|
# define default battery setup
|
2018-10-31 07:26:09 -03:00
|
|
|
define HAL_BATT_MONITOR_DEFAULT 4
|
2018-06-19 04:45:21 -03:00
|
|
|
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
|
|
|
|
|
2018-07-15 17:31:48 -03:00
|
|
|
#analog rssi pin (also could be used as analog airspeed input)
|
|
|
|
# PC5 - ADC12_CH15
|
|
|
|
define BOARD_RSSI_ANA_PIN 15
|
|
|
|
|
2018-07-13 07:14:03 -03:00
|
|
|
# no built-in compass, but probe the i2c bus for all possible
|
|
|
|
# external compass types
|
2018-06-19 04:45:21 -03:00
|
|
|
define ALLOW_ARM_NO_COMPASS
|
2018-07-13 07:14:03 -03:00
|
|
|
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
|
|
|
define HAL_I2C_INTERNAL_MASK 0
|
2018-07-28 02:36:37 -03:00
|
|
|
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
2018-06-19 04:45:21 -03:00
|
|
|
|
2019-12-20 13:46:24 -04:00
|
|
|
define OSD_ENABLED 1
|
2018-10-31 21:10:21 -03:00
|
|
|
define HAL_OSD_TYPE_DEFAULT 1
|
2021-04-08 18:27:54 -03:00
|
|
|
ROMFS_WILDCARD libraries/AP_OSD/fonts/font0.bin
|
2018-06-23 04:11:05 -03:00
|
|
|
|
2018-06-19 04:45:21 -03:00
|
|
|
define STM32_PWM_USE_ADVANCED TRUE
|
|
|
|
|
2022-06-28 14:00:17 -03:00
|
|
|
# disable SMBUS battery monitors to save flash
|
2022-01-31 14:33:50 -04:00
|
|
|
define AP_BATTMON_SMBUS_ENABLE 0
|
2020-01-17 18:58:44 -04:00
|
|
|
|
|
|
|
# disable parachute and sprayer to save flash
|
|
|
|
define HAL_PARACHUTE_ENABLED 0
|
|
|
|
define HAL_SPRAYER_ENABLED 0
|
2019-12-12 03:31:26 -04:00
|
|
|
|
2020-01-30 19:53:03 -04:00
|
|
|
# reduce max size of embedded params for apj_tool.py
|
|
|
|
define AP_PARAM_MAX_EMBEDDED_PARAM 1024
|
2019-08-09 13:04:28 -03:00
|
|
|
define HAL_WITH_DSP FALSE
|
2021-04-08 18:27:54 -03:00
|
|
|
|
|
|
|
# save some flash
|
2021-09-24 00:10:47 -03:00
|
|
|
define HAL_GENERATOR_ENABLED 0
|
2021-04-08 18:27:54 -03:00
|
|
|
define AC_OAPATHPLANNER_ENABLED 0
|
|
|
|
define PRECISION_LANDING 0
|
2021-06-08 01:17:38 -03:00
|
|
|
define HAL_BARO_WIND_COMP_ENABLED 0
|
2021-06-09 14:31:32 -03:00
|
|
|
define GRIPPER_ENABLED 0
|
2022-01-05 03:36:19 -04:00
|
|
|
define AP_OPTICALFLOW_ENABLED 0
|
2022-08-12 22:03:57 -03:00
|
|
|
define AP_ICENGINE_ENABLED 0
|