Loading...
Searching...
No Matches
xosc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _HARDWARE_XOSC_H
8#define _HARDWARE_XOSC_H
9
10#include "pico.h"
11#include "hardware/structs/xosc.h"
12
13// For frequency related definitions etc
14#include "hardware/clocks.h"
15
16
17// Allow lengthening startup delay to accommodate slow-starting oscillators
18
19// PICO_CONFIG: PICO_XOSC_STARTUP_DELAY_MULTIPLIER, Multiplier (from 1ms) for xosc startup delay to accommodate slow-starting oscillators, type=int, min=1, default=6, group=hardware_xosc
20#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
21#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 6
22#endif
23
24// PICO_CONFIG: PICO_XOSC_FREQ_RANGE_MAX, The maximum frequency in MHz for the XOSC to support (not required when using CMOS clock input instead of XOSC) - defining this variable is not supported on RP2040 as it only has one range, type=int, min=1, max=100, default=XOSC_HZ/MHZ, group=hardware_xosc
25#if PICO_RP2040
26#define PICO_XOSC_FREQ_RANGE_MAX 15
27#else
28#ifndef PICO_XOSC_FREQ_RANGE_MAX
29#define PICO_XOSC_FREQ_RANGE_MAX (XOSC_HZ / MHZ)
30#endif
31#endif
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
43
49void xosc_init(void);
50
56void xosc_disable(void);
57
65void xosc_dormant(void);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif
void xosc_init(void)
Initialise the crystal oscillator system.
Definition xosc.c:29
void xosc_dormant(void)
Set the crystal oscillator system to dormant.
Definition xosc.c:65
void xosc_disable(void)
Disable the Crystal oscillator.
Definition xosc.c:54