aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorUwe Hermann2010-12-30 23:21:53 +0100
committerUwe Hermann2010-12-30 23:21:53 +0100
commit62f1bab21f76e17290a897e060e9218e28140786 (patch)
tree9a334f02bebd36dc11eec5a1d5126ae84a6b112d /include
parent62acc424e15ae11305f42e3f589bada9f68f72f9 (diff)
Start adding FSMC #defines (FSMC_BCRx for now).
Diffstat (limited to 'include')
-rw-r--r--include/stm32/fsmc.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/include/stm32/fsmc.h b/include/stm32/fsmc.h
new file mode 100644
index 0000000..e4d3e9c
--- /dev/null
+++ b/include/stm32/fsmc.h
@@ -0,0 +1,100 @@
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBOPENSTM32_FSMC_H
+#define LIBOPENSTM32_FSMC_H
+
+#include <stm32/memorymap.h>
+#include <cm3/common.h>
+
+/* --- Convenience macros -------------------------------------------------- */
+
+/* TODO */
+
+/* --- FMSC registers ------------------------------------------------------ */
+
+/* TODO */
+
+/* SRAM/NOR-Flash chip-select control registers 1..4 (FSMC_BCRx) */
+
+/* SRAM/NOR-Flash chip-select timing registers 1..4 (FSMC_BTRx) */
+
+/* SRAM/NOR-Flash write timing registers 1..4 (FSMC_BWTRx) */
+
+/* PC Card/NAND Flash control registers 2..4 (FSMC_PCRx) */
+
+/* FIFO status and interrupt registers 2..4 (FSMC_SRx) */
+
+/* Common memory space timing registers 2..4 (FSMC_PMEMx) */
+
+/* Attribute memory space timing registers 2..4 (FSMC_PATTx) */
+
+/* I/O space timing register 4 (FSMC_PIO4) */
+
+/* ECC result registers 2/3 (FSMC_ECCRx) */
+
+/* --- FSMC_BCRx values ---------------------------------------------------- */
+
+/* CBURSTRW: Write burst enable */
+#define FSMC_BCR_CBURSTRW (1 << 19)
+
+/* Bits 18..16: Reserved. */
+
+/* ASYNCWAIT: Wait signal during asynchronous transfers */
+#define FSMC_BCR_ASYNCWAIT (1 << 15)
+
+/* EXTMOD: Extended mode enable */
+#define FSMC_BCR_EXTMOD (1 << 14)
+
+/* WAITEN: Wait enable bit */
+#define FSMC_BCR_WAITEN (1 << 13)
+
+/* WREN: Write enable bit */
+#define FSMC_BCR_WREN (1 << 12)
+
+/* WAITCFG: Wait timing configuration */
+#define FSMC_BCR_WAITCFG (1 << 11)
+
+/* WRAPMOD: Wrapped burst mode support */
+#define FSMC_BCR_WRAPMOD (1 << 10)
+
+/* WAITPOL: Wait signal polarity bit */
+#define FSMC_BCR_WAITPOL (1 << 9)
+
+/* BURSTEN: Burst enable bit */
+#define FSMC_BCR_BURSTEN (1 << 8)
+
+/* Bit 7: Reserved. */
+
+/* FACCEN: Flash access enable */
+#define FSMC_BCR_FACCEN (1 << 6)
+
+/* MWID[5:4]: Memory databus width */
+#define FSMC_BCR_MWID (1 << 4)
+
+/* MTYP[3:2]: Memory type */
+#define FSMC_BCR_MTYP (1 << 2)
+
+/* MUXEN: Address/data multiplexing enable bit */
+#define FSMC_BCR_MUXEN (1 << 1)
+
+/* MBKEN: Memory bank enable bit */
+#define FSMC_BCR_MBKEN (1 << 0)
+
+#endif