v2.0.0
pll.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_PLL_H
8#define _HARDWARE_PLL_H
9
10#include "pico.h"
11#include "hardware/structs/pll.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
29typedef pll_hw_t *PLL;
30
31#define pll_sys pll_sys_hw
32#define pll_usb pll_usb_hw
33
34#ifndef PICO_PLL_VCO_MIN_FREQ_HZ
35#ifdef PICO_PLL_VCO_MIN_FREQ_MHZ
36#define PICO_PLL_VCO_MIN_FREQ_HZ (PICO_PLL_VCO_MIN_FREQ_MHZ * MHZ)
37#elif defined(PICO_PLL_VCO_MIN_FREQ_KHZ)
38#define PICO_PLL_VCO_MIN_FREQ_HZ (PICO_PLL_VCO_MIN_FREQ_KHZ * KHZ)
39#else
40#define PICO_PLL_VCO_MIN_FREQ_HZ (750 * MHZ)
41#endif
42#endif
43
44#ifndef PICO_PLL_VCO_MAX_FREQ_HZ
45#ifdef PICO_PLL_VCO_MAX_FREQ_MHZ
46#define PICO_PLL_VCO_MAX_FREQ_HZ (PICO_PLL_VCO_MAX_FREQ_MHZ * MHZ)
47#elif defined(PICO_PLL_VCO_MAX_FREQ_KHZ)
48#define PICO_PLL_VCO_MAX_FREQ_HZ (PICO_PLL_VCO_MAX_FREQ_KHZ * KHZ)
49#else
50#define PICO_PLL_VCO_MAX_FREQ_HZ (1600 * MHZ)
51#endif
52#endif
53
62void pll_init(PLL pll, uint ref_div, uint vco_freq, uint post_div1, uint post_div2);
63
72void pll_deinit(PLL pll);
73
82#ifndef PLL_RESET_NUM
83#define PLL_RESET_NUM(pll) ((pll_usb_hw == (pll)) ? RESET_PLL_USB : RESET_PLL_SYS)
84#endif
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif
pll_deinit
void pll_deinit(PLL pll)
Release/uninitialise specified PLL.
Definition: pll.c:73
pll_init
void pll_init(PLL pll, uint ref_div, uint vco_freq, uint post_div1, uint post_div2)
Initialise specified PLL.
Definition: pll.c:13
pico.h
pll_hw_t
Definition: pll.h:27