hwdef.dat 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # hw definition file for processing by chibios_pins.py
  2. # for mini-pix hardware from RadioLink
  3. # MCU class and specific type
  4. MCU STM32F4xx STM32F405xx
  5. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_MINIPIX
  6. # board ID for firmware load
  7. APJ_BOARD_ID 3
  8. # crystal frequency
  9. OSCILLATOR_HZ 24000000
  10. # ChibiOS system timer
  11. 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 SD2
  17. # STDOUT_BAUDRATE 57600
  18. # only one I2C bus
  19. I2C_ORDER I2C2 I2C1
  20. # order of UARTs (and USB)
  21. UART_ORDER OTG1 UART4 USART3 USART2
  22. # UART4 serial GPS
  23. PA0 UART4_TX UART4
  24. PA1 UART4_RX UART4
  25. PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  26. PA3 BATT_CURRENT_SENS ADC1 SCALE(1)
  27. PA4 VDD_5V_SENS ADC1 SCALE(2)
  28. #SPI for MPU6500
  29. PA5 SPI1_SCK SPI1
  30. PA6 SPI1_MISO SPI1
  31. PA7 SPI1_MOSI SPI1
  32. # setup for power brick
  33. define HAL_BATT_VOLT_PIN 2
  34. define HAL_BATT_CURR_PIN 3
  35. define HAL_BATT_VOLT_SCALE 12.1
  36. define HAL_BATT_CURR_SCALE 43.0
  37. PA9 VBUS INPUT OPENDRAIN
  38. PA11 OTG_FS_DM OTG1
  39. PA12 OTG_FS_DP OTG1
  40. PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
  41. PB0 TIM3_CH3 TIM3 PPMIN # RC Input PPM
  42. PB2 BOOT1 INPUT
  43. PB5 VDD_BRICK_VALID INPUT
  44. PB8 I2C1_SCL I2C1
  45. PB9 I2C1_SDA I2C1
  46. PB10 I2C2_SCL I2C2
  47. PB11 I2C2_SDA I2C2
  48. PB13 SPI2_SCK SPI2
  49. PB14 SPI2_MISO SPI2
  50. PB15 SPI2_MOSI SPI2
  51. PC0 VBUS_VALID INPUT
  52. PC1 RSSI_IN ADC1
  53. PC2 LPS22HB_CS CS
  54. PC3 LED_SAFETY OUTPUT
  55. PC4 SAFETY_IN INPUT
  56. PC7 TIM8_CH2 TIM8 RCIN PULLUP LOW # also USART6_RX for serial RC
  57. PC8 SDIO_D0 SDIO
  58. PC9 SDIO_D1 SDIO
  59. PC10 SDIO_D2 SDIO
  60. PC11 SDIO_D3 SDIO
  61. PC12 SDIO_CK SDIO
  62. PC13 SBUS_INV OUTPUT
  63. PC14 MPU6500_DRDY INPUT
  64. PC15 MPU6500_CS CS
  65. PD2 SDIO_CMD SDIO
  66. # USART2 serial2 telem2
  67. PD3 USART2_CTS USART2
  68. PD4 USART2_RTS USART2
  69. PD5 USART2_TX USART2
  70. PD6 USART2_RX USART2
  71. # USART3 serial3 telem1
  72. PD8 USART3_TX USART3
  73. PD9 USART3_RX USART3
  74. PD10 FRAM_CS CS
  75. PD11 USART3_CTS USART3
  76. PD12 USART3_RTS USART3
  77. PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
  78. PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
  79. PD15 LPS22HB_DRDY INPUT
  80. PE3 VDD_SENSORS_EN OUTPUT HIGH
  81. PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
  82. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  83. PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
  84. PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
  85. # SPI devices
  86. SPIDEV mpu6000 SPI1 DEVID1 MPU6500_CS MODE3 1*MHZ 8*MHZ
  87. SPIDEV lps22h SPI2 DEVID3 LPS22HB_CS MODE3 1*MHZ 10*MHZ
  88. SPIDEV ramtron SPI2 DEVID4 FRAM_CS MODE3 8*MHZ 8*MHZ
  89. # one baro
  90. BARO LPS2XH SPI:lps22h
  91. # one IMU
  92. IMU Invensense SPI:mpu6000 ROTATION_PITCH_180
  93. # one internal compass, plus external probe
  94. COMPASS QMC5883L I2C:0:0x0D false ROTATION_PITCH_180_YAW_270
  95. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  96. define HAL_I2C_INTERNAL_MASK 1
  97. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  98. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  99. define HAL_STORAGE_SIZE 16384
  100. # enable RAMTROM parameter storage
  101. define HAL_WITH_RAMTRON 1
  102. # fallback to flash is no FRAM fitted
  103. define STORAGE_FLASH_PAGE 22
  104. # enable FAT filesystem
  105. define HAL_OS_FATFS_IO 1
  106. # LED setup is similar to PixRacer
  107. define HAL_HAVE_PIXRACER_LED
  108. PB1 LED_RED OUTPUT GPIO(0)
  109. PC5 LED_GREEN OUTPUT GPIO(1)
  110. PE12 LED_BLUE OUTPUT GPIO(2)
  111. define HAL_GPIO_A_LED_PIN 0
  112. define HAL_GPIO_B_LED_PIN 1
  113. define HAL_GPIO_C_LED_PIN 2
  114. define HAL_GPIO_LED_ON 0
  115. define HAL_GPIO_LED_OFF 1