Microchip® Advanced Software Framework

freqm.h File Reference

SAM Frequency Meter (FREQM) Driver.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include <system.h>

Data Structures

struct  freqm_config
 FREQM module configuration structure. More...
 
struct  freqm_module
 FREQM software device instance structure. More...
 

Typedefs

typedef void(* freqm_callback_t )(void)
 Type definition for a FREQM module callback function. More...
 

Enumerations

enum  freqm_callback { FREQM_CALLBACK_DONE = 0 }
 Enum for possible callback types for the FREQM module. More...
 
enum  freqm_status {
  FREQM_STATUS_MEASURE_DONE = 0,
  FREQM_STATUS_MEASURE_BUSY = 1,
  FREQM_STATUS_CNT_OVERFLOW = 2
}
 Enum for the possible status types for the FREQM module. More...
 

Functions

static bool freqm_is_syncing (void)
 Determines if the hardware module(s) are currently synchronizing to the bus. More...
 
Driver Initialization and Configuration
enum status_code freqm_init (struct freqm_module *const module_inst, Freqm *const hw, struct freqm_config *const config)
 Initializes a hardware FREQM module instance. More...
 
static void freqm_get_config_defaults (struct freqm_config *const config)
 Initializes all members of a FREQM configuration structure to safe defaults. More...
 
static void freqm_enable (struct freqm_module *const module_inst)
 Enables a FREQM that was previously configured. More...
 
static void freqm_disable (struct freqm_module *const module_inst)
 Disables a FREQM that was previously enabled. More...
 
Read FREQM Result
static void freqm_start_measure (struct freqm_module *const module)
 Start a manual measurement process. More...
 
static void freqm_clear_overflow (struct freqm_module *const module)
 Clears module overflow flag. More...
 
enum freqm_status freqm_get_result_value (struct freqm_module *const module_inst, uint32_t *result)
 Read the measurement data result. More...
 

Variables

struct freqm_module_freqm_instance