Xmega Application Note


osc.h File Reference

Chip-specific oscillator management functions. More...

#include <compiler.h>
#include <board.h>
Include dependency graph for osc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

Oscillator identifiers

#define OSC_ID_RC2MHZ   OSC_RC2MEN_bm
 2 MHz Internal RC Oscillator
#define OSC_ID_RC32KHZ   OSC_RC32KEN_bm
 32 KHz Internal RC Oscillator
#define OSC_ID_RC32MHZ   OSC_RC32MEN_bm
 32 MHz Internal RC Oscillator
#define OSC_ID_USBSOF   0xff
 Reference from USB Start Of Frame.
#define OSC_ID_XOSC   OSC_XOSCEN_bm
 External Oscillator.
XTAL resonator frequency range

#define XOSC_RANGE_04TO2   OSC_FRQRANGE_04TO2_gc
 0.4 to 2 MHz frequency range
#define XOSC_RANGE_12TO16
 12 to 16 MHz frequency range
#define XOSC_RANGE_2TO9   OSC_FRQRANGE_2TO9_gc
 2 to 9 MHz frequency range
#define XOSC_RANGE_9TO12   OSC_FRQRANGE_9TO12_gc
 9 to 12 MHz frequency range
XTAL resonator start-up cycles

#define XOSC_STARTUP_1024   1
 1 k cycle start-up time
#define XOSC_STARTUP_16384   2
 16 k cycle start-up time
#define XOSC_STARTUP_256   0
 256 cycle start-up time
External oscillator types

#define XOSC_TYPE_32KHZ   2
 32.768 kHz resonator on TOSC
#define XOSC_TYPE_EXTERNAL   0
 External clock signal.
#define XOSC_TYPE_XTAL   3
 0.4 to 16 MHz resonator on XTAL

Functions

static void osc_enable_external (uint8_t id)
static void osc_enable_internal (uint8_t id)
 Enable internal oscillator id.
Oscillator Management

static void osc_disable (uint8_t id)
 Disable oscillator id.
static void osc_enable (uint8_t id)
 Enable oscillator id.
static uint32_t osc_get_rate (uint8_t id)
 Return the frequency of oscillator id in Hz.
static bool osc_is_ready (uint8_t id)
 Determine whether oscillator id is ready.
XMEGA-Specific Oscillator Features

static void osc_disable_autocalibration (uint8_t id)
 Disable DFLL-based automatic calibration of an internal oscillator.
static void osc_enable_autocalibration (uint8_t id, uint8_t ref_id)
 Enable DFLL-based automatic calibration of an internal oscillator.
static void osc_user_calibration (uint8_t id, uint16_t calib)
 Load a specific calibration value for the specified oscillator.

Detailed Description

Chip-specific oscillator management functions.

Copyright (C) 2010 Atmel Corporation. All rights reserved.

Definition in file osc.h.

@DOC_TITLE@
Generated on Fri Oct 22 12:15:25 2010 for AVR1300 Using the Xmega ADC by doxygen 1.6.3