Austin Schuh | 41baf20 | 2022-01-01 14:33:40 -0800 | [diff] [blame^] | 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 | |
| 27 | |
| 28 | #ifndef BOARD_MCU_H_ |
| 29 | #define BOARD_MCU_H_ |
| 30 | |
| 31 | #include "tusb_option.h" |
| 32 | |
| 33 | //--------------------------------------------------------------------+ |
| 34 | // Low Level MCU header include. TinyUSB stack and example should be |
| 35 | // platform independent and mostly doens't need to include this file. |
| 36 | // However there are still certain situation where this file is needed: |
| 37 | // - FreeRTOSConfig.h to set up correct clock and NVIC interrupts for ARM Cortex |
| 38 | // - SWO logging for Cortex M with ITM_SendChar() / ITM_ReceiveChar() |
| 39 | //--------------------------------------------------------------------+ |
| 40 | |
| 41 | // Include order follows OPT_MCU_ number |
| 42 | #if CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13XX || \ |
| 43 | CFG_TUSB_MCU == OPT_MCU_LPC15XX || CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || \ |
| 44 | CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC18XX || \ |
| 45 | CFG_TUSB_MCU == OPT_MCU_LPC40XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX |
| 46 | #include "chip.h" |
| 47 | |
| 48 | #elif CFG_TUSB_MCU == OPT_MCU_LPC51UXX || CFG_TUSB_MCU == OPT_MCU_LPC54XXX || \ |
| 49 | CFG_TUSB_MCU == OPT_MCU_LPC55XX || CFG_TUSB_MCU == OPT_MCU_MKL25ZXX || \ |
| 50 | CFG_TUSB_MCU == OPT_MCU_K32L2BXX |
| 51 | #include "fsl_device_registers.h" |
| 52 | |
| 53 | #elif CFG_TUSB_MCU == OPT_MCU_NRF5X |
| 54 | #include "nrf.h" |
| 55 | |
| 56 | #elif CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \ |
| 57 | CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X || \ |
| 58 | CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21 |
| 59 | #include "sam.h" |
| 60 | |
| 61 | #elif CFG_TUSB_MCU == OPT_MCU_SAMG |
| 62 | #undef LITTLE_ENDIAN // hack to suppress "LITTLE_ENDIAN" redefined |
| 63 | #include "sam.h" |
| 64 | |
| 65 | #elif CFG_TUSB_MCU == OPT_MCU_STM32F0 |
| 66 | #include "stm32f0xx.h" |
| 67 | |
| 68 | #elif CFG_TUSB_MCU == OPT_MCU_STM32F1 |
| 69 | #include "stm32f1xx.h" |
| 70 | |
| 71 | #elif CFG_TUSB_MCU == OPT_MCU_STM32F2 |
| 72 | #include "stm32f2xx.h" |
| 73 | |
| 74 | #elif CFG_TUSB_MCU == OPT_MCU_STM32F3 |
| 75 | #include "stm32f3xx.h" |
| 76 | |
| 77 | #elif CFG_TUSB_MCU == OPT_MCU_STM32F4 |
| 78 | #include "stm32f4xx.h" |
| 79 | |
| 80 | #elif CFG_TUSB_MCU == OPT_MCU_STM32F7 |
| 81 | #include "stm32f7xx.h" |
| 82 | |
| 83 | #elif CFG_TUSB_MCU == OPT_MCU_STM32H7 |
| 84 | #include "stm32h7xx.h" |
| 85 | |
| 86 | #elif CFG_TUSB_MCU == OPT_MCU_STM32L0 |
| 87 | #include "stm32l0xx.h" |
| 88 | |
| 89 | #elif CFG_TUSB_MCU == OPT_MCU_STM32L1 |
| 90 | #include "stm32l1xx.h" |
| 91 | |
| 92 | #elif CFG_TUSB_MCU == OPT_MCU_STM32L4 |
| 93 | #include "stm32l4xx.h" |
| 94 | |
| 95 | #elif CFG_TUSB_MCU == OPT_MCU_CXD56 |
| 96 | // no header needed |
| 97 | |
| 98 | #elif CFG_TUSB_MCU == OPT_MCU_MSP430x5xx |
| 99 | #include "msp430.h" |
| 100 | |
| 101 | #elif CFG_TUSB_MCU == OPT_MCU_MSP432E4 |
| 102 | #include "msp.h" |
| 103 | |
| 104 | #elif CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI |
| 105 | // no header needed |
| 106 | |
| 107 | #elif CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX |
| 108 | #include "fsl_device_registers.h" |
| 109 | |
| 110 | #elif CFG_TUSB_MCU == OPT_MCU_NUC120 |
| 111 | #include "NUC100Series.h" |
| 112 | |
| 113 | #elif CFG_TUSB_MCU == OPT_MCU_NUC121 || CFG_TUSB_MCU == OPT_MCU_NUC126 |
| 114 | #include "NuMicro.h" |
| 115 | |
| 116 | #elif CFG_TUSB_MCU == OPT_MCU_NUC505 |
| 117 | #include "NUC505Series.h" |
| 118 | |
| 119 | #elif CFG_TUSB_MCU == OPT_MCU_ESP32S2 |
| 120 | // no header needed |
| 121 | |
| 122 | #elif CFG_TUSB_MCU == OPT_MCU_ESP32S3 |
| 123 | // no header needed |
| 124 | |
| 125 | #elif CFG_TUSB_MCU == OPT_MCU_DA1469X |
| 126 | #include "DA1469xAB.h" |
| 127 | |
| 128 | #elif CFG_TUSB_MCU == OPT_MCU_RP2040 |
| 129 | #include "pico.h" |
| 130 | |
| 131 | #elif CFG_TUSB_MCU == OPT_MCU_EFM32GG |
| 132 | #include "em_device.h" |
| 133 | |
| 134 | #elif CFG_TUSB_MCU == OPT_MCU_RX63X || CFG_TUSB_MCU == OPT_MCU_RX65X |
| 135 | // no header needed |
| 136 | |
| 137 | #elif CFG_TUSB_MCU == OPT_MCU_GD32VF103 |
| 138 | #include "gd32vf103.h" |
| 139 | |
| 140 | #elif CFG_TUSB_MCU == OPT_MCU_MM32F327X |
| 141 | #include "mm32_device.h" |
| 142 | |
| 143 | #elif CFG_TUSB_MCU == OPT_MCU_XMC4000 |
| 144 | #include "xmc_device.h" |
| 145 | |
| 146 | #elif CFG_TUSB_MCU == OPT_MCU_TM4C123 |
| 147 | #include "TM4C123.h" |
| 148 | |
| 149 | #else |
| 150 | #error "Missing MCU header" |
| 151 | #endif |
| 152 | |
| 153 | |
| 154 | #endif /* BOARD_MCU_H_ */ |