Atmel Software Framework

sysclk.c File Reference

Chip-specific system clock management functions.

Copyright (c) 2009-2011 Atmel Corporation. All rights reserved.

#include <compiler.h>
#include <stdbool.h>
#include <sysclk.h>
#include <avr32/io.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, PM and GPIO are made permanently available for now; this may change in the future.
#define SYSCLK_INIT_MINIMAL_CPUMASK   ((1 << SYSCLK_OCD) | (1 << SYSCLK_SYSTIMER))
 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_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...
 
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 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...