aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/LPC11xx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-27 12:27:25 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-27 12:27:25 +0000
commit783f4514f108c28f6ab954eab601a7c6b3092ec9 (patch)
treeba4cf6860a469441bbe1109c8f6fdc55137f15e2 /os/hal/platforms/LPC11xx
parent7a16267bc37fe43785a333e63ea6ece50a28aaf0 (diff)
downloadChibiOS-783f4514f108c28f6ab954eab601a7c6b3092ec9.tar.gz
ChibiOS-783f4514f108c28f6ab954eab601a7c6b3092ec9.tar.bz2
ChibiOS-783f4514f108c28f6ab954eab601a7c6b3092ec9.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1795 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/LPC11xx')
-rw-r--r--os/hal/platforms/LPC11xx/hal_lld.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/os/hal/platforms/LPC11xx/hal_lld.h b/os/hal/platforms/LPC11xx/hal_lld.h
index ab7a637e6..c1105992f 100644
--- a/os/hal/platforms/LPC11xx/hal_lld.h
+++ b/os/hal/platforms/LPC11xx/hal_lld.h
@@ -38,16 +38,60 @@
/**
* @brief Platform name.
*/
-#define PLATFORM_NAME "LPC11xx"
+#define PLATFORM_NAME "LPC11xx"
+
+#define IRCOSCCLK 12000000 /**< High speed internal clock. */
+
+#define SYSPLLCLKSEL_IRCOCS 0 /**< Internal RC oscillator
+ clock source. */
+#define SYSPLLCLKSEL_SYSOSC 1 /**< System oscillator clock
+ source. */
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
+/**
+ * @brief System PLL clock source.
+ */
+#if !defined(LPC11xx_SYSPLL_SOURCE) || defined(__DOXYGEN__)
+#define LPC11xx_SYSPLLCLKSEL SYSPLLCLKSEL_SYSOSC
+#endif
+
+/**
+ * @brief System PLL multiplier.
+ * @note The value must be in the 1..32 range and the final frequency
+ * must not exceed the CCO ratings.
+ */
+#if !defined(LPC11xx_SYSPLL_MUL) || defined(__DOXYGEN__)
+#define LPC11xx_SYSPLL_MUL 16
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
+#if LPC11xx_SYSPLLCLKSEL == SYSPLLCLKSEL_SYSOSC
+#define LPC11xx_SYSPLLCLKIN SYSOSCCLK
+#elif LPC11xx_SYSPLLCLKSEL == SYSPLLCLKSEL_IRCOCS
+#define LPC11xx_SYSPLLCLKIN IRCOSCCLK
+#else
+#error "invalid LPC11xx_SYSPLLCLKSEL clock source specified"
+#endif
+
+#if (LPC11xx_SYSPLL_MUL < 1) || (LPC11xx_SYSPLL_MUL > 32)
+#error "LPC11xx_SYSPLL_MUL out of range (1...32)"
+#endif
+
+/**
+ * @brief PLL output clock.
+ */
+#define LPC11xx_SYSPLLCLKOUT (LPC11xx_SYSPLLCLKIN * LPC11xx_SYSPLL_MUL)
+
+#if (LPC11xx_SYSPLLCLKOUT < 156000000) || (LPC11xx_SYSPLLCLKOUT > 320000000)
+#error "CCO frequency out of the acceptable range (156...320)"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/