mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
74 lines
1.7 KiB
C
74 lines
1.7 KiB
C
/*
|
|
* Copyright (C) 2017 Freie Universität Berlin
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
* directory for more details.
|
|
*/
|
|
|
|
/**
|
|
* @ingroup cpu_nrf5x_common
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief nRF5x shared functions for configuration the system clocks
|
|
*
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
*/
|
|
|
|
#ifndef NRF_CLOCK_H
|
|
#define NRF_CLOCK_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief The high frequency clock (HFCLK) uses the internal oscillator per
|
|
* default. Setting this define to 1 will enable the HFXO clock source
|
|
* on boot so it will always be active.
|
|
*/
|
|
#ifndef CLOCK_HFXO_ONBOOT
|
|
#define CLOCK_HFXO_ONBOOT 0
|
|
#endif
|
|
|
|
/**
|
|
* @brief Initialize the high frequency clock (HFCLK) as configured in the
|
|
* board's periph_conf.h
|
|
*/
|
|
void clock_init_hf(void);
|
|
|
|
/**
|
|
* @brief Request the external high frequency crystal (HFXO) as HF clock
|
|
* source. If this is the first request, the HFXO will be enabled.
|
|
*/
|
|
void clock_hfxo_request(void);
|
|
|
|
/**
|
|
* @brief Release the use of the HFXO. If this was the last active request,
|
|
* the HFXO will be disabled
|
|
*/
|
|
void clock_hfxo_release(void);
|
|
|
|
/**
|
|
* @brief Start the low frequency clock (LFCLK) as configured in the board's
|
|
* periph_conf.
|
|
*
|
|
* Calling this function while the LFCLK is already running will have no effect.
|
|
*/
|
|
void clock_start_lf(void);
|
|
|
|
/**
|
|
* @brief Stop the low frequency clock (LFCLK)
|
|
*
|
|
* @note Be sure that no module is using the LFCLK before you shut it down!
|
|
*/
|
|
void clock_stop_lf(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* NRF_CLOCK_H */
|
|
/** @} */
|