summaryrefslogtreecommitdiff
path: root/nuttx/configs/twr-k60n512/include/board.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-21 16:00:32 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-08-21 16:00:32 +0000
commit34c92a52d1e6627683300ff150445a326fd154a5 (patch)
tree0919fdeedd17e254834ff0f3234e810e18ad592f /nuttx/configs/twr-k60n512/include/board.h
parent7acd0fe5cf0c8d2e913219b27bc95049d50cf2c6 (diff)
downloadpx4-nuttx-34c92a52d1e6627683300ff150445a326fd154a5.tar.gz
px4-nuttx-34c92a52d1e6627683300ff150445a326fd154a5.tar.bz2
px4-nuttx-34c92a52d1e6627683300ff150445a326fd154a5.zip
Very initial SDHC driver for Kinetis parts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3901 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/twr-k60n512/include/board.h')
-rwxr-xr-xnuttx/configs/twr-k60n512/include/board.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/nuttx/configs/twr-k60n512/include/board.h b/nuttx/configs/twr-k60n512/include/board.h
index 9de17ef7a..bea58470c 100755
--- a/nuttx/configs/twr-k60n512/include/board.h
+++ b/nuttx/configs/twr-k60n512/include/board.h
@@ -85,6 +85,36 @@
#define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3)
#define BOARD_FLASHCLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV4)
+/* SDHC clocking ********************************************************************/
+
+/* SDCLK configurations corresponding to various modes of operation. Formula is:
+ *
+ * SDCLK frequency = (base clock) / (prescaler * divisor)
+ *
+ * The SDHC module is always configure configured so that the core clock is the base
+ * clock.
+ */
+
+/* Identification mode: 400KHz = 96MHz / ( 16 * 15) */
+
+#define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
+#define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
+
+/* MMC normal mode: 16MHz = 96MHz / (2 * 3) */
+
+#define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
+#define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
+
+/* SD normal mode (1-bit): 16MHz = 96MHz / (2 * 3) */
+
+#define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
+#define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
+
+/* SD normal mode (4-bit): 24MHz = 96MHz / (2 * 2) */
+
+#define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
+#define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
+
/* LED definitions ******************************************************************/
/* The TWR-K60N512 has four LEDs:
*