Microchip® Advanced Software Framework

sysclk.c File Reference

Chip-specific system clock management functions.

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

#include <avr32/io.h>
#include <compiler.h>
#include <stdbool.h>
#include <sysclk.h>
#include <flashc.h>

Macros

Initial module clock masks

These are the mask values written to the xxxMASK registers during initialization if the user has overridden the default behavior of all clocks left enabled. These values assume that:

  • Debugging should be possible
  • The program may be running from flash
  • The PM should be available to unmask other clocks
  • All on-chip RAM should be available
  • INTC, SCIF, PM and GPIO are made permanently available for now; this may change in the future.
#define SYSCLK_INIT_MINIMAL_CPUMASK
 Initial value of CPUMASK. More...
 
#define SYSCLK_INIT_MINIMAL_HSBMASK
 Initial value of HSBMASK. More...
 
#define SYSCLK_INIT_MINIMAL_PBAMASK
 Initial value of PBAMASK. More...
 
#define SYSCLK_INIT_MINIMAL_PBBMASK   0
 Initial value of PBBMASK. More...
 
#define SYSCLK_INIT_MINIMAL_PBCMASK   0
 Initial value of PBCMASK. More...
 

Functions

void sysclk_disable_usb (void)
 Disable the USB generic clock. More...
 
void sysclk_enable_usb (void)
 Enable the USB generic clock. More...
 
void sysclk_priv_disable_module (unsigned int bus_id, unsigned int module_index)
 Disable a maskable module clock. More...
 
void sysclk_priv_enable_module (unsigned int bus_id, unsigned int module_index)
 Enable a maskable module clock. More...
 
System Clock Source and Prescaler configuration
void sysclk_set_prescalers (unsigned int cpu_shift, unsigned int pba_shift, unsigned int pbb_shift, unsigned int pbc_shift)
 Set system clock prescaler configuration. More...
 
void sysclk_set_source (uint_fast8_t src)
 Change the source of the main system clock. More...
 
System Clock Initialization
void sysclk_init (void)
 Initialize the synchronous clock system. More...