/* param base FREQME peripheral base address. param refClkFrequency The frequency of reference clock. return The frequency of target clock, if the output result is 0, please check the module's operate mode.  */
uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency)
/* param base FREQME peripheral base address. param refClkFrequency The frequency of reference clock. return The frequency of target clock, if the output result is 0, please check the module's operate mode.  */
uint32_t FREQME_CalculateTargetClkFreq(FREQME_Type *base, uint32_t refClkFrequency)
{
    uint64_t measureResult = 0ULL;
    uint32_t targetFreq    = 0ULL;
    uint64_t tmp64         = 0ULL;
    while ((base->FREQMECTRL_R & FREQME_FREQMECTRL_R_MEASURE_IN_PROGRESS_MASK) != 0UL)
    {
    }
    if (!FREQME_CheckOperateMode(base))
    {
        measureResult = (uint64_t)(base->FREQMECTRL_R & FREQME_FREQMECTRL_R_RESULT_MASK);
        tmp64         = (measureResult - 2ULL) * (uint64_t)refClkFrequency;
        targetFreq    = (uint32_t)(tmp64 / (1UL << (uint32_t)FREQME_GetReferenceClkScaleValue(base)));
    }
    return targetFreq;
}