Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2018-07-17 18:34:53 +0300
committerKarl Palsson <karlp@tweak.net.au>2018-07-29 23:31:17 +0300
commit7a27795d8c60bb6914b96c2b5b84188e3d29dced (patch)
tree35f2396d21a927d280a81e82abc7d6884df905e6 /include/libopencm3/stm32/common/flash_common_idcache.h
parent2bf7eb4a0c2701d337911f8942598cb2d1759c57 (diff)
stm32: flash: pull out i/d cache support.
Copied a few times.
Diffstat (limited to 'include/libopencm3/stm32/common/flash_common_idcache.h')
-rw-r--r--include/libopencm3/stm32/common/flash_common_idcache.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/common/flash_common_idcache.h b/include/libopencm3/stm32/common/flash_common_idcache.h
new file mode 100644
index 00000000..ac4ecc96
--- /dev/null
+++ b/include/libopencm3/stm32/common/flash_common_idcache.h
@@ -0,0 +1,57 @@
+/** @addtogroup flash_defines
+ */
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * This library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This library 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <libopencm3/stm32/flash.h>
+
+/**@{*/
+#define FLASH_ACR_DCRST (1 << 12)
+#define FLASH_ACR_ICRST (1 << 11)
+#define FLASH_ACR_DCEN (1 << 10)
+#define FLASH_ACR_ICEN (1 << 9)
+
+
+BEGIN_DECLS
+
+/** Enable the data cache */
+void flash_dcache_enable(void);
+
+/** Disable the data cache */
+void flash_dcache_disable(void);
+
+/** Enable the Instruction Cache */
+void flash_icache_enable(void);
+
+/** Disable the Instruction Cache */
+void flash_icache_disable(void);
+
+/** Reset the Data Cache.
+ * The data cache must be disabled for this to have effect.
+ */
+void flash_dcache_reset(void);
+
+/** Reset the Instruction Cache.
+ * The instruction cache must be disabled for this to have effect.
+ */
+void flash_icache_reset(void);
+
+END_DECLS
+/**@}*/
+