stm32f3.nut 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. --
  2. -- * Copyright (C) 2013 by Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de)
  3. --
  4. -- Redistribution and use in source and binary forms, with or without
  5. -- modification, are permitted provided that the following conditions
  6. -- are met:
  7. --
  8. -- 1. Redistributions of source code must retain the above copyright
  9. -- notice, this list of conditions and the following disclaimer.
  10. -- 2. Redistributions in binary form must reproduce the above copyright
  11. -- notice, this list of conditions and the following disclaimer in the
  12. -- documentation and/or other materials provided with the distribution.
  13. -- 3. Neither the name of the copyright holders nor the names of
  14. -- contributors may be used to endorse or promote products derived
  15. -- from this software without specific prior written permission.
  16. --
  17. -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. -- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. -- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. -- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. -- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. -- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. -- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. -- SUCH DAMAGE.
  29. --
  30. -- For additional information see http://www.ethernut.de/
  31. --
  32. -- ARM CortexM3 Architecture
  33. -- STMicroelectronics STM32L Family Devices
  34. --
  35. --
  36. stm32_memory_f30 = { "128", "256" }
  37. stm32_memory_f37 = { "64", "128", "256" }
  38. stm32f3_device_class = { "STM32F302" , "STM32F303", "STM32F313", "STM32F373", "STM32F383" }
  39. -- *****************************************************************************
  40. -- STM32F30 Family
  41. -- *****************************************************************************
  42. --
  43. nutarch_cm3_stm32f3 =
  44. {
  45. --
  46. -- MCU Family
  47. --
  48. {
  49. name = "nutarch_cm3_stm32f3_family",
  50. brief = "MCU F3 Family",
  51. requires = { "HW_MCU_STM32F3XX" },
  52. sources = { "cm3/dev/stm/stm32f30_clk.c" },
  53. options =
  54. {
  55. {
  56. macro = "MCU_STM32F3",
  57. brief = "STM32F3 family",
  58. type = "integer",
  59. default = 1,
  60. provides =
  61. {
  62. "HW_FLASH_STM32F1_3",
  63. "HW_GPIO_STM32V2",
  64. "HW_CRC32_STM32V2",
  65. "DEV_IRQ_STM32",
  66. "HW_DMA1_STM32F1",
  67. "HW_DMA2_STM32F1",
  68. "HW_EXTI04_STM32",
  69. "HW_EXTI95_STM32",
  70. "HW_EXTI1510_STM32",
  71. "HW_I2C1_STM32V2",
  72. "HW_I2C2_STM32V2",
  73. "HW_SPI1_STM32",
  74. "HW_SPI2_STM32",
  75. "HW_SPI3_STM32",
  76. "HW_USART1_STM32",
  77. "HW_USART2_STM32",
  78. "HW_USART3_STM32",
  79. "HW_CAN1_STM32",
  80. "HW_RTC_STM32_V2",
  81. "HW_TIM2_32BIT_STM32",
  82. "HW_TIM3_STM32",
  83. "HW_TIM4_STM32",
  84. "HW_TIM6_DAC_STM32",
  85. "HW_DAC1_STM32",
  86. "HW_GPIO",
  87. "HW_MCU_FPU",
  88. },
  89. file = "include/cfg/arch.h"
  90. },
  91. {
  92. macro = "STM32F30X",
  93. brief = "STM32F40X",
  94. brief = "Include needed for STM32F302/303/313",
  95. type = "integer",
  96. requires = { "STM32F30X" },
  97. default = 1,
  98. provides =
  99. {
  100. "HW_UART4_STM32",
  101. "HW_UART5_STM32",
  102. "HW_TIM1_TIM15_TIM16_TIM17_STM32",
  103. "HW_TIM8_STM32",
  104. "HW_ADC1_2_STM32",
  105. "HW_COMP1_2_3_STM32",
  106. "HW_COMP4_5_6_STM32",
  107. "HW_COMP7_STM32",
  108. "HW_OP1_2_STM32",
  109. },
  110. file = "include/cfg/arch.h"
  111. },
  112. {
  113. macro = "STM32F37X",
  114. brief = "STM32F37X",
  115. brief = "Include needed for STM32F373/385",
  116. type = "integer",
  117. requires = { "LICENSE_MCD_ST_LIBERTY", "LICENSE_ST_GUIDANCE_ONLY", "STM32F37X" },
  118. default = 1,
  119. provides =
  120. {
  121. "HW_TIM5_32BIT_STM32",
  122. "HW_TIM7_STM32",
  123. "HW_TIM12_STM32",
  124. "HW_TIM13_STM32",
  125. "HW_TIM14_STM32",
  126. "HW_TIM15_STM32",
  127. "HW_TIM16_STM32",
  128. "HW_TIM17_STM32",
  129. "HW_TIM18_DAC2_STM32",
  130. "HW_TIM19_STM32",
  131. "HW_CEC_STM32V2",
  132. "HW_ADC1_STM32",
  133. "HW_SDADC1_STM32",
  134. "HW_SDADC2_STM32",
  135. "HW_SDADC3_STM32",
  136. "HW_COMP_STM32",
  137. },
  138. makedefs = { "MCD_LICENSE=y" },
  139. file = "include/cfg/arch.h"
  140. },
  141. }
  142. },
  143. --
  144. -- STM32F30 Memory
  145. --
  146. {
  147. name = "nutarch_cm3_stm32F3_memory",
  148. brief = "STM32F30x Device Memory",
  149. requires = { "HW_MCU_STM32F3XX" },
  150. options =
  151. {
  152. {
  153. macro = "MCU_STM32F30X",
  154. brief = "STM32F30x memory",
  155. description = "Select your devices memory by the marked alphanumeric code on the chip:\n"..
  156. "STM32F30x>Y<zz where Y is one of the list below.\n\n"..
  157. "B = 128 kbytes Flash\n"..
  158. "C = 256 kbytes Flash\n",
  159. requires = { "HW_MCU_STM32F30X" },
  160. type = "enumerated",
  161. choices = stm32_memory_f30,
  162. file = "include/cfg/arch.h",
  163. },
  164. {
  165. macro = "MCU_STM32F37X",
  166. brief = "STM32F37x memory",
  167. description = "Select your devices memory by the marked alphanumeric code on the chip:\n"..
  168. "STM32F37x>Y<zz where Y is one of the list below.\n\n"..
  169. "8 = 64 kbytes Flash\n"..
  170. "B = 128 kbytes Flash\n"..
  171. "C = 256 kbytes Flash\n",
  172. requires = { "HW_MCU_STM32F37X" },
  173. type = "enumerated",
  174. choices = stm32_memory_f37,
  175. file = "include/cfg/arch.h",
  176. },
  177. }
  178. },
  179. }