hwdef.dat 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. # hw definition file for processing by chibios_pins.py
  2. # for Matek F765-Wing
  3. # MCU class and specific type
  4. MCU STM32F7xx STM32F767xx
  5. # board ID for firmware load
  6. APJ_BOARD_ID 143
  7. # crystal frequency, setup to use external oscillator
  8. OSCILLATOR_HZ 8000000
  9. define STM32_LSECLK 32768U
  10. define STM32_LSEDRV (3U << 3U)
  11. define STM32_PLLSRC STM32_PLLSRC_HSE
  12. define STM32_PLLM_VALUE 8
  13. define STM32_PLLN_VALUE 432
  14. define STM32_PLLP_VALUE 2
  15. define STM32_PLLQ_VALUE 9
  16. FLASH_SIZE_KB 2048
  17. # leave 2 sectors free
  18. FLASH_RESERVE_START_KB 96
  19. # board voltage
  20. STM32_VDD 330U
  21. STM32_ST_USE_TIMER 3
  22. define CH_CFG_ST_RESOLUTION 16
  23. # two I2C bus
  24. I2C_ORDER I2C2 I2C1
  25. # order of UARTs (and USB)
  26. UART_ORDER OTG1 USART2 UART7 USART1 USART3 UART8 UART4
  27. # buzzer
  28. PB9 BUZZER OUTPUT GPIO(80) LOW
  29. define HAL_BUZZER_PIN 80
  30. define HAL_BUZZER_ON 1
  31. define HAL_BUZZER_OFF 0
  32. # PA10 IO-debug-console
  33. PA11 OTG_FS_DM OTG1
  34. PA12 OTG_FS_DP OTG1
  35. PA13 JTMS-SWDIO SWD
  36. PA14 JTCK-SWCLK SWD
  37. # SPI1 for IMU1 (MPU6000)
  38. PA5 SPI1_SCK SPI1
  39. PA6 SPI1_MISO SPI1
  40. PA7 SPI1_MOSI SPI1
  41. PC4 IMU1_CS CS
  42. # SPI2 for MAX7456 OSD
  43. PB12 MAX7456_CS CS
  44. PB13 SPI2_SCK SPI2
  45. PB14 SPI2_MISO SPI2
  46. PB15 SPI2_MOSI SPI2
  47. # SPI3 for IMU2 (ICM20602)
  48. PB3 SPI3_SCK SPI3
  49. PB4 SPI3_MISO SPI3
  50. PB5 SPI3_MOSI SPI3
  51. PD7 IMU2_CS CS
  52. # SPI4
  53. PE11 SPARE_CS CS
  54. PE12 SPI4_SCK SPI4
  55. PE13 SPI4_MISO SPI4
  56. PE14 SPI4_MOSI SPI4
  57. # I2C1
  58. PB6 I2C1_SCL I2C1
  59. PB7 I2C1_SDA I2C1
  60. # I2C2
  61. PB10 I2C2_SCL I2C2
  62. PB11 I2C2_SDA I2C2
  63. PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  64. PC3 BATT_CURRENT_SENS ADC1 SCALE(1)
  65. PA4 BATT_VOLTAGE_SENS2 ADC1 SCALE(1) # analog pin4
  66. PC5 BATT_CURRENT_SENS2 ADC1 SCALE(1) # analog pin15
  67. PC0 PRESSURE_SENS ADC1 SCALE(2)
  68. define HAL_DEFAULT_AIRSPEED_PIN 10
  69. # define default battery setup
  70. define HAL_BATT_VOLT_PIN 12
  71. define HAL_BATT_CURR_PIN 13
  72. define HAL_BATT_VOLT_SCALE 10.1
  73. define HAL_BATT_CURR_SCALE 17.0
  74. # analog RSSI
  75. PC1 RSSI_ADC ADC1
  76. define BOARD_RSSI_ANA_PIN 11
  77. PD10 LED0 OUTPUT LOW GPIO(90) # blue
  78. PD11 LED1 OUTPUT LOW GPIO(91) # green
  79. define HAL_GPIO_A_LED_PIN 91
  80. define HAL_GPIO_B_LED_PIN 90
  81. define HAL_GPIO_LED_OFF 1
  82. # USART1 (telem2)
  83. PA10 USART1_RX USART1
  84. PA9 USART1_TX USART1
  85. # USART2 (GPS1)
  86. PD5 USART2_TX USART2 NODMA
  87. PD6 USART2_RX USART2 NODMA
  88. # USART3 (GPS2)
  89. PD9 USART3_RX USART3 NODMA
  90. PD8 USART3_TX USART3 NODMA
  91. # UART4 (disable if used for CAN)
  92. PD1 UART4_TX UART4 NODMA
  93. PD0 UART4_RX UART4 NODMA
  94. # UART5 (RX only, for ESC telem), disabled for now until we add uartH support
  95. # PB8 UART5_RX UART5 NODMA
  96. # USART6 (RC input)
  97. PC7 TIM8_CH2 TIM8 RCININT FLOAT LOW
  98. PC6 USART6_TX USART6 NODMA LOW
  99. # UART7 (telem1)
  100. PE7 UART7_RX UART7
  101. PE8 UART7_TX UART7
  102. PE10 UART7_CTS UART7
  103. PE9 UART7_RTS UART7
  104. # UART8 (spare)
  105. PE0 UART8_RX UART8 NODMA
  106. PE1 UART8_TX UART8 NODMA
  107. # CAN bus (disabled as used for UART4)
  108. #PD1 CAN1_TX CAN1
  109. #PD0 CAN1_RX CAN1
  110. # Motors
  111. PA0 TIM2_CH1 TIM2 PWM(1) GPIO(50)
  112. PA1 TIM2_CH2 TIM2 PWM(2) GPIO(51)
  113. PA2 TIM5_CH3 TIM5 PWM(3) GPIO(52)
  114. PA3 TIM5_CH4 TIM5 PWM(4) GPIO(53)
  115. PB0 TIM1_CH2N TIM1 PWM(5) GPIO(54)
  116. PB1 TIM1_CH3N TIM1 PWM(6) GPIO(55)
  117. PD12 TIM4_CH1 TIM4 PWM(7) GPIO(56)
  118. PD13 TIM4_CH2 TIM4 PWM(8) GPIO(57)
  119. PD14 TIM4_CH3 TIM4 PWM(9) GPIO(58)
  120. PD15 TIM4_CH4 TIM4 PWM(10) GPIO(59)
  121. PE5 TIM9_CH1 TIM9 PWM(11) GPIO(60) NODMA
  122. PE6 TIM9_CH2 TIM9 PWM(12) GPIO(61) NODMA
  123. # microSD support
  124. PC8 SDMMC_D0 SDMMC1
  125. PC9 SDMMC_D1 SDMMC1
  126. PC10 SDMMC_D2 SDMMC1
  127. PC11 SDMMC_D3 SDMMC1
  128. PC12 SDMMC_CK SDMMC1
  129. PD2 SDMMC_CMD SDMMC1
  130. # GPIOs
  131. PE4 PINIO1 OUTPUT GPIO(81) LOW
  132. PE15 PINIO2 OUTPUT GPIO(82) LOW
  133. # 2812 LED
  134. # PA8, TIM1_CH1
  135. DMA_PRIORITY S*
  136. define HAL_STORAGE_SIZE 16384
  137. define STORAGE_FLASH_PAGE 1
  138. # spi devices
  139. SPIDEV mpu6000 SPI1 DEVID1 IMU1_CS MODE3 1*MHZ 4*MHZ
  140. SPIDEV icm20602 SPI3 DEVID1 IMU2_CS MODE3 1*MHZ 4*MHZ
  141. SPIDEV osd SPI2 DEVID4 MAX7456_CS MODE0 10*MHZ 10*MHZ
  142. # no built-in compass, but probe the i2c bus for all possible
  143. # external compass types
  144. define ALLOW_ARM_NO_COMPASS
  145. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  146. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  147. define HAL_I2C_INTERNAL_MASK 1
  148. define HAL_COMPASS_AUTO_ROT_DEFAULT 2
  149. # two IMUs. We put icm20602 first as we can sample accel at 4kHz
  150. IMU Invensense SPI:icm20602 ROTATION_PITCH_180
  151. IMU Invensense SPI:mpu6000 ROTATION_ROLL_180
  152. define HAL_DEFAULT_INS_FAST_SAMPLE 1
  153. # one BARO
  154. BARO BMP280 I2C:0:0x76
  155. define HAL_OS_FATFS_IO 1
  156. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  157. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  158. # setup for OSD
  159. define OSD_ENABLED ENABLED
  160. define HAL_OSD_TYPE_DEFAULT 1
  161. ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
  162. define BOARD_PWM_COUNT_DEFAULT 12