aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms
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
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')
-rw-r--r--os/hal/platforms/LPC11xx/hal_lld.h46
-rw-r--r--os/hal/platforms/SPC56x/hal_lld.h2
-rw-r--r--os/hal/platforms/STM32/hal_lld.h2
-rw-r--r--os/hal/platforms/STM8/hal_lld.h5
4 files changed, 52 insertions, 3 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. */
/*===========================================================================*/
diff --git a/os/hal/platforms/SPC56x/hal_lld.h b/os/hal/platforms/SPC56x/hal_lld.h
index 47b823bf7..e34fe7e3b 100644
--- a/os/hal/platforms/SPC56x/hal_lld.h
+++ b/os/hal/platforms/SPC56x/hal_lld.h
@@ -37,7 +37,7 @@
/**
* @brief Platform name.
*/
-#define PLATFORM_NAME "SPC563M64"
+#define PLATFORM_NAME "SPC563M64"
#define RFD_DIV2 0 /**< Divide VCO frequency by 2. */
#define RFD_DIV4 1 /**< Divide VCO frequency by 4. */
diff --git a/os/hal/platforms/STM32/hal_lld.h b/os/hal/platforms/STM32/hal_lld.h
index 5b24589ee..9539ea5b1 100644
--- a/os/hal/platforms/STM32/hal_lld.h
+++ b/os/hal/platforms/STM32/hal_lld.h
@@ -47,7 +47,7 @@
/**
* @brief Platform name.
*/
-#define PLATFORM_NAME "STM32"
+#define PLATFORM_NAME "STM32"
/*===========================================================================*/
/* Driver pre-compile time settings. */
diff --git a/os/hal/platforms/STM8/hal_lld.h b/os/hal/platforms/STM8/hal_lld.h
index 6b9bf2444..aba5013b3 100644
--- a/os/hal/platforms/STM8/hal_lld.h
+++ b/os/hal/platforms/STM8/hal_lld.h
@@ -34,6 +34,11 @@
/* Driver constants. */
/*===========================================================================*/
+/**
+ * @brief Platform name.
+ */
+#define PLATFORM_NAME "STM8x"
+
#define LSICLK 128000 /**< Low speed internal clock. */
#define HSICLK 16000000 /**< High speed internal clock. */