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 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 /** \file hardware/xosc.h 18 * \defgroup hardware_xosc hardware_xosc 19 * 20 * Crystal Oscillator (XOSC) API 21 */ 22 23 /*! \brief Initialise the crystal oscillator system 24 * \ingroup hardware_xosc 25 * 26 * This function will block until the crystal oscillator has stabilised. 27 **/ 28 void xosc_init(void); 29 30 /*! \brief Disable the Crystal oscillator 31 * \ingroup hardware_xosc 32 * 33 * Turns off the crystal oscillator source, and waits for it to become unstable 34 **/ 35 void xosc_disable(void); 36 37 /*! \brief Set the crystal oscillator system to dormant 38 * \ingroup hardware_xosc 39 * 40 * Turns off the crystal oscillator until it is woken by an interrupt. This will block and hence 41 * the entire system will stop, until an interrupt wakes it up. This function will 42 * continue to block until the oscillator becomes stable after its wakeup. 43 **/ 44 void xosc_dormant(void); 45 46 #ifdef __cplusplus 47 } 48 #endif 49 50 #endif 51