hwdef.dat 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # hw definition file for SpeedyBee F4 hardware
  2. # tested on the Speedybee F4 board
  3. # with thanks to betaflight for pinout
  4. # MCU class and specific type
  5. MCU STM32F4xx STM32F405xx
  6. # board ID for firmware load
  7. APJ_BOARD_ID 134
  8. # crystal frequency
  9. OSCILLATOR_HZ 8000000
  10. STM32_PLLM_VALUE 8
  11. define STM32_ST_USE_TIMER 5
  12. #define CH_CFG_ST_RESOLUTION 16
  13. FLASH_SIZE_KB 1024
  14. # board voltage
  15. STM32_VDD 330U
  16. # only one I2C bus
  17. I2C_ORDER I2C1
  18. # order of UARTs (and USB)
  19. UART_ORDER OTG1 USART3 USART1 UART4 UART5
  20. # LEDs
  21. PB9 LED_BLUE OUTPUT LOW GPIO(0)
  22. PA14 LED_GREEN OUTPUT LOW GPIO(1)
  23. define HAL_GPIO_A_LED_PIN 0
  24. define HAL_GPIO_B_LED_PIN 1
  25. # buzzer
  26. PC13 BUZZER OUTPUT GPIO(80) LOW
  27. define HAL_BUZZER_PIN 80
  28. define HAL_BUZZER_ON 1
  29. define HAL_BUZZER_OFF 0
  30. # spi1 bus for IMU
  31. PA5 SPI1_SCK SPI1
  32. PA6 SPI1_MISO SPI1
  33. PA7 SPI1_MOSI SPI1
  34. # spi2 for OSD
  35. PB13 SPI2_SCK SPI2
  36. PB14 SPI2_MISO SPI2
  37. PB15 SPI2_MOSI SPI2
  38. PB10 MAX7456_CS CS
  39. # spi3 for sdcard and onboard flash
  40. PB3 SPI3_SCK SPI3
  41. PB4 SPI3_MISO SPI3
  42. PB5 SPI3_MOSI SPI3
  43. PC0 FLASH_CS CS
  44. PB11 MPU6000_CS CS
  45. # only one I2C bus in normal config
  46. PB6 I2C1_SCL I2C1
  47. PB7 I2C1_SDA I2C1
  48. # analog pins
  49. PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  50. PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
  51. PC3 RSSI_ADC_PIN ADC1 SCALE(1)
  52. # define default battery setup
  53. define HAL_BATT_VOLT_PIN 12
  54. define HAL_BATT_CURR_PIN 11
  55. define HAL_BATT_VOLT_SCALE 11
  56. define HAL_BATT_CURR_SCALE 30.2
  57. #analog rssi pin (also could be used as analog airspeed input)
  58. # PB1 - ADC12_CH9
  59. define BOARD_RSSI_ANA_PIN 13
  60. # USART1
  61. PA9 USART1_TX USART1
  62. PA10 USART1_RX USART1
  63. # USART2 (RCIN)
  64. #PA2 USART3_TX USART3
  65. #PA3 USART3_RX USART3
  66. # rcinput
  67. PA3 TIM9_CH2 TIM9 RCININT FLOAT LOW
  68. # USART3
  69. PC10 USART3_TX USART3
  70. PC11 USART3_RX USART3
  71. # UART4
  72. PA0 UART4_TX UART4
  73. PA1 UART4_RX UART4
  74. # UART5
  75. PD2 UART5_RX UART5
  76. PC12 UART5_TX UART5
  77. # PA10 IO-debug-console
  78. PA11 OTG_FS_DM OTG1
  79. PA12 OTG_FS_DP OTG1
  80. # USB detection
  81. PB12 VBUS INPUT OPENDRAIN
  82. # PWM out pins. Note that channel order follows the ArduPilot motor
  83. # order conventions
  84. PC6 TIM8_CH1 TIM8 PWM(1) GPIO(50)
  85. PC7 TIM8_CH2 TIM8 PWM(2) GPIO(51)
  86. PC8 TIM8_CH3 TIM8 PWM(3) GPIO(52)
  87. PC9 TIM8_CH4 TIM8 PWM(4) GPIO(53)
  88. PA15 TIM2_CH1 TIM2 PWM(5) GPIO(54)
  89. PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55)
  90. define HAL_STORAGE_SIZE 15360
  91. define STORAGE_FLASH_PAGE 2
  92. # reserve 32k for bootloader and 32k for flash storage
  93. FLASH_RESERVE_START_KB 64
  94. # one IMU
  95. IMU Invensense SPI:mpu6000 ROTATION_YAW_270
  96. # probe for a BMP085, but also look for other baros
  97. BARO BMP085 I2C:0:0x77
  98. define HAL_PROBE_EXTERNAL_I2C_BAROS
  99. define HAL_BARO_ALLOW_INIT_NO_BARO
  100. # no built-in compass, but probe the i2c bus for all possible
  101. # external compass types
  102. define ALLOW_ARM_NO_COMPASS
  103. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  104. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  105. define HAL_I2C_INTERNAL_MASK 1
  106. # SPI devices
  107. SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
  108. SPIDEV osd SPI2 DEVID1 MAX7456_CS MODE0 10*MHZ 10*MHZ
  109. SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 32*MHZ 32*MHZ
  110. # enable logging to dataflash
  111. define HAL_LOGGING_DATAFLASH
  112. # 8 PWM available by default
  113. define BOARD_PWM_COUNT_DEFAULT 8
  114. # uncomment the lines below to enable strict API
  115. # checking in ChibiOS
  116. #define CH_DBG_ENABLE_ASSERTS TRUE
  117. #define CH_DBG_ENABLE_CHECKS TRUE
  118. #define CH_DBG_SYSTEM_STATE_CHECK TRUE
  119. #define CH_DBG_ENABLE_STACK_CHECK TRUE
  120. # setup for OSD
  121. define OSD_ENABLED ENABLED
  122. define HAL_OSD_TYPE_DEFAULT 1
  123. ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin