/* Return the clock source which is used as system clock.  */
enum rcc_osc rcc_system_clock_source(void)
/* Return the clock source which is used as system clock.  */
enum rcc_osc rcc_system_clock_source(void)
{
	switch ((RCC_CFGR >> RCC_CFGR_SWS_SHIFT) & RCC_CFGR_SWS_MASK) {
		case RCC_CFGR_SW_HSISYS:
			return RCC_HSI;
		case RCC_CFGR_SW_HSE:
			return RCC_HSE;
		case RCC_CFGR_SWS_PLLRCLK:
			return RCC_PLL;
		case RCC_CFGR_SW_LSE:
			return RCC_LSE;
		case RCC_CFGR_SW_LSI:
			return RCC_LSI;
		default:
			cm3_assert_not_reached();
			return 0;
	}
}