hwdef.dat 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # hw definition file for KakuteF4 hardware
  2. # STATUS:
  3. # This port is mostly complete. Main missing feature are OSD,
  4. # dataflash
  5. # MCU class and specific type
  6. MCU STM32F4xx STM32F405xx
  7. # Betaflight motor order for copter
  8. define HAL_FRAME_TYPE_DEFAULT 12
  9. # board ID for firmware load
  10. APJ_BOARD_ID 122
  11. # crystal frequency
  12. OSCILLATOR_HZ 8000000
  13. STM32_PLLM_VALUE 8
  14. define STM32_ST_USE_TIMER 4
  15. define CH_CFG_ST_RESOLUTION 16
  16. FLASH_SIZE_KB 1024
  17. # board voltage
  18. STM32_VDD 330U
  19. # only one I2C bus
  20. I2C_ORDER I2C1
  21. # LEDs
  22. PB5 LED_BLUE OUTPUT LOW GPIO(0)
  23. # buzzer
  24. PC9 BUZZER OUTPUT GPIO(80) LOW
  25. define HAL_BUZZER_PIN 80
  26. define HAL_BUZZER_ON 1
  27. define HAL_BUZZER_OFF 0
  28. # spi1 bus for IMU
  29. PA5 SPI1_SCK SPI1
  30. PA6 SPI1_MISO SPI1
  31. PA7 SPI1_MOSI SPI1
  32. # spi3 for dataflash and OSD
  33. PC10 SPI3_SCK SPI3
  34. PC11 SPI3_MISO SPI3
  35. PC12 SPI3_MOSI SPI3
  36. PB14 MAX7456_CS CS
  37. # dataflash M25P16
  38. PB3 FLASH_CS CS
  39. PC4 ICM20689_CS CS
  40. PC5 ICM20689_DRDY INPUT
  41. # only one I2C bus in normal config
  42. PB8 I2C1_SCL I2C1
  43. PB9 I2C1_SDA I2C1
  44. # analog pins
  45. PC3 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  46. PC2 BATT_CURRENT_SENS ADC1 SCALE(1)
  47. # RSSI analog input
  48. PC1 RSSI_ADC_PIN ADC1 SCALE(1)
  49. define BOARD_RSSI_ANA_PIN 11
  50. # define default battery setup
  51. define HAL_BATT_VOLT_PIN 13
  52. define HAL_BATT_CURR_PIN 12
  53. define HAL_BATT_VOLT_SCALE 10.1
  54. define HAL_BATT_CURR_SCALE 17.0
  55. # order of UARTs (and USB)
  56. UART_ORDER OTG1 UART4 USART6 USART1 UART5 USART3
  57. # rcinput is PB11
  58. PB11 TIM2_CH4 TIM2 RCININT FLOAT LOW
  59. PB10 USART3_TX USART3
  60. # SBUS inversion control pin, active low
  61. PB15 SBUS_INVERT OUTPUT LOW
  62. # for FrSky S.PORT. Has builtin inverters and diode to combine
  63. # RX and TX onto the one pin
  64. PA9 USART1_TX USART1
  65. PA10 USART1_RX USART1
  66. # default Serial2 to FrSky telemetry
  67. define HAL_SERIAL2_PROTOCOL 10
  68. # USART6, telem1, SERIAL1
  69. PC6 USART6_TX USART6
  70. PC7 USART6_RX USART6
  71. # UART4 (GPS), SERIAL3
  72. PA1 UART4_RX UART4 NODMA
  73. PA0 UART4_TX UART4 NODMA
  74. # UART5 (ESC telemetry sensor), SERIAL4
  75. PD2 UART5_RX UART5
  76. PA11 OTG_FS_DM OTG1
  77. PA12 OTG_FS_DP OTG1
  78. # USB detection
  79. PA8 VBUS INPUT OPENDRAIN
  80. # debug
  81. PA13 JTMS-SWDIO SWD
  82. PA14 JTCK-SWCLK SWD
  83. # PWM out pins. Note that channel order follows the ArduPilot motor
  84. # order conventions
  85. PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50)
  86. PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51)
  87. PA3 TIM5_CH4 TIM5 PWM(3) GPIO(52)
  88. PA2 TIM5_CH3 TIM5 PWM(4) GPIO(53)
  89. PC8 TIM8_CH3 TIM8 PWM(5) GPIO(54) # LED strip
  90. define HAL_NEOPIXEL_COUNT 8
  91. define HAL_STORAGE_SIZE 15360
  92. define STORAGE_FLASH_PAGE 2
  93. # reserve 32k for bootloader and 32k for flash storage
  94. FLASH_RESERVE_START_KB 64
  95. # no built-in compass, but probe the i2c bus for all possible
  96. # external compass types
  97. define ALLOW_ARM_NO_COMPASS
  98. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  99. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  100. define HAL_I2C_INTERNAL_MASK 0
  101. define HAL_COMPASS_AUTO_ROT_DEFAULT 2
  102. # SPI devices
  103. SPIDEV mpu6000 SPI1 DEVID1 ICM20689_CS MODE3 1*MHZ 8*MHZ
  104. SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 32*MHZ 32*MHZ
  105. SPIDEV osd SPI3 DEVID4 MAX7456_CS MODE0 10*MHZ 10*MHZ
  106. # one IMU
  107. IMU Invensense SPI:mpu6000 ROTATION_YAW_180
  108. # one baro
  109. BARO BMP280 I2C:0:0x76
  110. # enable logging to dataflash
  111. define HAL_LOGGING_DATAFLASH
  112. # setup for OSD
  113. define OSD_ENABLED ENABLED
  114. define HAL_OSD_TYPE_DEFAULT 1
  115. ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
  116. # 8 PWM available by default
  117. define BOARD_PWM_COUNT_DEFAULT 8