MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FMEAS: Frequency Measure Driver

Overview

The MCUXpresso SDK provides a peripheral driver for the Frequency Measure function of MCUXpresso SDK devices' SYSCON module.
It measures frequency of any on-chip or off-chip clock signal. The more precise and higher accuracy clock is selected as a reference clock. The resulting frequency is internally computed from the ratio of value of selected target and reference clock counters.

Frequency Measure Driver operation

INPUTMUX_AttachSignal() function has to be used to select reference and target clock signal sources.

FMEAS_StartMeasure() function starts the measurement cycle.

FMEAS_IsMeasureComplete() can be polled to check if the measurement cycle has finished.

FMEAS_GetFrequency() returns the frequency of the target clock. Frequency of the reference clock has to be provided as a parameter.

Typical use case

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/fmeas

Files

file  fsl_fmeas.h
 

Driver version

#define FSL_FMEAS_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 Defines LPC Frequency Measure driver version 2.0.0. More...
 

FMEAS Functional Operation

static void FMEAS_StartMeasure (SYSCON_Type *base)
 Starts a frequency measurement cycle. More...
 
static bool FMEAS_IsMeasureComplete (SYSCON_Type *base)
 Indicates when a frequency measurement cycle is complete. More...
 
uint32_t FMEAS_GetFrequency (SYSCON_Type *base, uint32_t refClockRate)
 Returns the computed value for a frequency measurement cycle. More...
 

Macro Definition Documentation

#define FSL_FMEAS_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Change log:

  • Version 2.0.0
    • initial version

Function Documentation

static void FMEAS_StartMeasure ( SYSCON_Type *  base)
inlinestatic
Parameters
base: SYSCON peripheral base address.
static bool FMEAS_IsMeasureComplete ( SYSCON_Type *  base)
inlinestatic
Parameters
base: SYSCON peripheral base address.
Returns
true if a measurement cycle is active, otherwise false.
uint32_t FMEAS_GetFrequency ( SYSCON_Type *  base,
uint32_t  refClockRate 
)
Parameters
base: SYSCON peripheral base address.
refClockRate: Reference clock rate used during the frequency measurement cycle.
Returns
Frequency in Hz.