STM32F103xB.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/usr/bin/env python
  2. '''
  3. these tables are generated from the STM32 datasheets for the
  4. STM32F103x8
  5. '''
  6. # additional build information for ChibiOS
  7. build = {
  8. "CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk",
  9. "CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F1xx/platform.mk",
  10. "CHPRINTF_USE_FLOAT" : 'no',
  11. "USE_FPU" : 'no'
  12. }
  13. pincount = {
  14. 'A': 16,
  15. 'B': 16,
  16. 'C': 16,
  17. 'D': 16,
  18. 'E': 16
  19. }
  20. # MCU parameters
  21. mcu = {
  22. # location of MCU serial number
  23. 'UDID_START' : 0x1FFFF7E8,
  24. 'RAM_MAP' : [
  25. (0x20000000, 20, 1), # main memory, DMA safe
  26. ]
  27. }
  28. ADC1_map = {
  29. # format is PIN : ADC1_CHAN
  30. "PA0" : 0,
  31. "PA1" : 1,
  32. "PA2" : 2,
  33. "PA3" : 3,
  34. "PA4" : 4,
  35. "PA5" : 5,
  36. "PA6" : 6,
  37. "PA7" : 7,
  38. "PB0" : 8,
  39. "PB1" : 9,
  40. "PC0" : 10,
  41. "PC1" : 11,
  42. "PC2" : 12,
  43. "PC3" : 13,
  44. "PC4" : 14,
  45. "PC5" : 15,
  46. }
  47. DMA_Map = {
  48. # format is (DMA_TABLE, StreamNum, Channel)
  49. "ADC1" : [(1,1,0)],
  50. "TIM1_CH1" : [(1,2,0)],
  51. "TIM1_CH3" : [(1,6,0)],
  52. "TIM1_CH4" : [(1,4,0)],
  53. "TIM1_UP" : [(1,5,0)],
  54. "TIM2_CH1" : [(1,5,0)],
  55. "TIM2_CH2" : [(1,7,0)],
  56. "TIM2_CH3" : [(1,1,0)],
  57. "TIM2_CH4" : [(1,7,0)],
  58. "TIM2_UP" : [(1,2,0)],
  59. "TIM3_CH1" : [(1,6,0)],
  60. "TIM3_CH3" : [(1,2,0)],
  61. "TIM3_CH4" : [(1,3,0)],
  62. "TIM3_UP" : [(1,3,0)],
  63. "TIM4_CH1" : [(1,1,0)],
  64. "TIM4_CH2" : [(1,4,0)],
  65. "TIM4_CH3" : [(1,5,0)],
  66. "TIM4_UP" : [(1,7,0)],
  67. "TIM5_CH1" : [(2,5,0)],
  68. "TIM5_CH2" : [(2,4,0)],
  69. "TIM5_CH3" : [(2,2,0)],
  70. "TIM5_CH4" : [(2,1,0)],
  71. "TIM5_UP" : [(2,2,0)],
  72. "TIM8_CH1" : [(2,3,0)],
  73. "TIM8_CH2" : [(2,5,0)],
  74. "TIM8_CH3" : [(2,1,0)],
  75. "TIM8_CH4" : [(2,2,0)],
  76. "TIM8_UP" : [(2,1,0)],
  77. "TIM6_UP" : [(2,3,0)],
  78. "TIM7_UP" : [(2,4,0)],
  79. "I2C1_RX" : [(1,7,0)],
  80. "I2C1_TX" : [(1,6,0)],
  81. "I2C2_RX" : [(1,5,0)],
  82. "I2C2_TX" : [(1,4,0)],
  83. "SPI1_RX" : [(1,2,0)],
  84. "SPI1_TX" : [(1,3,0)],
  85. "SPI2_RX" : [(1,4,0)],
  86. "SPI2_TX" : [(1,5,0)],
  87. "SPI3_RX" : [(2,1,0)],
  88. "SPI3_TX" : [(2,2,0)],
  89. "UART4_RX" : [(2,3,0)],
  90. "UART4_TX" : [(2,5,0)],
  91. "USART1_RX" : [(1,5,0)],
  92. "USART1_TX" : [(1,4,0)],
  93. "USART2_RX" : [(1,6,0)],
  94. "USART2_TX" : [(1,7,0)],
  95. "USART3_RX" : [(1,3,0)],
  96. "USART3_TX" : [(1,2,0)],
  97. }