mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
cpu/saml21: add clock configuration for usbdev
Co-authored-by: dylad <dylan.laduranty@mesotic.com>
This commit is contained in:
parent
1ad2d07181
commit
3076ee837d
@ -82,8 +82,14 @@ static void _xosc32k_setup(void)
|
||||
|
||||
void sam0_gclk_enable(uint8_t id)
|
||||
{
|
||||
(void) id;
|
||||
/* clocks are always running */
|
||||
switch(id) {
|
||||
case SAM0_GCLK_48MHZ:
|
||||
_gclk_setup(SAM0_GCLK_48MHZ, GCLK_GENCTRL_GENEN |
|
||||
GCLK_GENCTRL_SRC_DFLL48M);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t sam0_gclk_freq(uint8_t id)
|
||||
@ -95,6 +101,8 @@ uint32_t sam0_gclk_freq(uint8_t id)
|
||||
return 8000000;
|
||||
case SAM0_GCLK_32KHZ:
|
||||
return 32768;
|
||||
case SAM0_GCLK_48MHZ:
|
||||
return 48000000;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ enum {
|
||||
SAM0_GCLK_MAIN = 0, /**< Main clock */
|
||||
SAM0_GCLK_8MHZ = 1, /**< 8MHz clock */
|
||||
SAM0_GCLK_32KHZ = 2, /**< 32 kHz clock */
|
||||
SAM0_GCLK_48MHZ = 3, /**< 48MHz clock */
|
||||
};
|
||||
/** @} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user