board_mcu.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * The MIT License (MIT)
  3. *
  4. * Copyright (c) 2020, Ha Thach (tinyusb.org)
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. *
  24. * This file is part of the TinyUSB stack.
  25. */
  26. #ifndef BOARD_MCU_H_
  27. #define BOARD_MCU_H_
  28. #include "tusb_option.h"
  29. //--------------------------------------------------------------------+
  30. // Low Level MCU header include. Example should be
  31. // platform independent and mostly doesn't need to include this file.
  32. // However there are still certain situation where this file is needed:
  33. // - FreeRTOSConfig.h to set up correct clock and NVIC interrupts for ARM Cortex
  34. // - SWO logging for Cortex M with ITM_SendChar() / ITM_ReceiveChar()
  35. //--------------------------------------------------------------------+
  36. // Include order follows OPT_MCU_ number
  37. #if CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13XX || \
  38. CFG_TUSB_MCU == OPT_MCU_LPC15XX || CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || \
  39. CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC18XX || \
  40. CFG_TUSB_MCU == OPT_MCU_LPC40XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX
  41. #include "chip.h"
  42. #elif CFG_TUSB_MCU == OPT_MCU_LPC51UXX || CFG_TUSB_MCU == OPT_MCU_LPC54XXX || \
  43. CFG_TUSB_MCU == OPT_MCU_LPC55XX || CFG_TUSB_MCU == OPT_MCU_MKL25ZXX || \
  44. CFG_TUSB_MCU == OPT_MCU_K32L2BXX
  45. #include "fsl_device_registers.h"
  46. #elif CFG_TUSB_MCU == OPT_MCU_NRF5X
  47. #include "nrf.h"
  48. #elif CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \
  49. CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X || \
  50. CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21
  51. #include "sam.h"
  52. #elif CFG_TUSB_MCU == OPT_MCU_SAMG
  53. #undef LITTLE_ENDIAN // hack to suppress "LITTLE_ENDIAN" redefined
  54. #include "sam.h"
  55. #elif CFG_TUSB_MCU == OPT_MCU_STM32F0
  56. #include "stm32f0xx.h"
  57. #elif CFG_TUSB_MCU == OPT_MCU_STM32F1
  58. #include "stm32f1xx.h"
  59. #elif CFG_TUSB_MCU == OPT_MCU_STM32F2
  60. #include "stm32f2xx.h"
  61. #elif CFG_TUSB_MCU == OPT_MCU_STM32F3
  62. #include "stm32f3xx.h"
  63. #elif CFG_TUSB_MCU == OPT_MCU_STM32F4
  64. #include "stm32f4xx.h"
  65. #elif CFG_TUSB_MCU == OPT_MCU_STM32F7
  66. #include "stm32f7xx.h"
  67. #elif CFG_TUSB_MCU == OPT_MCU_STM32G4
  68. #include "stm32g4xx.h"
  69. #elif CFG_TUSB_MCU == OPT_MCU_STM32H7
  70. #include "stm32h7xx.h"
  71. #elif CFG_TUSB_MCU == OPT_MCU_STM32L0
  72. #include "stm32l0xx.h"
  73. #elif CFG_TUSB_MCU == OPT_MCU_STM32L1
  74. #include "stm32l1xx.h"
  75. #elif CFG_TUSB_MCU == OPT_MCU_STM32L4
  76. #include "stm32l4xx.h"
  77. #elif CFG_TUSB_MCU == OPT_MCU_STM32WB
  78. #include "stm32wbxx.h"
  79. #elif CFG_TUSB_MCU == OPT_MCU_STM32U5
  80. #include "stm32u5xx.h"
  81. #elif CFG_TUSB_MCU == OPT_MCU_CXD56
  82. // no header needed
  83. #elif CFG_TUSB_MCU == OPT_MCU_MSP430x5xx
  84. #include "msp430.h"
  85. #elif CFG_TUSB_MCU == OPT_MCU_MSP432E4
  86. #include "msp.h"
  87. #elif CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI
  88. // no header needed
  89. #elif CFG_TUSB_MCU == OPT_MCU_MIMXRT
  90. #include "fsl_device_registers.h"
  91. #elif CFG_TUSB_MCU == OPT_MCU_NUC120
  92. #include "NUC100Series.h"
  93. #elif CFG_TUSB_MCU == OPT_MCU_NUC121 || CFG_TUSB_MCU == OPT_MCU_NUC126
  94. #include "NuMicro.h"
  95. #elif CFG_TUSB_MCU == OPT_MCU_NUC505
  96. #include "NUC505Series.h"
  97. #elif CFG_TUSB_MCU == OPT_MCU_ESP32S2
  98. // no header needed
  99. #elif CFG_TUSB_MCU == OPT_MCU_ESP32S3
  100. // no header needed
  101. #elif CFG_TUSB_MCU == OPT_MCU_DA1469X
  102. #include "DA1469xAB.h"
  103. #elif CFG_TUSB_MCU == OPT_MCU_RP2040
  104. #include "pico.h"
  105. #elif CFG_TUSB_MCU == OPT_MCU_EFM32GG
  106. #include "em_device.h"
  107. #elif CFG_TUSB_MCU == OPT_MCU_RX63X || CFG_TUSB_MCU == OPT_MCU_RX65X
  108. // no header needed
  109. #elif CFG_TUSB_MCU == OPT_MCU_GD32VF103
  110. #include "gd32vf103.h"
  111. #elif CFG_TUSB_MCU == OPT_MCU_MM32F327X
  112. #include "mm32_device.h"
  113. #elif CFG_TUSB_MCU == OPT_MCU_XMC4000
  114. #include "xmc_device.h"
  115. #elif CFG_TUSB_MCU == OPT_MCU_TM4C123
  116. #include "TM4C123.h"
  117. #elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
  118. // no header needed
  119. #else
  120. #error "Missing MCU header"
  121. #endif
  122. #endif /* BOARD_MCU_H_ */