File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ config SOC_ATMEL_SAMD5X_XOSC32K
10
10
startup. This can then be selected as the main clock source
11
11
for the SOC.
12
12
13
+ config SOC_ATMEL_SAMD5X_XOSC32K_STARTUP
14
+ depends on SOC_ATMEL_SAMD5X_XOSC32K
15
+ hex "Startup time external 32 kHz crystal oscillator"
16
+ range 0x0 0x6
17
+ default 0x1
18
+ help
19
+ Selects the startup time for the external 32 kHz crystal oscillator.
20
+
13
21
choice
14
22
prompt "Main clock source"
15
23
default SOC_ATMEL_SAMD5X_DEFAULT_AS_MAIN
Original file line number Diff line number Diff line change 18
18
#define SAM0_DFLL_FREQ_HZ (48000000U)
19
19
#define SAM0_DPLL_FREQ_MIN_HZ (96000000U)
20
20
#define SAM0_DPLL_FREQ_MAX_HZ (200000000U)
21
+ #define SAM0_XOSC32K_STARTUP_TIME CONFIG_SOC_ATMEL_SAMD5X_XOSC32K_STARTUP
21
22
22
23
#if CONFIG_SOC_ATMEL_SAMD5X_XOSC32K_AS_MAIN
23
24
static void osc32k_init (void )
24
25
{
25
- OSC32KCTRL -> XOSC32K .reg = OSC32KCTRL_XOSC32K_ENABLE | OSC32KCTRL_XOSC32K_XTALEN
26
- | OSC32KCTRL_XOSC32K_EN32K | OSC32KCTRL_XOSC32K_RUNSTDBY
27
- | OSC32KCTRL_XOSC32K_STARTUP (0 ) | OSC32KCTRL_XOSC32K_CGM_XT ;
26
+ OSC32KCTRL -> XOSC32K .reg = OSC32KCTRL_XOSC32K_ENABLE
27
+ | OSC32KCTRL_XOSC32K_XTALEN
28
+ | OSC32KCTRL_XOSC32K_CGM_XT
29
+ | OSC32KCTRL_XOSC32K_EN32K
30
+ | OSC32KCTRL_XOSC32K_RUNSTDBY
31
+ | OSC32KCTRL_XOSC32K_STARTUP (SAM0_XOSC32K_STARTUP_TIME )
32
+ ;
28
33
29
34
while (!OSC32KCTRL -> STATUS .bit .XOSC32KRDY ) {
30
35
}
You can’t perform that action at this time.
0 commit comments