hwdef.dat 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # hw definition file for processing by chibios_pins.py
  2. # for Revo-Mini hardware
  3. # MCU class and specific type
  4. MCU STM32F4xx STM32F405xx
  5. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_REVOMINI
  6. # board ID for firmware load
  7. APJ_BOARD_ID 124
  8. # crystal frequency
  9. OSCILLATOR_HZ 8000000
  10. STM32_PLLM_VALUE 8
  11. define STM32_ST_USE_TIMER 5
  12. FLASH_SIZE_KB 1024
  13. # board voltage
  14. STM32_VDD 330U
  15. # use USB for stdout, so no STDOUT_SERIAL
  16. # STDOUT_SERIAL SD3
  17. # STDOUT_BAUDRATE 57600
  18. # only one I2C bus
  19. I2C_ORDER I2C1
  20. # order of UARTs (and USB)
  21. UART_ORDER OTG1 USART3 USART1
  22. # rcinput is PC6, which is the 3rd "PWM IN" pin (the yellow wire on a
  23. # revolution board)
  24. PC6 TIM8_CH1 TIM8 RCIN FLOAT LOW
  25. # analog pins
  26. PC3 VDD_5V_SENS ADC1
  27. PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  28. PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
  29. PC5 USB_SENSE ADC1
  30. # define default battery setup
  31. define HAL_BATT_VOLT_PIN 12
  32. define HAL_BATT_CURR_PIN 11
  33. define HAL_BATT_VOLT_SCALE 10.1
  34. define HAL_BATT_CURR_SCALE 17.0
  35. PC0 SBUS_INVERT OUTPUT LOW
  36. # LEDs
  37. PB5 LED_BLUE OUTPUT LOW GPIO(0)
  38. PB6 LED_YELLOW OUTPUT LOW GPIO(1) # optional
  39. PB4 LED_RED OUTPUT LOW GPIO(2)
  40. # GPS port disabled (PC6 used for RCIN)
  41. #PC6 USART6_TX USART6
  42. #PC7 USART6_RX USART6
  43. # flexi port, setup as GPS
  44. PB10 USART3_TX USART3
  45. PB11 USART3_RX USART3
  46. # main port, for telem1
  47. PA9 USART1_TX USART1
  48. PA10 USART1_RX USART1
  49. # alternative config
  50. # PB10 I2C2_SCL I2C2
  51. # PB11 I2C2_SDA I2C2
  52. # spi bus for IMU
  53. PA5 SPI1_SCK SPI1
  54. PA6 SPI1_MISO SPI1
  55. PA7 SPI1_MOSI SPI1
  56. # spi bus for dataflash
  57. PC10 SPI3_SCK SPI3
  58. PC11 SPI3_MISO SPI3
  59. PC12 SPI3_MOSI SPI3
  60. # IRQ for MPU6000
  61. PC4 EXTI_MPU6000 INPUT
  62. # PA10 IO-debug-console
  63. PA11 OTG_FS_DM OTG1
  64. PA12 OTG_FS_DP OTG1
  65. PA13 JTMS-SWDIO SWD
  66. PA14 JTCK-SWCLK SWD
  67. # only one I2C bus in normal config
  68. PB8 I2C1_SCL I2C1
  69. PB9 I2C1_SDA I2C1
  70. # SPI chip selects
  71. PA4 MPU_CS CS
  72. PB3 FLASH_CS CS
  73. # PWM out pins
  74. PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50)
  75. PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51)
  76. PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52)
  77. PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53)
  78. PA1 TIM2_CH2 TIM2 PWM(5) GPIO(54)
  79. PA0 TIM2_CH1 TIM2 PWM(6) GPIO(55)
  80. # disable last two channels as conflicts with TIM8 for RCIN
  81. #PC8 TIM8_CH3 TIM8 PWM(7) GPIO(56)
  82. #PC9 TIM8_CH4 TIM8 PWM(8) GPIO(57)
  83. PB7 DRDY_HMC5883 INPUT PULLUP
  84. define HAL_STORAGE_SIZE 15360
  85. define STORAGE_FLASH_PAGE 2
  86. # reserve 32k for bootloader and 32k for flash storage
  87. FLASH_RESERVE_START_KB 64
  88. # one IMU
  89. IMU Invensense SPI:mpu6000 ROTATION_YAW_180
  90. # one baro
  91. BARO MS56XX I2C:0:0x77
  92. # also allow for probing of external barometers
  93. define HAL_PROBE_EXTERNAL_I2C_BAROS
  94. # look for internal I2C compass
  95. COMPASS HMC5843 I2C:0:0x1E false ROTATION_YAW_270
  96. # SPI devices
  97. SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 8*MHZ
  98. SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 32*MHZ 32*MHZ
  99. # enable logging to dataflash
  100. define HAL_LOGGING_DATAFLASH
  101. # 8 PWM available by default
  102. define BOARD_PWM_COUNT_DEFAULT 8