hwdef.dat 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # hw definition file for processing by chibios_pins.py
  2. # MCU class and specific type
  3. MCU STM32F100 STM32F100xB
  4. FLASH_RESERVE_START_KB 4
  5. # board ID for firmware load
  6. APJ_BOARD_ID 3
  7. # crystal frequency
  8. OSCILLATOR_HZ 24000000
  9. define CH_CFG_ST_FREQUENCY 1000
  10. FLASH_SIZE_KB 64
  11. # ChibiOS system timer
  12. # board voltage
  13. STM32_VDD 330U
  14. # order of UARTs
  15. UART_ORDER EMPTY
  16. define HAL_USE_UART TRUE
  17. # UART connected to FMU, uses DMA
  18. PA2 USART2_TX USART2 SPEED_HIGH
  19. PA3 USART2_RX USART2 SPEED_HIGH
  20. define STM32_UART_USE_USART1 FALSE
  21. define STM32_UART_USE_USART2 TRUE
  22. define STM32_UART_USE_USART3 FALSE
  23. # UART for SBUS out, and RC in, no DMA
  24. define HAL_USE_SERIAL TRUE
  25. PB4 SBUS_OUT_EN OUTPUT LOW GPIO(1)
  26. PB10 USART3_TX USART3 SPEED_HIGH LOW
  27. PB11 USART3_RX USART3
  28. define STM32_SERIAL_USE_USART1 TRUE
  29. define STM32_SERIAL_USE_USART2 FALSE
  30. define STM32_SERIAL_USE_USART3 TRUE
  31. PA0 TIM2_CH1 TIM2 PWM(1) GPIO(101)
  32. PA1 TIM2_CH2 TIM2 PWM(2) GPIO(102)
  33. PB8 TIM4_CH3 TIM4 PWM(3) GPIO(103)
  34. PB9 TIM4_CH4 TIM4 PWM(4) GPIO(104)
  35. PA6 TIM3_CH1 TIM3 PWM(5) GPIO(105)
  36. PA7 TIM3_CH2 TIM3 PWM(6) GPIO(106)
  37. PB0 TIM3_CH3 TIM3 PWM(7) GPIO(107)
  38. PB1 TIM3_CH4 TIM3 PWM(8) GPIO(108)
  39. # pins for detecting board type. On a pixhawk2 PC14 is pulled high,
  40. # PC15 is pulled low. On a Pixhawk1 they are both floating
  41. PC14 IO_HW_DETECT1 INPUT PULLDOWN
  42. PC15 IO_HW_DETECT2 INPUT PULLUP
  43. PB14 HEATER INPUT PULLUP GPIO(0)
  44. # safety button and LED. These do not use the same names
  45. # as those for FMU-only boards as we want to handle them specially
  46. # inside the iofirmware
  47. PB5 SAFETY_INPUT INPUT PULLDOWN
  48. PB13 SAFETY_LED OUTPUT HIGH OPENDRAIN
  49. # amber LED
  50. PB15 AMBER_LED OUTPUT LOW OPENDRAIN
  51. # green ring LED on cube
  52. PA11 RING_LED OUTPUT LOW OPENDRAIN
  53. # UART for DSM input
  54. # TX side is for IO debug, and is unused
  55. PA9 USART1_TX USART1 SPEED_HIGH
  56. PA10 USART1_RX USART1 SPEED_HIGH
  57. PC13 SPEKTRUM_PWR_EN OUTPUT LOW
  58. define HAL_GPIO_PIN_SPEKTRUM_OUT PAL_LINE(GPIOA,10U)
  59. PA8 RCIN INPUT SPEED_HIGH FLOATING # RC Input PPM
  60. # analog inputs
  61. PA4 VSERVO ADC1
  62. PA5 VRSSI ADC1
  63. define HAL_ADC_VSERVO_CHAN ADC_CHANNEL_IN4
  64. define HAL_ADC_VRSSI_CHAN ADC_CHANNEL_IN5
  65. define HAL_USE_ADC TRUE
  66. define STM32_ADC_USE_ADC1 TRUE
  67. define HAL_DISABLE_ADC_DRIVER TRUE
  68. #Manually define ICU settings
  69. define HAL_USE_ICU TRUE
  70. define STM32_ICU_USE_TIM1 TRUE
  71. define RCIN_ICU_TIMER ICUD1
  72. define RCIN_ICU_CHANNEL ICU_CHANNEL_1
  73. define STM32_RCIN_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  74. # only use pulse input for PPM, other protocols
  75. # are on serial
  76. define HAL_RCIN_PULSE_PPM_ONLY
  77. #DMA Channel Not relevant for F1 series
  78. define STM32_RCIN_DMA_CHANNEL 0
  79. define HAL_USE_EMPTY_STORAGE 1
  80. define HAL_STORAGE_SIZE 16384
  81. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  82. define HAL_INS_DEFAULT HAL_INS_NONE
  83. define HAL_BARO_DEFAULT HAL_BARO_NONE
  84. define HAL_NO_GPIO_IRQ
  85. define CH_CFG_ST_TIMEDELTA 0
  86. #define CH_CFG_USE_DYNAMIC FALSE
  87. define SERIAL_BUFFERS_SIZE 32
  88. define HAL_USE_EMPTY_IO TRUE
  89. define PORT_INT_REQUIRED_STACK 64
  90. # avoid timer and RCIN threads to save memory
  91. define HAL_NO_TIMER_THREAD
  92. define HAL_NO_RCIN_THREAD
  93. define HAL_NO_MONITOR_THREAD
  94. #defined to turn off undef warnings
  95. define __FPU_PRESENT 0
  96. define HAL_USE_RTC FALSE
  97. define HAL_NO_FLASH_SUPPORT TRUE
  98. define HAL_NO_UARTDRIVER TRUE
  99. define DISABLE_SERIAL_ESC_COMM TRUE
  100. define HAL_NO_LOGGING TRUE
  101. define DMA_RESERVE_SIZE 0
  102. # reduce memory usage in RCInput
  103. define SOFTSIG_MAX_SIGNAL_TRANSITIONS 128
  104. define IOMCU_FW TRUE
  105. define NO_FASTBOOT
  106. IOMCU_FW 1
  107. MAIN_STACK 0x200
  108. PROCESS_STACK 0x250
  109. define HAL_DISABLE_LOOP_DELAY