hwdef.dat 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # hw definition file for processing by chibios_pins.py
  2. # old F412 layout
  3. MCU STM32F4xx STM32F412Rx
  4. # board ID for firmware load
  5. APJ_BOARD_ID 9
  6. # crystal frequency
  7. OSCILLATOR_HZ 24000000
  8. STM32_HSE_ENABLED FALSE
  9. STM32_PLLM_VALUE 16
  10. STM32_PLLN_VALUE 384
  11. STM32_PLLP_VALUE 4
  12. STM32_PLLQ_VALUE 8
  13. STM32_PLLSRC STM32_PLLSRC_HSI
  14. STM32_PREE1 STM32_PREE1_DIV2
  15. STM32_PREE2 STM32_PREE2_DIV1
  16. STM32_PWM_USE_TIM3 TRUE
  17. # board voltage
  18. STM32_VDD 330U
  19. # flash size
  20. FLASH_SIZE_KB 1024
  21. # serial port for stdout
  22. STDOUT_SERIAL SD2
  23. STDOUT_BAUDRATE 115200
  24. # order of I2C buses
  25. I2C_ORDER I2C2 I2C1
  26. # order of UARTs
  27. UART_ORDER USART2 USART6 USART3
  28. PC0 MGND ADC1
  29. PC1 PWM4_SENSE ADC1
  30. PC2 PWM2_SENSE ADC1
  31. PC3 PWM1_SENSE ADC1
  32. PA0 PWM3_SENSE ADC1
  33. # USART2 is for debug
  34. PA2 USART2_TX USART2
  35. PA3 USART2_RX USART2
  36. PA4 BATT_MON ADC1
  37. # SPI1 is radio
  38. PA5 SPI1_SCK SPI1
  39. PB4 SPI1_MISO SPI1
  40. PA7 SPI1_MOSI SPI1
  41. PA15 RADIO_CS CS
  42. PC4 RADIO_CE OUTPUT
  43. PC5 RADIO_PA_CTL OUTPUT
  44. # SPI5 is flow
  45. PB0 SPI5_SCK SPI5
  46. PA12 SPI5_MISO SPI5
  47. PA10 SPI5_MOSI SPI5
  48. PB1 FLOW_CS CS
  49. PB2 BOOT1 INPUT
  50. # I2C2 is GPS/mag
  51. PB10 I2C2_SCL I2C2
  52. PB3 I2C2_SDA I2C2
  53. PA13 JTMS-SWDIO SWD
  54. PA14 JTCK-SWCLK SWD
  55. # I2C1 is 20789
  56. PB9 I2C1_SDA I2C1
  57. PB8 I2C1_SCL I2C1
  58. PB7 LEDF OUTPUT HIGH GPIO(0)
  59. PB6 LEDR OUTPUT HIGH GPIO(1)
  60. PB5 TIM3_CH2 TIM3 PWM(2) # marked CN15 front-right
  61. PD2 RADIO_IRQ INPUT GPIO(100)
  62. # USART3 is sonix
  63. PC11 USART3_RX USART3
  64. PC10 USART3_TX USART3
  65. # USART6 is for GPS
  66. PA11 USART6_TX USART6
  67. PC7 USART6_RX USART6
  68. PA8 OF_MOTION INPUT
  69. PC9 TIM3_CH4 TIM3 PWM(4) # marked CN17, rear-right
  70. PC8 TIM3_CH3 TIM3 PWM(3) # marked CN13, rear-left
  71. PC6 TIM3_CH1 TIM3 PWM(1) # marked CN3, front-left
  72. # SPI2 is MPU
  73. PB13 SPI2_SCK SPI2
  74. PB14 SPI2_MISO SPI2
  75. PB15 SPI2_MOSI SPI2
  76. PB12 MPU_CS CS
  77. # SPI Device table
  78. SPIDEV cypress SPI1 DEVID1 RADIO_CS MODE0 2*MHZ 2*MHZ
  79. SPIDEV cc2500 SPI1 DEVID1 RADIO_CS MODE0 4*MHZ 4*MHZ
  80. SPIDEV pixartflow SPI5 DEVID2 FLOW_CS MODE3 2*MHZ 2*MHZ
  81. SPIDEV icm20789 SPI2 DEVID4 MPU_CS MODE3 1*MHZ 8*MHZ
  82. # reserve 16k for bootloader and 32k for storage
  83. FLASH_RESERVE_START_KB 48
  84. define HAL_CHIBIOS_ARCH_F412 1
  85. IMU Invensense SPI:icm20789 ROTATION_NONE
  86. # radio IRQ is on GPIO(100)
  87. define HAL_GPIO_RADIO_IRQ 100
  88. define HAL_RCINPUT_WITH_AP_RADIO 1
  89. define STORAGE_FLASH_PAGE 1
  90. define HAL_STORAGE_SIZE 15360
  91. # setup defines for ArduCopter config
  92. define TOY_MODE_ENABLED ENABLED
  93. define ARMING_DELAY_SEC 0
  94. define LAND_START_ALT 700
  95. define LAND_DETECTOR_ACCEL_MAX 2.0f
  96. define CHIBIOS_ADC_MAVLINK_DEBUG 1
  97. COMPASS BMM150 I2C:0:0x10 ROTATION_NONE
  98. define HAL_BARO_DEFAULT HAL_BARO_20789_I2C_SPI
  99. define HAL_BARO_20789_I2C_BUS 1
  100. define HAL_BARO_20789_I2C_ADDR_PRESS 0x63