Microchip® Advanced Software Framework

sysclk_auto.c File Reference

Application-specific system clock management to support automatic detection of external oscillator.

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

#include "preprocessor.h"
#include "compiler.h"
#include "board.h"
#include "pm_uc3l.h"
#include "scif_uc3l.h"
#include "flashcdw.h"
#include "ast.h"
#include "cycle_counter.h"
#include "sysclk_auto.h"
#include "freq_detect.h"
#include "gpio.h"

Data Structures

union  u_avr32_scif_oscctrl0_t
 

Functions

External routines required by main.c file and usbc driver
void sysclk_auto_init (void)
 Detects extern OSC frequency and initialize system clocks on it. More...
 
void sysclk_auto_enable_usb (void)
 Enable the USB generic clock. More...
 
void sysclk_auto_disable_usb (void)
 Disable the USB generic clock. More...
 
External routines required by frequency detection service
void freq_detect_iface_ref_cnt_reset (void)
 Callback used to reset the counter of the reference's oscillator. More...
 
int freq_detect_iface_ref_cnt_value (void)
 Callback used to read the counter value of the reference's oscillator. More...
 
void freq_detect_iface_target_cnt_reset (void)
 Callback used to reset the counter of the target oscillator. More...
 
int freq_detetc_iface_target_cnt_value (void)
 Callback used to read the counter value of the target oscillator. More...
 

void sysclk_auto_disable_usb ( void  )

Disable the USB generic clock.

References scif_gc_setup().

void sysclk_auto_enable_usb ( void  )

Enable the USB generic clock.

Precondition
The USB generic clock must be configured to 48MHz.

References scif_gc_enable(), and scif_gc_setup().