/*FUNCTION********************************************************************** * * Function Name : CLOCK_SYS_GetCoreClockFreq * Description : Gets the core clock frequency. * This function gets the core clock frequency. * *END**************************************************************************/ uint32_t CLOCK_SYS_GetCoreClockFreq(void) { return CLOCK_HAL_GetOutClk(MCG_BASE) / (CLOCK_HAL_GetOutDiv1(SIM_BASE) + 1); }
/*FUNCTION********************************************************************** * * Function Name : CLOCK_SYS_GetSystemClockFreq * Description : Gets the systen clock frequency. * This function gets the systen clock frequency. * *END**************************************************************************/ uint32_t CLOCK_SYS_GetSystemClockFreq(void) { return CLOCK_HAL_GetOutClk(MCG) / (CLOCK_HAL_GetOutDiv1(SIM) + 1); }
/*FUNCTION********************************************************************** * * Function Name : CLOCK_SYS_GetFlashClockFreq * Description : Gets the flash clock frequency. * This function gets the flash clock frequency. * *END**************************************************************************/ uint32_t CLOCK_SYS_GetFlashClockFreq(void) { return CLOCK_HAL_GetOutClk(MCG) / ((CLOCK_HAL_GetOutDiv1(SIM) + 1) *(CLOCK_HAL_GetOutDiv4(SIM) + 1)); }