Hanna
Sourcecode Batteriemanagementsystem |
Funktionen | |
static void | osc_disable (uint8_t id) |
static void | osc_enable (uint8_t id) |
static void | osc_enable_external (uint8_t id) |
static void | osc_enable_internal (uint8_t id) |
Enable internal oscillator id. Mehr ... | |
static uint32_t | osc_get_rate (uint8_t id) |
static bool | osc_is_ready (uint8_t id) |
static void | osc_wait_ready (uint8_t id) |
Oscillator identifiers | |
#define | OSC_ID_RC2MHZ OSC_RC2MEN_bm |
2 MHz Internal RC Oscillator | |
#define | OSC_ID_RC32MHZ OSC_RC32MEN_bm |
32 MHz Internal RC Oscillator | |
#define | OSC_ID_RC32KHZ OSC_RC32KEN_bm |
32 KHz Internal RC Oscillator | |
#define | OSC_ID_XOSC OSC_XOSCEN_bm |
External Oscillator. | |
#define | OSC_ID_USBSOF 0xff |
Reference from USB Start Of Frame. Mehr ... | |
External oscillator types | |
#define | XOSC_TYPE_EXTERNAL 0 |
External clock signal. | |
#define | XOSC_TYPE_32KHZ 2 |
32.768 kHz resonator on TOSC | |
#define | XOSC_TYPE_XTAL 3 |
0.4 to 16 MHz resonator on XTAL | |
XTAL resonator start-up cycles | |
#define | XOSC_STARTUP_256 0 |
256 cycle start-up time | |
#define | XOSC_STARTUP_1024 1 |
1 k cycle start-up time | |
#define | XOSC_STARTUP_16384 2 |
16 k cycle start-up time | |
XTAL resonator frequency range | |
#define | XOSC_RANGE_04TO2 OSC_FRQRANGE_04TO2_gc |
0.4 to 2 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 | |
#define | XOSC_RANGE_12TO16 OSC_FRQRANGE_12TO16_gc |
12 to 16 MHz frequency range | |
XMEGA-Specific Oscillator Features | |
static void | osc_enable_autocalibration (uint8_t id, uint8_t ref_id) |
Enable DFLL-based automatic calibration of an internal oscillator. Mehr ... | |
static void | osc_disable_autocalibration (uint8_t id) |
Disable DFLL-based automatic calibration of an internal oscillator. Mehr ... | |
static void | osc_user_calibration (uint8_t id, uint16_t calib) |
Load a specific calibration value for the specified oscillator. Mehr ... | |
#define OSC_ID_USBSOF 0xff |
|
inlinestatic |
Disable DFLL-based automatic calibration of an internal oscillator.
id | The ID of the oscillator for which to disable auto-calibration:
|
|
inlinestatic |
Enable DFLL-based automatic calibration of an internal oscillator.
The XMEGA features two Digital Frequency Locked Loops (DFLLs) which can be used to improve the accuracy of the 2 MHz and 32 MHz internal RC oscillators. The DFLL compares the oscillator frequency with a more accurate reference clock to do automatic run-time calibration of the oscillator.
This function enables auto-calibration for either the 2 MHz or 32 MHz internal oscillator using either the 32.768 kHz calibrated internal oscillator or an external crystal oscillator as a reference. If the latter option is used, the crystal must be connected to the TOSC pins and run at 32.768 kHz.
id | The ID of the oscillator for which to enable auto-calibration:
|
ref_id | The ID of the oscillator to use as a reference:
|
Definiert in Zeile 325 der Datei osc.h.
|
inlinestatic |
|
inlinestatic |