2024-03-01 09:06:21 -04:00
|
|
|
# hw definition file for MicoAir405v2 hardware
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32F4xx STM32F405xx
|
|
|
|
|
|
|
|
# board ID for firmware load
|
|
|
|
APJ_BOARD_ID 1150
|
|
|
|
|
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 8000000
|
|
|
|
STM32_PLLM_VALUE 8
|
|
|
|
|
|
|
|
define STM32_ST_USE_TIMER 5
|
|
|
|
define CH_CFG_ST_RESOLUTION 16
|
|
|
|
|
|
|
|
# chip flash size & bootloader & firmware
|
|
|
|
FLASH_SIZE_KB 1024
|
|
|
|
FLASH_RESERVE_START_KB 48
|
|
|
|
|
|
|
|
define HAL_STORAGE_SIZE 15360
|
|
|
|
STORAGE_FLASH_PAGE 1
|
|
|
|
|
|
|
|
# board voltage
|
|
|
|
STM32_VDD 330U
|
|
|
|
|
|
|
|
# LEDs
|
|
|
|
PA8 LED_BLUE OUTPUT LOW GPIO(0)
|
|
|
|
PC4 LED_GREEN OUTPUT LOW GPIO(1)
|
|
|
|
PC5 LED_RED OUTPUT LOW GPIO(2)
|
|
|
|
|
2024-07-09 00:19:56 -03:00
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_RED_PIN 2
|
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_GREEN_PIN 1
|
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_BLUE_PIN 0
|
2024-03-01 09:06:21 -04:00
|
|
|
|
2024-07-09 00:19:56 -03:00
|
|
|
define AP_NOTIFY_GPIO_LED_RGB_ENABLED 1
|
2024-03-01 09:06:21 -04:00
|
|
|
|
|
|
|
# only one I2C bus
|
|
|
|
I2C_ORDER I2C1
|
|
|
|
PB6 I2C1_SCL I2C1
|
|
|
|
PB7 I2C1_SDA I2C1
|
|
|
|
|
|
|
|
# spi1 bus for OSD
|
|
|
|
PA5 SPI1_SCK SPI1
|
|
|
|
PA6 SPI1_MISO SPI1
|
|
|
|
PA7 SPI1_MOSI SPI1
|
|
|
|
|
|
|
|
# spi2 bus for IMU
|
|
|
|
PB13 SPI2_SCK SPI2
|
|
|
|
PC2 SPI2_MISO SPI2
|
|
|
|
PC3 SPI2_MOSI SPI2
|
|
|
|
|
|
|
|
# spi3 bus for SDCARD
|
|
|
|
PC10 SPI3_SCK SPI3
|
|
|
|
PC11 SPI3_MISO SPI3
|
|
|
|
PC12 SPI3_MOSI SPI3
|
|
|
|
|
|
|
|
#CS pin
|
|
|
|
PB12 AT7456E_CS CS
|
|
|
|
PA4 SPL06_CS CS
|
|
|
|
PC13 ACCEL_CS CS
|
|
|
|
PC14 GYRO_CS CS
|
|
|
|
PC9 SDCARD_CS CS
|
|
|
|
|
|
|
|
# analog pins
|
|
|
|
PC0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
|
|
|
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
|
|
|
|
|
|
|
|
# define default battery setup
|
|
|
|
define HAL_BATT_VOLT_PIN 10
|
|
|
|
define HAL_BATT_VOLT_SCALE 21.2
|
|
|
|
define HAL_BATT_CURR_PIN 11
|
|
|
|
define HAL_BATT_CURR_SCALE 40.2
|
|
|
|
|
|
|
|
# debug
|
|
|
|
PA13 JTMS-SWDIO SWD
|
|
|
|
PA14 JTCK-SWCLK SWD
|
|
|
|
|
|
|
|
# order of UARTs (and USB)
|
|
|
|
# SERIAL_NUM|SER0|SER1 |SER2 |SER3 |SER4 |SER5 |SER6 |
|
|
|
|
# FUNCTION |USB | |DJIO3 |GPS | |ESC |SBUS |
|
|
|
|
SERIAL_ORDER OTG1 USART1 USART2 USART3 UART4 UART5 USART6
|
|
|
|
|
|
|
|
# USB
|
|
|
|
PA11 OTG_FS_DM OTG1
|
|
|
|
PA12 OTG_FS_DP OTG1
|
|
|
|
|
|
|
|
# USART1
|
|
|
|
PA9 USART1_TX USART1
|
|
|
|
PA10 USART1_RX USART1
|
|
|
|
|
|
|
|
# USART2
|
|
|
|
PA2 USART2_TX USART2
|
2024-03-28 05:16:46 -03:00
|
|
|
PA3 USART2_RX USART2 NODMA
|
2024-03-01 09:06:21 -04:00
|
|
|
|
|
|
|
# USART3
|
|
|
|
PB10 USART3_TX USART3 NODMA
|
2024-03-28 05:16:46 -03:00
|
|
|
PB11 USART3_RX USART3 NODMA
|
2024-03-01 09:06:21 -04:00
|
|
|
|
|
|
|
# UART4
|
|
|
|
PA0 UART4_TX UART4
|
2024-03-28 05:16:46 -03:00
|
|
|
PA1 UART4_RX UART4 NODMA
|
2024-03-01 09:06:21 -04:00
|
|
|
|
|
|
|
# UART5
|
2024-03-28 05:16:46 -03:00
|
|
|
PD2 UART5_RX UART5 NODMA
|
2024-03-01 09:06:21 -04:00
|
|
|
|
|
|
|
# UART6
|
|
|
|
PC7 USART6_RX USART6
|
|
|
|
PC6 USART6_TX USART6 NODMA
|
|
|
|
PC15 SBUS_INV OUTPUT
|
|
|
|
|
|
|
|
# 10 PWM available by default
|
|
|
|
define BOARD_PWM_COUNT_DEFAULT 10
|
|
|
|
|
2024-03-28 05:16:46 -03:00
|
|
|
PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50)
|
|
|
|
PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) BIDIR
|
2024-03-01 09:06:21 -04:00
|
|
|
PA15 TIM2_CH1 TIM2 PWM(3) GPIO(52) BIDIR
|
|
|
|
PB3 TIM2_CH2 TIM2 PWM(4) GPIO(53)
|
|
|
|
PB4 TIM3_CH1 TIM3 PWM(5) GPIO(54)
|
|
|
|
PB5 TIM3_CH2 TIM3 PWM(6) GPIO(55)
|
|
|
|
PB8 TIM4_CH3 TIM4 PWM(7) GPIO(56)
|
|
|
|
PB9 TIM4_CH4 TIM4 PWM(8) GPIO(57)
|
|
|
|
PB14 TIM12_CH1 TIM12 PWM(9) GPIO(58) NODMA
|
|
|
|
PB15 TIM12_CH2 TIM12 PWM(10) GPIO(59) NODMA
|
|
|
|
|
|
|
|
# no built-in compass, but probe the i2c bus for all possible
|
|
|
|
# external compass types
|
|
|
|
define ALLOW_ARM_NO_COMPASS
|
|
|
|
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
|
|
|
|
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
|
|
|
define HAL_I2C_INTERNAL_MASK 0
|
|
|
|
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
|
|
|
|
|
|
|
# imu & baro
|
|
|
|
IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_ROLL_180_YAW_270
|
|
|
|
BARO SPL06 SPI:spl06
|
|
|
|
|
|
|
|
# SPI devices
|
|
|
|
SPIDEV osd SPI1 DEVID4 AT7456E_CS MODE0 10*MHZ 10*MHZ
|
|
|
|
SPIDEV bmi088_a SPI2 DEVID1 ACCEL_CS MODE3 10*MHZ 10*MHZ
|
|
|
|
SPIDEV bmi088_g SPI2 DEVID2 GYRO_CS MODE3 10*MHZ 10*MHZ
|
|
|
|
SPIDEV spl06 SPI2 DEVID3 SPL06_CS MODE3 1*MHZ 8*MHZ
|
|
|
|
SPIDEV sdcard SPI3 DEVID5 SDCARD_CS MODE0 400*KHZ 25*MHZ
|
|
|
|
|
|
|
|
# filesystem setup on sdcard
|
|
|
|
define HAL_OS_FATFS_IO 1
|
|
|
|
|
|
|
|
# setup for OSD
|
|
|
|
define OSD_ENABLED 1
|
|
|
|
define HAL_OSD_TYPE_DEFAULT 1
|
|
|
|
ROMFS_WILDCARD libraries/AP_OSD/fonts/font0.bin
|
|
|
|
|
2024-05-05 10:15:15 -03:00
|
|
|
# setup for BF migration
|
|
|
|
define HAL_FRAME_TYPE_DEFAULT 12
|
|
|
|
|
2024-03-01 09:06:21 -04:00
|
|
|
# reduce flash usage
|
2024-05-30 17:51:41 -03:00
|
|
|
include ../include/minimize_fpv_osd.inc
|