Frequency Meter Synchronous Driver

The functions in Frequency Meter (FREQM) synchronous driver will block (i.e. not return) until the operation is done.

Summary of the API's Functional Features

The API provides functions to:
  • 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

Summary of Configuration Options

Below is a list of the main FREQM parameters that can be configured in START. Many of these parameters are used by the freqmeter_sync_init function when initializing the driver and underlying hardware.
  • Clock to be measured

  • Reference clock

  • Number of reference clock cycles (measure period)

Driver Implementation Description

After FREQM hardware initialization, the measure result can get by freqmeter_sync_read.

Example of Usage

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);
          }
        

Dependencies

  • FREQM peripheral and its related I/O lines and clocks