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 <flashcdw.h>
#include <osc.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:
| |
#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... | |
Functions | |
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... | |
Enabling and disabling synchronous clocks | |
void | sysclk_enable_pbb_module (unsigned int index) |
Enable a module clock derived from the PBB clock. More... | |
void | sysclk_disable_pbb_module (unsigned int index) |
Disable a module clock derived from the PBB clock. More... | |
System Clock Source and Prescaler configuration | |
void | sysclk_set_prescalers (unsigned int cpu_shift, unsigned int pba_shift, unsigned int pbb_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... | |
Variables | |
static uint8_t | sysclk_pbb_refcount |
Number of enabled peripherals on the PBB bus. More... | |