Frequency Meter Example for SAM4L.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
Macros | |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
Example configuration | |
#define | GCLK_ID 0 |
Generic clock ID. More... | |
#define | GCLK_SOURCE GENCLK_SRC_CLK_CPU |
Generic clock source. More... | |
#define | GCLK_DIV 1 |
Generic clock divider. More... | |
Functions | |
static void | configure_console (void) |
Configure UART console. More... | |
int | main (void) |
Application entry point for freqm example. More... | |
Variables | |
struct freqm_config | g_freqm_cfg |
FREQM configuration. More... | |
struct freqm_dev_inst | g_freqm_inst |
FREQM instance. More... | |
#define GCLK_DIV 1 |
Generic clock divider.
This is how much the generic clock should divide the frequency of the configured clock source by.
Referenced by main().
#define GCLK_ID 0 |
Generic clock ID.
GENCLK Configuration Value.
This is the ID of the generic clock to use.
Referenced by main().
#define GCLK_SOURCE GENCLK_SRC_CLK_CPU |
#define STRING_EOL "\r" |
#define STRING_HEADER |
Referenced by main().
|
static |
Configure UART console.
References uart_rs232_options::baudrate, and stdio_serial_init().
Referenced by main().
int main | ( | void | ) |
Application entry point for freqm example.
References board_init(), configure_console(), freqm_config::duration, FREQM_DURATION_DEFAULT, freqm_enable(), freqm_get_config_defaults(), freqm_get_result_blocking(), freqm_init(), freqm_start_measure(), g_freqm_cfg, g_freqm_inst, GCLK_DIV, GCLK_ID, GCLK_SOURCE, genclk_enable_config(), freqm_config::msr_clk, osc_disable(), osc_enable(), OSC_ID_OSC0, OSC_ID_RCSYS, OSC_RC32K_NOMINAL_HZ, OSC_RCSYS_NOMINAL_HZ, osc_wait_ready(), pll_config_init(), pll_enable(), PLL_SRC_OSC0, pll_wait_for_lock(), freqm_config::ref_clk, STATUS_OK, STRING_HEADER, and sysclk_init().
struct freqm_config g_freqm_cfg |
FREQM configuration.
struct freqm_dev_inst g_freqm_inst |
FREQM instance.