The functions in Frequency Meter (FREQM) synchronous driver will block (i.e. not return) until the operation is done.
Initialize and deinitialize the driver and associated hardware
Enable or disable Frequency Meter
Set measurement parameter (measure period, frequency or period measurement)
Read measurement results
Clock to be measured
Reference clock
Number of reference clock cycles (measure period)
After FREQM hardware initialization, the measure result can get by freqmeter_sync_read.
The following shows a simple example of using the FREQM. The FREQM must have been initialized by freqmeter_sync_init. This initialization will configure the operation of the FREQM, such as clock to be measured, reference clock, etc.
The example enables FREQM, and finally starts to read measurement results.
void FREQUENCY_METER_0_example(void)
{
uint32_t value;
freqmeter_sync_enable(&FREQUENCY_METER_0);
freqmeter_sync_read(&FREQUENCY_METER_0, &value, 1);
}
FREQM peripheral and its related I/O lines and clocks