SAME54P20A Test Project
clocks.h
1 #ifndef _CLOCKS_H_
2 #define _CLOCKS_H_
3 
4 #include "core.h"
5 
6 // XOSC32K Definitions
7 #define CONF_CORE_CLK_XOSC32KCTRL_CGM_LP_MODE (0x0)
8 #define CONF_CORE_CLK_XOSC32KCTRL_CGM_STD_MODE (0x1)
9 #define CONF_CORE_CLK_XOSC32KCTRL_CGM_HS_MODE (0x2)
10 
11 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_62592us (0x0)
12 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_125092us (0x1)
13 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_500092us (0x2)
14 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_1000009200ns (0x3)
15 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_2000009200ns (0x4)
16 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_4000009200ns (0x5)
17 #define CONF_CORE_CLK_XOSC32KCTRL_STARTUP_8000009200ns (0x6)
18 
19 // Oscillator Current Multiplier
20 #define CONF_CORE_CLK_XOSCCTRL_IMULT_24MHZ_TO_48MHZ (6)
21 #define CONF_CORE_CLK_XOSCCTRL_IMULT_16MHZ_TO_24MHZ (5)
22 #define CONF_CORE_CLK_XOSCCTRL_IMULT_8MHZ_TO_16MHZ (4)
23 #define CONF_CORE_CLK_XOSCCTRL_IMULT_8MHZ (3)
24 
25 // Oscillator Current Reference
26 #define CONF_CORE_CLK_XOSCCTRL_IPTAT_24MHZ_TO_48MHZ (3)
27 #define CONF_CORE_CLK_XOSCCTRL_IPTAT_16MHZ_TO_24MHZ (3)
28 #define CONF_CORE_CLK_XOSCCTRL_IPTAT_8MHZ_TO_16MHZ (3)
29 #define CONF_CORE_CLK_XOSCCTRL_IPTAT_8MHZ (2)
30 
31 // DFLL Definitions
32 #define CONF_CORE_CLK_DFLLCTRL_STABLE_FCALIB_NOT_FIXED (0)
33 #define CONF_CORE_CLK_DFLLCTRL_STABLE_FCALIB_FIXED (1)
34 
35 // DPLL Definitions
36 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_3210KHZ (0x0)
37 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_1600KHZ (0x1)
38 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_1100KHZ (0x2)
39 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_800KHZ (0x3)
40 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_640KHZ (0x4)
41 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_550KHZ (0x5)
42 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_450KHZ (0x6)
43 #define CONF_CORE_CLK_DPLLCTRL_DCOFILTER_400KHZ (0x7)
44 
45 #define CONF_CORE_CLK_DPLLCTRL_LTIME_TIMEOUT_NONE (0x0)
46 #define CONF_CORE_CLK_DPLLCTRL_LTIME_TIMEOUT_800us (0x4)
47 #define CONF_CORE_CLK_DPLLCTRL_LTIME_TIMEOUT_900us (0x5)
48 #define CONF_CORE_CLK_DPLLCTRL_LTIME_TIMEOUT_1000us (0x6)
49 #define CONF_CORE_CLK_DPLLCTRL_LTIME_TIMEOUT_1100us (0x7)
50 
51 #define CONF_CORE_CLK_DPLLCTRL_REFCLK_GCLK (0x0)
52 #define CONF_CORE_CLK_DPLLCTRL_REFCLK_XOSC32 (0x1)
53 #define CONF_CORE_CLK_DPLLCTRL_REFCLK_XOSC0 (0x2)
54 #define CONF_CORE_CLK_DPLLCTRL_REFCLK_XOSC1 (0x3)
55 
56 void clock_osc32k_init(void);
57 void clock_osc_init(void);
58 void clock_mclk_init(void);
59 void clock_gclk_init(void);
60 void clock_dpll_init(void);
61 void clock_dfll_init(void);
62 #endif