1 /*
2  * Copyright (c) 2022 Kamil Serwus
3  * Copyright (c) 2024 Gerson Fernando Budke <nandojve@gmail.com>
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef _SOC_ATMEL_SAM0_SAMC21_SOC_H_
9 #define _SOC_ATMEL_SAM0_SAMC21_SOC_H_
10 
11 #ifndef _ASMLANGUAGE
12 
13 #define DONT_USE_CMSIS_INIT
14 
15 #include <zephyr/types.h>
16 
17 #if defined(CONFIG_SOC_SAMC21E15A)
18 #include <samc21e15a.h>
19 #elif defined(CONFIG_SOC_SAMC21E16A)
20 #include <samc21e16a.h>
21 #elif defined(CONFIG_SOC_SAMC21E17A)
22 #include <samc21e17a.h>
23 #elif defined(CONFIG_SOC_SAMC21E18A)
24 #include <samc21e18a.h>
25 #elif defined(CONFIG_SOC_SAMC21G15A)
26 #include <samc21g15a.h>
27 #elif defined(CONFIG_SOC_SAMC21G16A)
28 #include <samc21g16a.h>
29 #elif defined(CONFIG_SOC_SAMC21G17A)
30 #include <samc21g17a.h>
31 #elif defined(CONFIG_SOC_SAMC21G18A)
32 #include <samc21g18a.h>
33 #elif defined(CONFIG_SOC_SAMC21J15A)
34 #include <samc21j15a.h>
35 #elif defined(CONFIG_SOC_SAMC21J16A)
36 #include <samc21j16a.h>
37 #elif defined(CONFIG_SOC_SAMC21J17A)
38 #include <samc21j17a.h>
39 #elif defined(CONFIG_SOC_SAMC21J18A)
40 #include <samc21j18a.h>
41 #elif defined(CONFIG_SOC_SAMC21J17AU)
42 #include <samc21j17au.h>
43 #elif defined(CONFIG_SOC_SAMC21J18AU)
44 #include <samc21j18au.h>
45 #elif defined(CONFIG_SOC_SAMC21N17A)
46 #include <samc21n17a.h>
47 #elif defined(CONFIG_SOC_SAMC21N18A)
48 #include <samc21n18a.h>
49 #else
50 #error Library does not support the specified device.
51 #endif
52 
53 #endif /* _ASMLANGUAGE */
54 
55 #define ADC_SAM0_REFERENCE_ENABLE_PROTECTED
56 
57 #include "adc_fixup_sam0.h"
58 #include "../common/soc_port.h"
59 #include "../common/atmel_sam0_dt.h"
60 
61 #define SOC_ATMEL_SAM0_OSC32K_FREQ_HZ 32768
62 #define SOC_ATMEL_SAM0_OSC48M_FREQ_HZ 48000000
63 
64 /** Processor Clock (HCLK) Frequency */
65 #define SOC_ATMEL_SAM0_HCLK_FREQ_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
66 /** Master Clock (MCK) Frequency */
67 #define SOC_ATMEL_SAM0_MCK_FREQ_HZ SOC_ATMEL_SAM0_HCLK_FREQ_HZ
68 #define SOC_ATMEL_SAM0_GCLK0_FREQ_HZ SOC_ATMEL_SAM0_MCK_FREQ_HZ
69 
70 #endif /* _SOC_ATMEL_SAM0_SAMC21_SOC_H_ */
71