From b1de432cd245fd80e206b07114c18e24c5f624f1 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie <alexandre.abadie@inria.fr> Date: Sun, 28 Oct 2018 13:11:14 +0100 Subject: [PATCH] boards/common/nrf51: add common clock configuration --- boards/common/nrf51/include/cfg_clock_16_0.h | 47 ++++++++++++++++++++ boards/common/nrf51/include/cfg_clock_16_1.h | 47 ++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 boards/common/nrf51/include/cfg_clock_16_0.h create mode 100644 boards/common/nrf51/include/cfg_clock_16_1.h diff --git a/boards/common/nrf51/include/cfg_clock_16_0.h b/boards/common/nrf51/include/cfg_clock_16_0.h new file mode 100644 index 0000000000..548dca8805 --- /dev/null +++ b/boards/common/nrf51/include/cfg_clock_16_0.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2018 Inria + * + * 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 boards_common_nrf51 + * @{ + * + * @file + * @brief Common clock configuration for some nrf51 based boards + * + * @author Alexandre Abadie <alexandre.abadie@inria.fr> + */ + +#ifndef CFG_CLOCK_16_0_H +#define CFG_CLOCK_16_0_H + +#include "periph_cpu.h" + +#ifdef __cplusplus + extern "C" { +#endif + +/** + * @name Clock configuration + * + * @note The radio will not work with the internal RC oscillator! + * + * @{ + */ +#define CLOCK_HFCLK (16U) /* set to 0: internal RC oscillator + 16: 16MHz crystal + 32: 32MHz crystal */ +#define CLOCK_LFCLK (0) /* set to 0: internal RC oscillator + * 1: 32.768 kHz crystal + * 2: derived from HFCLK */ +/** @} */ + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +#endif /* CFG_CLOCK_16_0_H */ diff --git a/boards/common/nrf51/include/cfg_clock_16_1.h b/boards/common/nrf51/include/cfg_clock_16_1.h new file mode 100644 index 0000000000..4383f2a2e8 --- /dev/null +++ b/boards/common/nrf51/include/cfg_clock_16_1.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2018 Inria + * + * 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 boards_common_nrf51 + * @{ + * + * @file + * @brief Common clock configuration for some nrf51 based boards + * + * @author Alexandre Abadie <alexandre.abadie@inria.fr> + */ + +#ifndef CFG_CLOCK_16_1_H +#define CFG_CLOCK_16_1_H + +#include "periph_cpu.h" + +#ifdef __cplusplus + extern "C" { +#endif + +/** + * @name Clock configuration + * + * @note The radio will not work with the internal RC oscillator! + * + * @{ + */ +#define CLOCK_HFCLK (16U) /* set to 0: internal RC oscillator + 16: 16MHz crystal + 32: 32MHz crystal */ +#define CLOCK_LFCLK (1) /* set to 0: internal RC oscillator + * 1: 32.768 kHz crystal + * 2: derived from HFCLK */ +/** @} */ + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +#endif /* CFG_CLOCK_16_1_H */ -- GitLab