From a3a0be11dc5a81a36fb2b36b37780ea5d733d9fe Mon Sep 17 00:00:00 2001 From: Stephane D'Alu Date: Fri, 5 Feb 2016 18:58:31 +0100 Subject: moved from HFCLK TIMER to RTC LFCLK --- os/hal/ports/NRF51/NRF51822/hal_lld.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'os/hal/ports/NRF51/NRF51822/hal_lld.h') diff --git a/os/hal/ports/NRF51/NRF51822/hal_lld.h b/os/hal/ports/NRF51/NRF51822/hal_lld.h index 1cc9057..b685667 100644 --- a/os/hal/ports/NRF51/NRF51822/hal_lld.h +++ b/os/hal/ports/NRF51/NRF51822/hal_lld.h @@ -44,9 +44,11 @@ /*===========================================================================*/ /*===========================================================================*/ -/* Derived constants and error checks. */ +/* Driver constants and error checks. */ /*===========================================================================*/ +#define NRF51_LFCLK_FREQUENCY 32768 + /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ -- cgit v1.2.3 From 8fe62a0f907639db23f14d17a45a7970854f1d22 Mon Sep 17 00:00:00 2001 From: Stephane D'Alu Date: Fri, 5 Feb 2016 23:54:23 +0100 Subject: use mcuconf.h with NRF51_SYSTEM_TICKS to select the timer source (TIMER or RTC) --- os/hal/ports/NRF51/NRF51822/hal_lld.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'os/hal/ports/NRF51/NRF51822/hal_lld.h') diff --git a/os/hal/ports/NRF51/NRF51822/hal_lld.h b/os/hal/ports/NRF51/NRF51822/hal_lld.h index b685667..24eff21 100644 --- a/os/hal/ports/NRF51/NRF51822/hal_lld.h +++ b/os/hal/ports/NRF51/NRF51822/hal_lld.h @@ -39,15 +39,35 @@ * @} */ +/** + * @brief Frequency valuefor the Low Frequency Clock + */ +#define NRF51_LFCLK_FREQUENCY 32768 + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief Select source of Low Frequency Clock (LFCLK) + * @details Possible values for source are: + * 0 : RC oscillator + * 1 : External cristal + * 2 : Synthetized clock from High Frequency Clock (HFCLK) + * When cristal is not available it's preferable to use the + * internal RC oscillator that synthezing the clock. + */ +#if !defined(NRF51_LFCLK_SOURCE) || defined(__DOXYGEN__) +#define NRF51_LFCLK_SOURCE 0 +#endif + /*===========================================================================*/ -/* Driver constants and error checks. */ +/* Derived constants and error checks. */ /*===========================================================================*/ -#define NRF51_LFCLK_FREQUENCY 32768 +#if (NRF51_LFCLK_SOURCE < 0) || (NRF51_LFCLK_SOURCE > 2) +#error "Possible value for NRF51_LFCLK_SOURCE are 0=RC, 1=XTAL, 2=Synth" +#endif /*===========================================================================*/ /* Driver data structures and types. */ -- cgit v1.2.3