diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/ports/HT32/HT32F523xx/ht32_registry.h')
-rw-r--r-- | lib/chibios-contrib/os/hal/ports/HT32/HT32F523xx/ht32_registry.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/ports/HT32/HT32F523xx/ht32_registry.h b/lib/chibios-contrib/os/hal/ports/HT32/HT32F523xx/ht32_registry.h new file mode 100644 index 000000000..5b0d46b78 --- /dev/null +++ b/lib/chibios-contrib/os/hal/ports/HT32/HT32F523xx/ht32_registry.h | |||
@@ -0,0 +1,115 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio | ||
3 | Copyright (C) 2020 Yaotian Feng | ||
4 | |||
5 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | you may not use this file except in compliance with the License. | ||
7 | You may obtain a copy of the License at | ||
8 | |||
9 | http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | |||
11 | Unless required by applicable law or agreed to in writing, software | ||
12 | distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | See the License for the specific language governing permissions and | ||
15 | limitations under the License. | ||
16 | */ | ||
17 | |||
18 | /** | ||
19 | * @file HT32F165x/ht32_registry.h | ||
20 | * @brief HT32F165x capabilities registry. | ||
21 | * | ||
22 | * @addtogroup HAL | ||
23 | * @{ | ||
24 | */ | ||
25 | |||
26 | #pragma once | ||
27 | |||
28 | |||
29 | /** | ||
30 | * @brief Sub-family identifier. | ||
31 | */ | ||
32 | #if defined(HT32F52342) || defined(HT32F52352) || \ | ||
33 | defined(__DOXYGEN__) | ||
34 | #define HT32F523x2 | ||
35 | #else | ||
36 | #error unknown/unsupported HT32 microcontroller | ||
37 | #endif | ||
38 | |||
39 | /*===========================================================================*/ | ||
40 | /* Platform capabilities. */ | ||
41 | /*===========================================================================*/ | ||
42 | |||
43 | #if defined(HT32F523x2) || defined(__DOXYGEN__) | ||
44 | |||
45 | /** | ||
46 | * @brief Maximum system and core clock (f_SYS) frequency. | ||
47 | */ | ||
48 | #define HT32_SYSCLK_MAX 48000000L | ||
49 | |||
50 | /** | ||
51 | * @brief Maximum bus clock (f_BUS) frequency. | ||
52 | */ | ||
53 | #define HT32_BUSCLK_MAX 48000000L | ||
54 | |||
55 | /** | ||
56 | * @brief Maximum flash clock (f_FLASH) frequency. | ||
57 | */ | ||
58 | #define HT32_FLASHCLK_MAX 48000000L | ||
59 | |||
60 | /** | ||
61 | * @name HT32F52342x attributes | ||
62 | * @{ | ||
63 | */ | ||
64 | |||
65 | /* GPIO attributes.*/ | ||
66 | |||
67 | #define HT32_NUM_GPIO 4 | ||
68 | #define HT32_GPIO_INDEX_BITS 13 | ||
69 | #define HT32_CCR_PAEN CKCU_AHBCCR_PAEN | ||
70 | |||
71 | /* EXTI attributes */ | ||
72 | #define HT32_HAS_EXTI TRUE | ||
73 | #define HT32_NUM_EXTI 3 | ||
74 | #define HT32_EVWUP_IRQ_VECTOR Vector4C | ||
75 | #define HT32_EXTI0_1_IRQ_VECTOR Vector50 | ||
76 | #define HT32_EXTI2_3_IRQ_VECTOR Vector54 | ||
77 | #define HT32_EXTI4_15_IRQ_VECTOR Vector58 | ||
78 | |||
79 | /* BFTM attributes. */ | ||
80 | #define HT32_BFTM0_IRQ_VECTOR Vector84 | ||
81 | #define HT32_BFTM1_IRQ_VECTOR Vector88 | ||
82 | |||
83 | /* I2C attributes.*/ | ||
84 | #define HT32_HAS_I2C0 TRUE | ||
85 | #define HT32_I2C0_IRQ_VECTOR Vector8C | ||
86 | #define HT32_HAS_I2C1 TRUE | ||
87 | #define HT32_I2C1_IRQ_VECTOR Vector90 | ||
88 | |||
89 | /* SPI attributes.*/ | ||
90 | #define HT32_HAS_SPI0 TRUE | ||
91 | #define HT32_SPI0_IRQ_VECTOR Vector94 | ||
92 | #define HT32_HAS_SPI1 TRUE | ||
93 | #define HT32_SPI1_IRQ_VECTOR Vector98 | ||
94 | |||
95 | /* UART attributes.*/ | ||
96 | #define HT32_HAS_USART0 TRUE | ||
97 | #define HT32_USART0_IRQ_VECTOR Vector9C | ||
98 | #define HT32_HAS_USART1 TRUE | ||
99 | #define HT32_USART1_IRQ_VECTOR VectorA0 | ||
100 | #define HT32_HAS_UART0 TRUE | ||
101 | #define HT32_UART0_IRQ_VECTOR VectorA4 | ||
102 | #define HT32_HAS_UART1 TRUE | ||
103 | #define HT32_UART1_IRQ_VECTOR VectorA8 | ||
104 | |||
105 | /* USB attributes.*/ | ||
106 | #define HT32_HAS_USB TRUE | ||
107 | #define HT32_USB_IRQ_VECTOR VectorB4 | ||
108 | #define HT32_USB0_IS_USBOTG FALSE | ||
109 | #define HT32_HAS_USB_CLOCK_RECOVERY FALSE | ||
110 | |||
111 | /** @} */ | ||
112 | |||
113 | #endif /* defined(HT32F165x) */ | ||
114 | |||
115 | /** @} */ | ||