aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/NRF5/NRF52832/hal_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/NRF5/NRF52832/hal_lld.h')
-rw-r--r--os/hal/ports/NRF5/NRF52832/hal_lld.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/os/hal/ports/NRF5/NRF52832/hal_lld.h b/os/hal/ports/NRF5/NRF52832/hal_lld.h
index 24784d3..a2a8cc3 100644
--- a/os/hal/ports/NRF5/NRF52832/hal_lld.h
+++ b/os/hal/ports/NRF5/NRF52832/hal_lld.h
@@ -60,22 +60,36 @@
/*===========================================================================*/
/**
+ * @brief Select source of High Frequency Clock (HFCLK)
+ * @details Possible values for source are:
+ * 0 : 64 MHz internal oscillator (HFINT)
+ * 1 : 32 MHz external crystal oscillator (HFXO)
+ */
+#if !defined(NRF5_HFCLK_SOURCE) || defined(__DOXYGEN__)
+#define NRF5_HFCLK_SOURCE NRF5_HFCLK_HFINT
+#endif
+
+/**
* @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.
+ * 1 : External crystal
+ * 2 : Synthesized clock from High Frequency Clock (HFCLK)
+ * When crystal is not available it's preferable to use the
+ * internal RC oscillator that synthesizing the clock.
*/
#if !defined(NRF5_LFCLK_SOURCE) || defined(__DOXYGEN__)
-#define NRF5_LFCLK_SOURCE 0
+#define NRF5_LFCLK_SOURCE NRF5_LFCLK_RC
#endif
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
+#if (NRF5_HFCLK_SOURCE < 0) || (NRF5_HFCLK_SOURCE > 1)
+#error "Possible value for NRF5_HFCLK_SOURCE are HFINT=0, HFXO=1"
+#endif
+
#if (NRF5_LFCLK_SOURCE < 0) || (NRF5_LFCLK_SOURCE > 2)
#error "Possible value for NRF5_LFCLK_SOURCE are 0=RC, 1=XTAL, 2=Synth"
#endif
@@ -91,6 +105,14 @@
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
+#if 0 // moved to board.h
+#define NRF5_HFCLK_HFINT 0
+#define NRF5_HFCLK_HFXO 1
+
+#define NRF5_LFCLK_RC 0
+#define NRF5_LFCLK_XTAL 1
+#define NRF5_LFCLK_SYNTH 2
+#endif
#include "nvic.h"