Atmel Software Framework

uc3a3_a4/genclk.h File Reference

Chip-specific generic clock management.

Copyright (c) 2010-2015 Atmel Corporation. All rights reserved.

#include <osc.h>
#include <pll.h>
#include <stdint.h>
#include <avr32/io.h>

Data Structures

struct  genclk_config
 Hardware representation of a set of generic clock parameters. More...
 

Macros

Chip-specific generic clock definitions
#define GENCLK_DIV_MAX   511
 Maximum divider supported by the generic clock implementation. More...
 

Enumerations

enum  genclk_source {
  GENCLK_SRC_OSC0 = 0,
  GENCLK_SRC_OSC1 = 1,
  GENCLK_SRC_PLL0 = 2,
  GENCLK_SRC_PLL1 = 3
}
 Generic clock source ID. More...
 

Functions

Generic clock configuration
static void genclk_config_defaults (struct genclk_config *cfg, unsigned int id)
 Initialize cfg to the default configuration for the clock identified by id. More...
 
static void genclk_config_read (struct genclk_config *cfg, unsigned int id)
 Read the currently active configuration of the clock identified by id into cfg. More...
 
static void genclk_config_write (const struct genclk_config *cfg, unsigned int id)
 Activate the configuration cfg on the clock identified by id. More...
 
static void genclk_config_set_source (struct genclk_config *cfg, enum genclk_source src)
 Select a new source clock src in configuration cfg. More...
 
static void genclk_config_set_divider (struct genclk_config *cfg, unsigned int divider)
 Set a new divider in configuration cfg. More...
 
static void genclk_enable_source (enum genclk_source src)
 Enable the source clock src used by a generic clock. More...
 
Enabling and disabling Generic Clocks
static void genclk_enable (const struct genclk_config *cfg, unsigned int id)
 Activate the configuration cfg on the clock identified by id and enable it. More...
 
static void genclk_disable (unsigned int id)
 Disable the generic clock identified by id. More...