/* Get the current system clock frequency. 
This function can be used to determine the frequency of the main system clock. The return value is the system clock frequency measured in hertz. */
uint32_t am_hal_clkgen_sysclk_get(void)
/* Get the current system clock frequency. 
This function can be used to determine the frequency of the main system clock. The return value is the system clock frequency measured in hertz. */
uint32_t am_hal_clkgen_sysclk_get(void)
{
    uint32_t ui32ClockSetting;
    ui32ClockSetting = AM_REG(CLKGEN, CCTRL) & AM_REG_CLKGEN_CCTRL_CORESEL_M;
    switch ( ui32ClockSetting )
    {
        case AM_REG_CLKGEN_CCTRL_CORESEL_HFRC:
            return 48000000;
        case AM_REG_CLKGEN_CCTRL_CORESEL_HFRC_DIV2:
            return 24000000;
        default:
            return 0xFFFFFFFF;
    }
}