1.3.12.5 FREQM_FrequencyGet Function

C

uint32_t FREQM_FrequencyGet(void)

Summary

Returns the measured frequency in Hz.

Description

This function returns the measured frequency in Hz. It should be called when a frequency measurement is complete and no errors have occurred. This function is non-blocking. In this mode, the function should be called only after a callback function was called. The return value of the function is only valid if the FREQM_ErrorGet() function returns FREQM_ERROR_NONE.

Precondition

FREQM_Initialize() and FREQM_MeasurementStart() functions should be called.

Parameters

None.

Returns

Returns frequency value of the measured clock. The value is only valid if the FREQM_ErrorGet() function returns FREQM_ERROR_NONE.

Example

// Refer to the code example of FREQM_CallbackRegister() function for guidance on interrupt based operation.
// The following code snippet shows an exampl of non-interrupt based operation.

FREQM_Initialize();
FREQM_MeasurementStart()

// Wait till the measurement is complete.
while(FREQM_IsBusy());

if(FREQM_ERROR_NONE == FREQM_ErrorGet())
{
    measuredFrequency = FREQM_FrequencyGet();
    // This means there are no errors and the value contained in
    // measuredFrequency is valid.
}

Remarks

None.