You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

304 lines
9.3 KiB

  1. ifneq ($(findstring MKL26Z64, $(MCU)),)
  2. # Cortex version
  3. MCU = cortex-m0plus
  4. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  5. ARMV = 6
  6. ## chip/board settings
  7. # - the next two should match the directories in
  8. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  9. MCU_FAMILY = KINETIS
  10. MCU_SERIES = KL2x
  11. # Linker script to use
  12. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  13. # or <keyboard_dir>/ld/
  14. # - NOTE: a custom ld script is needed for EEPROM on Teensy LC
  15. MCU_LDSCRIPT ?= MKL26Z64
  16. # Startup code to use
  17. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  18. MCU_STARTUP ?= kl2x
  19. # Board: it should exist either in <chibios>/os/hal/boards/,
  20. # <keyboard_dir>/boards/, or drivers/boards/
  21. BOARD ?= PJRC_TEENSY_LC
  22. endif
  23. ifneq ($(findstring MK20DX128, $(MCU)),)
  24. # Cortex version
  25. MCU = cortex-m4
  26. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  27. ARMV = 7
  28. ## chip/board settings
  29. # - the next two should match the directories in
  30. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  31. MCU_FAMILY = KINETIS
  32. MCU_SERIES = K20x
  33. # Linker script to use
  34. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  35. # or <keyboard_dir>/ld/
  36. MCU_LDSCRIPT ?= MK20DX128
  37. # Startup code to use
  38. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  39. MCU_STARTUP ?= k20x5
  40. # Board: it should exist either in <chibios>/os/hal/boards/,
  41. # <keyboard_dir>/boards/, or drivers/boards/
  42. BOARD ?= PJRC_TEENSY_3
  43. endif
  44. ifneq ($(findstring MK20DX256, $(MCU)),)
  45. # Cortex version
  46. MCU = cortex-m4
  47. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  48. ARMV = 7
  49. ## chip/board settings
  50. # - the next two should match the directories in
  51. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  52. MCU_FAMILY = KINETIS
  53. MCU_SERIES = K20x
  54. # Linker script to use
  55. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  56. # or <keyboard_dir>/ld/
  57. MCU_LDSCRIPT ?= MK20DX256
  58. # Startup code to use
  59. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  60. MCU_STARTUP ?= k20x7
  61. # Board: it should exist either in <chibios>/os/hal/boards/,
  62. # <keyboard_dir>/boards/, or drivers/boards/
  63. BOARD ?= PJRC_TEENSY_3_1
  64. endif
  65. ifneq ($(findstring STM32F303, $(MCU)),)
  66. # Cortex version
  67. MCU = cortex-m4
  68. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  69. ARMV = 7
  70. ## chip/board settings
  71. # - the next two should match the directories in
  72. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  73. MCU_FAMILY = STM32
  74. MCU_SERIES = STM32F3xx
  75. # Linker script to use
  76. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  77. # or <keyboard_dir>/ld/
  78. MCU_LDSCRIPT ?= STM32F303xC
  79. # Startup code to use
  80. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  81. MCU_STARTUP ?= stm32f3xx
  82. # Board: it should exist either in <chibios>/os/hal/boards/,
  83. # <keyboard_dir>/boards/, or drivers/boards/
  84. BOARD ?= GENERIC_STM32_F303XC
  85. USE_FPU ?= yes
  86. # Options to pass to dfu-util when flashing
  87. DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
  88. DFU_SUFFIX_ARGS ?= -v 0483 -p df11
  89. endif
  90. ifneq ($(findstring STM32F072, $(MCU)),)
  91. # Cortex version
  92. MCU = cortex-m0
  93. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  94. ARMV = 6
  95. ## chip/board settings
  96. # - the next two should match the directories in
  97. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  98. MCU_FAMILY = STM32
  99. MCU_SERIES = STM32F0xx
  100. # Linker script to use
  101. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  102. # or <keyboard_dir>/ld/
  103. MCU_LDSCRIPT ?= STM32F072xB
  104. # Startup code to use
  105. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  106. MCU_STARTUP ?= stm32f0xx
  107. # Board: it should exist either in <chibios>/os/hal/boards/,
  108. # <keyboard_dir>/boards/, or drivers/boards/
  109. BOARD ?= GENERIC_STM32_F072XB
  110. USE_FPU ?= no
  111. # Options to pass to dfu-util when flashing
  112. DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
  113. DFU_SUFFIX_ARGS ?= -v 0483 -p df11
  114. endif
  115. ifneq ($(findstring STM32F042, $(MCU)),)
  116. # Cortex version
  117. MCU = cortex-m0
  118. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  119. ARMV = 6
  120. ## chip/board settings
  121. # - the next two should match the directories in
  122. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  123. MCU_FAMILY = STM32
  124. MCU_SERIES = STM32F0xx
  125. # Linker script to use
  126. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  127. # or <keyboard_dir>/ld/
  128. MCU_LDSCRIPT ?= STM32F042x6
  129. # Startup code to use
  130. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  131. MCU_STARTUP ?= stm32f0xx
  132. # Board: it should exist either in <chibios>/os/hal/boards/,
  133. # <keyboard_dir>/boards/, or drivers/boards/
  134. BOARD ?= GENERIC_STM32_F042X6
  135. USE_FPU ?= no
  136. # Options to pass to dfu-util when flashing
  137. DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
  138. DFU_SUFFIX_ARGS ?= -v 0483 -p df11
  139. endif
  140. ifneq ($(findstring STM32F103, $(MCU)),)
  141. # Cortex version
  142. MCU = cortex-m3
  143. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  144. ARMV = 7
  145. ## chip/board settings
  146. # - the next two should match the directories in
  147. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  148. MCU_FAMILY = STM32
  149. MCU_SERIES = STM32F1xx
  150. # Linker script to use
  151. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  152. # or <keyboard_dir>/ld/
  153. MCU_LDSCRIPT ?= STM32F103x8
  154. # Startup code to use
  155. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  156. MCU_STARTUP ?= stm32f1xx
  157. # Board: it should exist either in <chibios>/os/hal/boards/,
  158. # <keyboard_dir>/boards/, or drivers/boards/
  159. BOARD ?= GENERIC_STM32_F103
  160. USE_FPU ?= no
  161. # Options to pass to dfu-util when flashing
  162. DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
  163. DFU_SUFFIX_ARGS ?= -v 0483 -p df11
  164. endif
  165. ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb1286))
  166. PROTOCOL = LUFA
  167. # Processor frequency.
  168. # This will define a symbol, F_CPU, in all source code files equal to the
  169. # processor frequency in Hz. You can then use this symbol in your source code to
  170. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  171. # automatically to create a 32-bit value in your source code.
  172. #
  173. # This will be an integer division of F_USB below, as it is sourced by
  174. # F_USB after it has run through any CPU prescalers. Note that this value
  175. # does not *change* the processor frequency - it should merely be updated to
  176. # reflect the processor speed set externally so that the code can use accurate
  177. # software delays.
  178. F_CPU ?= 16000000
  179. # LUFA specific
  180. #
  181. # Target architecture (see library "Board Types" documentation).
  182. ARCH = AVR8
  183. # Input clock frequency.
  184. # This will define a symbol, F_USB, in all source code files equal to the
  185. # input clock frequency (before any prescaling is performed) in Hz. This value may
  186. # differ from F_CPU if prescaling is used on the latter, and is required as the
  187. # raw input clock is fed directly to the PLL sections of the AVR for high speed
  188. # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
  189. # at the end, this will be done automatically to create a 32-bit value in your
  190. # source code.
  191. #
  192. # If no clock division is performed on the input clock inside the AVR (via the
  193. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
  194. F_USB ?= $(F_CPU)
  195. # Interrupt driven control endpoint task
  196. ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
  197. OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
  198. endif
  199. endif
  200. ifneq (,$(filter $(MCU),atmega32a))
  201. # MCU name for avrdude
  202. AVRDUDE_MCU = m32
  203. PROTOCOL = VUSB
  204. # Processor frequency.
  205. # This will define a symbol, F_CPU, in all source code files equal to the
  206. # processor frequency in Hz. You can then use this symbol in your source code to
  207. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  208. # automatically to create a 32-bit value in your source code.
  209. F_CPU ?= 12000000
  210. # unsupported features for now
  211. NO_UART ?= yes
  212. NO_SUSPEND_POWER_DOWN ?= yes
  213. endif
  214. ifneq (,$(filter $(MCU),atmega328p))
  215. # MCU name for avrdude
  216. AVRDUDE_MCU = m328p
  217. PROTOCOL = VUSB
  218. # Processor frequency.
  219. # This will define a symbol, F_CPU, in all source code files equal to the
  220. # processor frequency in Hz. You can then use this symbol in your source code to
  221. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  222. # automatically to create a 32-bit value in your source code.
  223. F_CPU ?= 16000000
  224. # unsupported features for now
  225. NO_UART ?= yes
  226. NO_SUSPEND_POWER_DOWN ?= yes
  227. endif
  228. ifneq (,$(filter $(MCU),attiny85))
  229. PROTOCOL = VUSB
  230. # Processor frequency.
  231. # This will define a symbol, F_CPU, in all source code files equal to the
  232. # processor frequency in Hz. You can then use this symbol in your source code to
  233. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  234. # automatically to create a 32-bit value in your source code.
  235. F_CPU ?= 16500000
  236. # unsupported features for now
  237. NO_UART ?= yes
  238. NO_SUSPEND_POWER_DOWN ?= yes
  239. endif