1 /*********************************************************************************************************//**
2  * @file    ht32f5xxxx_lib.h
3  * @version $Rev:: 7924         $
4  * @date    $Date:: 2024-08-07 #$
5  * @brief   The header file includes all the header files of the libraries.
6  *************************************************************************************************************
7  * @attention
8  *
9  * Firmware Disclaimer Information
10  *
11  * 1. The customer hereby acknowledges and agrees that the program technical documentation, including the
12  *    code, which is supplied by Holtek Semiconductor Inc., (hereinafter referred to as "HOLTEK") is the
13  *    proprietary and confidential intellectual property of HOLTEK, and is protected by copyright law and
14  *    other intellectual property laws.
15  *
16  * 2. The customer hereby acknowledges and agrees that the program technical documentation, including the
17  *    code, is confidential information belonging to HOLTEK, and must not be disclosed to any third parties
18  *    other than HOLTEK and the customer.
19  *
20  * 3. The program technical documentation, including the code, is provided "as is" and for customer reference
21  *    only. After delivery by HOLTEK, the customer shall use the program technical documentation, including
22  *    the code, at their own risk. HOLTEK disclaims any expressed, implied or statutory warranties, including
23  *    the warranties of merchantability, satisfactory quality and fitness for a particular purpose.
24  *
25  * <h2><center>Copyright (C) Holtek Semiconductor Inc. All rights reserved</center></h2>
26  ************************************************************************************************************/
27 
28 /* Define to prevent recursive inclusion -------------------------------------------------------------------*/
29 #ifndef __HT32F5XXXX_LIB_H
30 #define __HT32F5XXXX_LIB_H
31 
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 
36 /* Settings ------------------------------------------------------------------------------------------------*/
37 #define HT32_FWLIB_VER                  (0x01014003)
38 #define HT32_FWLIB_SVN                  (0x8294)
39 
40 #if defined(USE_HT32F52220_30)
41   #include "ht32f52220_30_libcfg.h"
42 #endif
43 #if defined(USE_HT32F52231_41)
44   #include "ht32f52231_41_libcfg.h"
45 #endif
46 #if defined(USE_HT32F52331_41)
47   #include "ht32f52331_41_libcfg.h"
48 #endif
49 #if defined(USE_HT32F52342_52)
50   #include "ht32f52342_52_libcfg.h"
51 #endif
52 #if defined(USE_HT32F52243_53)
53   #include "ht32f52243_53_libcfg.h"
54 #endif
55 #if defined(USE_HT32F5826)
56   #include "ht32f5826_libcfg.h"
57 #endif
58 #if defined(USE_HT32F0008)
59   #include "ht32f0008_libcfg.h"
60 #endif
61 #if defined(USE_HT32F50220_30)
62   #include "ht32f50220_30_libcfg.h"
63 #endif
64 #if defined(USE_HT32F50231_41)
65   #include "ht32f50231_41_libcfg.h"
66 #endif
67 #if defined(USE_HT32F52344_54)
68   #include "ht32f52344_54_libcfg.h"
69 #endif
70 #if defined(USE_HT32F0006)
71   #include "ht32f0006_libcfg.h"
72 #endif
73 #if defined(USE_HT32F52357_67)
74   #include "ht32f52357_67_libcfg.h"
75 #endif
76 #if defined(USE_HT32F54231_41)
77   #include "ht32f54231_41_libcfg.h"
78 #endif
79 #if defined(USE_HT32F54243_53)
80   #include "ht32f54243_53_libcfg.h"
81 #endif
82 #if defined(USE_HT32F57342_52)
83   #include "ht32f57342_52_libcfg.h"
84 #endif
85 #if defined(USE_HT32F57331_41)
86   #include "ht32f57331_41_libcfg.h"
87 #endif
88 #if defined(USE_HT32F50343)
89   #include "ht32f50343_libcfg.h"
90 #endif
91 #if defined(USE_HT32F65230_40)
92   #include "ht32f65230_40_libcfg.h"
93 #endif
94 #if defined(USE_HT32F65232)
95   #include "ht32f65232_libcfg.h"
96 #endif
97 #if defined(USE_HT32F61141)
98   #include "ht32f61141_libcfg.h"
99 #endif
100 #if defined(USE_HT32F61244_45)
101   #include "ht32f61244_45_libcfg.h"
102 #endif
103 #if defined(USE_HT32F50020_30)
104   #include "ht32f50020_30_libcfg.h"
105 #endif
106 #if defined(USE_HT32F67041_51)
107   #include "ht32f67041_51_libcfg.h"
108 #endif
109 #if defined(USE_HT32F50442_52)
110   #include "ht32f50442_52_libcfg.h"
111 #endif
112 #if defined(USE_HT32F50431_41)
113   #include "ht32f50431_41_libcfg.h"
114 #endif
115 #if defined(USE_HT32F53242_52)
116   #include "ht32f53242_52_libcfg.h"
117 #endif
118 #if defined(USE_HT32F53231_41)
119   #include "ht32f53231_41_libcfg.h"
120 #endif
121 #if defined(USE_HT32F66242)
122   #include "ht32f66242_libcfg.h"
123 #endif
124 #if defined(USE_HT32F66246)
125   #include "ht32f66246_libcfg.h"
126 #endif
127 #if defined(USE_HT32F52234_44)
128   #include "ht32f52234_44_libcfg.h"
129 #endif
130 
131 /* Includes ------------------------------------------------------------------------------------------------*/
132 #include <stdio.h>
133 #include "ht32f5xxxx_conf.h"
134 
135 #if (HT32_LIB_DEBUG == 1)
136 /**
137   * @brief  The assert_param macro is used for function's parameters check.
138   * @param  expr: If expr is false, it calls assert_failed function
139   *   which reports the name of the source file and the source
140   *   line number of the call that failed.
141   *   If expr is true, it returns no value.
142   * @retval None
143   */
144 #define Assert_Param(expr) ((expr) ? (void)0 : assert_error((u8 *)__FILE__, __LINE__))
145 /* Exported functions ------------------------------------------------------- ------------------------------*/
146 void assert_error(u8* file, u32 line);
147 #else
148 
149 #define Assert_Param(expr) ((void)0)
150 
151 #endif /* DEBUG --------------------------------------------------------------------------------------------*/
152 
153 
154 #if _ADC
155   #if defined(USE_HT32F65230_40) || defined(USE_HT32F65232) || defined(USE_HT32F66242) || defined(USE_HT32F66246)
156   #include "ht32f65xxx_66xxx_adc.h"
157   #else
158   #include "ht32f5xxxx_adc.h"
159   #endif
160 #endif
161 
162 #if _AES && LIBCFG_AES
163   #include "ht32f5xxxx_aes.h"
164 #endif
165 
166 #if _BFTM
167   #include "ht32f5xxxx_bftm.h"
168 #endif
169 
170 #if _CAN && LIBCFG_CAN0
171   #include "ht32f5xxxx_can.h"
172 #endif
173 
174 #if _CKCU
175   #include "ht32f5xxxx_ckcu.h"
176 #endif
177 
178 #if _CMP && LIBCFG_CMP
179   #include "ht32f5xxxx_cmp.h"
180 #endif
181 
182 #if _CORDIC && LIBCFG_CORDIC
183   #include "ht32f66xxx_cordic.h"
184 #endif
185 
186 #if _CRC && LIBCFG_CRC
187   #include "ht32f5xxxx_crc.h"
188 #endif
189 
190 #if _DAC && (LIBCFG_DAC0 || LIBCFG_DAC1)
191   #include "ht32f5xxxx_dac.h"
192 #endif
193 
194 #if _DAC && LIBCFG_DACDUAL16
195   #include "ht32f5xxxx_dac_dual16.h"
196 #endif
197 
198 #if _DIV && LIBCFG_DIV
199   #include "ht32f5xxxx_div.h"
200 #endif
201 
202 #if _EBI && LIBCFG_EBI
203   #include "ht32f5xxxx_ebi.h"
204 #endif
205 
206 #if _EXTI
207   #include "ht32f5xxxx_exti.h"
208 #endif
209 
210 #if _FLASH
211   #include "ht32f5xxxx_flash.h"
212 #endif
213 
214 #if _GPIO
215   #include "ht32f5xxxx_gpio.h"
216 #endif
217 
218 #if _GPTM
219   #include "ht32f5xxxx_tm_type.h"
220   #include "ht32f5xxxx_tm.h"
221 #endif
222 
223 #if _I2C
224   #include "ht32f5xxxx_i2c.h"
225 #endif
226 
227 #if _I2S && LIBCFG_I2S
228   #include "ht32f5xxxx_i2s.h"
229 #endif
230 
231 #if _LCD && LIBCFG_LCD
232   #include "ht32f5xxxx_lcd.h"
233 #endif
234 
235 #if _LEDC && LIBCFG_LEDC
236   #include "ht32f5xxxx_ledc.h"
237 #endif
238 
239 #if _MCTM && LIBCFG_MCTM0
240   #include "ht32f5xxxx_tm_type.h"
241   #include "ht32f5xxxx_tm.h"
242   #include "ht32f5xxxx_mctm.h"
243 #endif
244 
245 #if _MIDI && LIBCFG_MIDI
246   #include "ht32f5xxxx_midi.h"
247 #endif
248 
249 #if _OPA && LIBCFG_OPA
250   #if defined(USE_HT32F65230_40) || defined(USE_HT32F65232)
251   #include "ht32f65xxx_66xxx_opa.h"
252   #else
253   #endif
254 #endif
255 
256 #if _PDMA && LIBCFG_PDMA
257   #include "ht32f5xxxx_pdma.h"
258 #endif
259 
260 #if _PGA && LIBCFG_PGA
261   #include "ht32f65xxx_66xxx_pga.h"
262 #endif
263 
264 #if _PID && LIBCFG_PID
265   #include "ht32f66xxx_pid.h"
266 #endif
267 
268 #if _PWRCU
269   #include "ht32f5xxxx_pwrcu.h"
270 #endif
271 
272 #if _RSTCU
273   #include "ht32f5xxxx_rstcu.h"
274 #endif
275 
276 #if _RTC
277   #include "ht32f5xxxx_rtc.h"
278 #endif
279 
280 #if _SCI && LIBCFG_SCI0
281   #include "ht32f5xxxx_sci.h"
282 #endif
283 
284 #if _SCTM
285   #include "ht32f5xxxx_tm_type.h"
286   #include "ht32f5xxxx_tm.h"
287 #endif
288 
289 #if _SLED && LIBCFG_SLED0
290   #include "ht32f5xxxx_sled.h"
291 #endif
292 
293 #if _SPI
294   #include "ht32f5xxxx_spi.h"
295 #endif
296 
297 #if _TKEY && LIBCFG_TKEY
298   #include "ht32f5xxxx_tkey.h"
299 #endif
300 
301 #if _USART
302   #include "ht32f5xxxx_usart.h"
303 #endif
304 
305 #if _USB && LIBCFG_USBD
306   #include "ht32f5xxxx_usbd.h"
307 #endif
308 
309 #if _WDT
310   #include "ht32f5xxxx_wdt.h"
311 #endif
312 
313 #if _MISC
314   #include "ht32_cm0plus_misc.h"
315 #endif
316 
317 #if _SERIAL
318   #include "ht32_serial.h"
319 #endif
320 
321 #if _SWDIV
322   #include "ht32_div.h"
323 #endif
324 
325 #if _SWRAND
326   #include "ht32_rand.h"
327 #endif
328 
329 #if (_RETARGET)
330   #if defined (__GNUC__)
331     #undef getchar
332     #define getchar SERIAL_GetChar
333   #endif
334 #endif
335 
336 #ifdef HTCFG_TIME_IPSEL
337 #include "ht32_time.h"
338 #endif
339 
340 #ifdef __cplusplus
341 }
342 #endif
343 
344 #endif
345