hwdef.dat 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # hw definition file for processing by chibios_pins.py
  2. # Airbot F4, Flip32 F4
  3. # with F405 mcu, mpu6000 imu
  4. MCU STM32F4xx STM32F405xx
  5. HAL_CHIBIOS_ARCH_F405 1
  6. # board ID for firmware load
  7. APJ_BOARD_ID 128
  8. # crystal frequency
  9. OSCILLATOR_HZ 8000000
  10. STM32_PLLM_VALUE 8
  11. # board voltage
  12. STM32_VDD 330U
  13. STM32_ST_USE_TIMER 5
  14. # flash size
  15. FLASH_SIZE_KB 1024
  16. FLASH_RESERVE_START_KB 64
  17. # order of I2C buses
  18. I2C_ORDER I2C2
  19. # order of UARTs
  20. UART_ORDER OTG1 USART6 USART1
  21. #adc
  22. PC1 BAT_CURR_SENS ADC1 SCALE(1)
  23. PC2 BAT_VOLT_SENS ADC1 SCALE(1)
  24. PA0 RSSI_IN ADC1
  25. #pwm output
  26. PB0 TIM1_CH2N TIM1 PWM(1) GPIO(50)
  27. PB1 TIM1_CH3N TIM1 PWM(2) GPIO(51)
  28. PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52)
  29. PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53)
  30. PA1 TIM2_CH2 TIM2 PWM(5) GPIO(54)
  31. PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55)
  32. PA4 MPU6000_CS CS
  33. PA5 SPI1_SCK SPI1
  34. PA6 SPI1_MISO SPI1
  35. PA7 SPI1_MOSI SPI1
  36. PB10 I2C2_SCL I2C2
  37. PB11 I2C2_SDA I2C2
  38. PA10 USART1_RX USART1
  39. PA9 USART1_TX USART1
  40. PC6 USART6_TX USART6
  41. PC7 USART6_RX USART6
  42. PA13 JTMS-SWDIO SWD
  43. PA14 JTCK-SWCLK SWD
  44. PB3 FLASH_CS CS
  45. PC12 SPI3_MOSI SPI3
  46. PC11 SPI3_MISO SPI3
  47. PC10 SPI3_SCK SPI3
  48. PB5 LED OUTPUT HIGH GPIO(57)
  49. PB4 TIM3_CH1 TIM3 GPIO(56) ALARM
  50. PA11 OTG_FS_DM OTG1
  51. PA12 OTG_FS_DP OTG1
  52. PC5 VBUS INPUT OPENDRAIN
  53. # "PPM" solder pad/resistor should be soldered and "S-BUS" resistor/solder pad removed
  54. # Overwise UART1 or RCIN will not work
  55. PB14 TIM12_CH1 TIM12 RCININT PULLDOWN LOW
  56. # SPI Device table
  57. SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
  58. SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 32*MHZ 32*MHZ
  59. # enable logging to dataflash
  60. define HAL_LOGGING_DATAFLASH
  61. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_AIRBOTF4
  62. # one IMU
  63. IMU Invensense SPI:mpu6000_cs ROTATION_YAW_180
  64. # one baro
  65. BARO MS56XX I2C:0:0x77
  66. # no builtin compasses
  67. define ALLOW_ARM_NO_COMPASS
  68. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  69. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  70. define HAL_I2C_INTERNAL_MASK 0
  71. define HAL_COMPASS_AUTO_ROT_DEFAULT 2
  72. define STORAGE_FLASH_PAGE 1
  73. define HAL_STORAGE_SIZE 15360
  74. # define default battery setup
  75. define HAL_BATT_VOLT_PIN 12
  76. define HAL_BATT_CURR_PIN 11
  77. define HAL_BATT_VOLT_SCALE 11
  78. define HAL_BATT_CURR_SCALE 18.2
  79. define HAL_GPIO_A_LED_PIN 57
  80. #To complementary channels work we define this
  81. define STM32_PWM_USE_ADVANCED TRUE
  82. define BOARD_PWM_COUNT_DEFAULT 6