Skip to content

Commit

Permalink
cpu/samd5x: add support for FDPLL1 running at 200MHz
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
  • Loading branch information
dylad committed May 16, 2023
1 parent f790d9f commit 6607ed1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cpu/samd5x/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ void sam0_gclk_enable(uint8_t id)
} else if (USE_XOSC) {
gclk_connect(SAM0_GCLK_PERIPH, GCLK_SOURCE_ACTIVE_XOSC, 0);
}

break;
case SAM0_GCLK_200MHZ:
fdpll_init_nolock(1, MHZ(200), OSCCTRL_DPLLCTRLA_ONDEMAND);
gclk_connect(SAM0_GCLK_200MHZ, GCLK_SOURCE_DPLL1, 0);
fdpll_lock(1);
break;
}
}
Expand All @@ -277,6 +281,8 @@ uint32_t sam0_gclk_freq(uint8_t id)
assert(0);
return 0;
}
case SAM0_GCLK_200MHZ:
return MHZ(200);
default:
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions cpu/samd5x/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum {
SAM0_GCLK_32KHZ, /**< 32 kHz clock */
SAM0_GCLK_TIMER, /**< 4-8 MHz clock for xTimer */
SAM0_GCLK_PERIPH, /**< 12-48 MHz (DFLL) clock */
SAM0_GCLK_200MHZ, /**< 200MHz FDPLL clock */
};
/** @} */

Expand Down

0 comments on commit 6607ed1

Please sign in to comment.