hwdef.dat 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. # hw definition file for processing by chibios_hwdef.py
  2. # for F4BY v2.1.5 board description http://swift-flyer.com/?page_id=83
  3. # MCU class and specific type
  4. MCU STM32F4xx STM32F407xx
  5. # board ID for firmware load
  6. APJ_BOARD_ID 20
  7. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_F4BY
  8. # USB setup
  9. USB_VENDOR 0x27AC # Swift-Flyer
  10. USB_PRODUCT 0x0201 # fmu usb driver
  11. USB_STRING_MANUFACTURER "Swift-Flyer"
  12. USB_STRING_PRODUCT "%BOARD%"
  13. USB_STRING_SERIAL "%SERIAL%"
  14. FLASH_SIZE_KB 1024
  15. # crystal frequency
  16. OSCILLATOR_HZ 8000000
  17. STM32_PLLM_VALUE 8
  18. # board voltage
  19. STM32_VDD 330U
  20. # this is the STM32 timer that ChibiOS will use for the low level
  21. # driver. This must be a 32 bit timer. We currently only support
  22. # timers 2, 3, 4, 5 and 21. See hal_st_lld.c in ChibiOS for details
  23. # ChibiOS system timer
  24. STM32_ST_USE_TIMER 5
  25. PA11 OTG_FS_DM OTG1
  26. PA12 OTG_FS_DP OTG1
  27. PA13 JTMS-SWDIO SWD
  28. PA14 JTCK-SWCLK SWD
  29. # the normal usage of this ordering is:
  30. # 1) SERIAL0: console (primary mavlink, usually USB)
  31. # 2) SERIAL3: primary GPS
  32. # 3) SERIAL1: telem1
  33. # 4) SERIAL2: telem2
  34. # 5) SERIAL4: GPS2
  35. # 6) SERIAL5: extra UART (usually RTOS debug console)
  36. # use UART for stdout, so no STDOUT_SERIAL
  37. #STDOUT_SERIAL SD5
  38. #STDOUT_BAUDRATE 57600
  39. # this is the pin that senses USB being connected. It is an input pin
  40. # setup as OPENDRAIN
  41. PA9 VBUS INPUT OPENDRAIN
  42. UART_ORDER OTG1 USART3 USART2 USART1 UART5
  43. # UART1 as board 2.1.5 for serial 3 gps
  44. PB6 USART1_TX USART1
  45. PB7 USART1_RX USART1
  46. # USART2 serial2 telem2
  47. PD5 USART2_TX USART2 NODMA
  48. PD6 USART2_RX USART2
  49. # USART3 serial3 telem1
  50. PD8 USART3_TX USART3 NODMA
  51. PD9 USART3_RX USART3
  52. PC10 UART4_TX UART4 NODMA
  53. PC11 UART4_RX UART4
  54. # SHARE dma with I2C2_TX
  55. PC12 UART5_TX UART5 NODMA
  56. PD2 UART5_RX UART5 NODMA
  57. define HAL_STORAGE_SIZE 16384
  58. define STORAGE_FLASH_PAGE 22
  59. #SPI1 for MPU
  60. PA5 SPI1_SCK SPI1
  61. PA6 SPI1_MISO SPI1
  62. PA7 SPI1_MOSI SPI1
  63. PA4 MPU_CS CS
  64. # spi bus for dataflash AND SD
  65. PB13 SPI2_SCK SPI2
  66. PB14 SPI2_MISO SPI2
  67. PB15 SPI2_MOSI SPI2
  68. PB12 FRAM_CS CS SPEED_VERYLOW
  69. PE15 FLASH_CS CS
  70. SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 8*MHZ
  71. SPIDEV ramtron SPI2 DEVID2 FRAM_CS MODE3 8*MHZ 8*MHZ
  72. SPIDEV sdcard SPI2 DEVID3 FLASH_CS MODE0 400*KHZ 25*MHZ
  73. # one IMU
  74. IMU Invensense SPI:mpu6000 ROTATION_NONE
  75. # one baro, check both addresses
  76. BARO MS56XX I2C:0:0x76
  77. BARO MS56XX I2C:0:0x77
  78. # enable RAMTROM parameter storage
  79. define HAL_WITH_RAMTRON 1
  80. # enable FAT filesystem support
  81. define HAL_OS_FATFS_IO 1
  82. # now some defines for logging and terrain data files
  83. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  84. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  85. # this defines the default maximum clock on I2C devices.
  86. define HAL_I2C_MAX_CLOCK 100000
  87. I2C_ORDER I2C2 I2C1
  88. PB8 I2C1_SCL I2C1
  89. PB9 I2C1_SDA I2C1
  90. PB10 I2C2_SCL I2C2
  91. PB11 I2C2_SDA I2C2
  92. # look for I2C compass
  93. COMPASS HMC5843 I2C:0:0x1E false ROTATION_YAW_270
  94. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  95. # PWM out pins
  96. PA0 TIM2_CH1 TIM2 PWM(1) GPIO(50)
  97. PA1 TIM2_CH2 TIM2 PWM(2) GPIO(51)
  98. PA2 TIM2_CH3 TIM2 PWM(3) GPIO(52)
  99. PA3 TIM2_CH4 TIM2 PWM(4) GPIO(53)
  100. PE9 TIM1_CH1 TIM1 PWM(5) GPIO(54)
  101. PE11 TIM1_CH2 TIM1 PWM(6) GPIO(55)
  102. PE13 TIM1_CH3 TIM1 PWM(7) GPIO(56)
  103. PE14 TIM1_CH4 TIM1 PWM(8) GPIO(57)
  104. PD13 TIM4_CH2 TIM4 PWM(9) GPIO(58)
  105. PD12 TIM4_CH1 TIM4 PWM(10) GPIO(59)
  106. PD15 TIM4_CH4 TIM4 PWM(11) GPIO(60)
  107. PD14 TIM4_CH3 TIM4 PWM(12) GPIO(61)
  108. # also USART6_RX for serial RC
  109. PC7 TIM8_CH2 TIM8 RCIN PULLUP LOW DMA_CH0
  110. # LED setup is similar to PixRacer
  111. define HAL_HAVE_PIXRACER_LED
  112. PE3 LED_RED OUTPUT GPIO(10)
  113. PE2 LED_GREEN OUTPUT GPIO(11)
  114. PE1 LED_BLUE OUTPUT GPIO(12)
  115. PE0 LED_YELOW OUTPUT GPIO(13)
  116. define HAL_GPIO_A_LED_PIN 10
  117. define HAL_GPIO_B_LED_PIN 11
  118. define HAL_GPIO_C_LED_PIN 12
  119. define HAL_GPIO_LED_ON 0
  120. define HAL_GPIO_LED_OFF 1
  121. PC0 PRESSURE_SENS ADC1 SCALE(1)
  122. PC1 RSSI_IN ADC1
  123. PC2 BATT_CURRENT_SENS ADC1 SCALE(2)
  124. PC3 BATT_VOLTAGE_SENS ADC1 SCALE(2)
  125. PC4 VDD_5V_SENS ADC1 SCALE(2)
  126. PC5 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(2)
  127. PE5 TIM9_CH1 TIM9 ALARM
  128. PC14 EXTERN_GPIO1 GPIO(1)
  129. PC13 EXTERN_GPIO2 GPIO(2)
  130. PE4 EXTERN_GPIO3 GPIO(3)
  131. PE6 EXTERN_GPIO4 GPIO(4)
  132. PC9 EXTERN_GPIO5 GPIO(5)
  133. # IRQ for MPU6000
  134. PB0 EXTI_MPU6000 INPUT PULLUP
  135. PB1 DRDY_HMC5883 INPUT PULLUP
  136. define AP_FEATURE_BRD_PWM_COUNT_PARAM 1
  137. define BOARD_PWM_COUNT_DEFAULT 12