Microchip® Advanced Software Framework

freqm_example.c File Reference

FREQM example driver for AVR UC3.

This file provides an example for the FREQM on AVR UC3 devices.

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

#include "board.h"
#include "gpio.h"
#include "intc.h"
#include "usart.h"
#include "freqm.h"
#include "print_funcs.h"
#include "power_clocks_lib.h"
#include "conf_board.h"


#define OSC32K_FREQ_HZ   32768


int clock_measure (void)
 Measured and get result after configuration. More...
void display_result (uint32_t refhz, uint32_t duration, uint32_t msrhz)
 Output result through usart. More...
int main (void)
 main function More...

#define OSC32K_FREQ_HZ   32768

Referenced by clock_measure(), and main().

int clock_measure ( void  )

Measured and get result after configuration.

Result of measured clock frequency(Hz)

References ERR_TIMEOUT, EXAMPLE_USART, freqm_get_result(), freqm_start(), OSC32K_FREQ_HZ, status, and usart_write_line().

Referenced by main().

void display_result ( uint32_t  refhz,
uint32_t  duration,
uint32_t  msrhz 

Output result through usart.

refhzFrequency of reference clock(Hz)
durationReference clock cycles
msrhzFrequency of measured clock(Hz)

References print_dbg(), and print_dbg_ulong().

Referenced by main().