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:
authorGuillaume Revaillot <revaillot@archos.com>2018-03-28 14:34:51 +0300
committerKarl Palsson <karlp@etactica.com>2018-03-28 16:06:57 +0300
commit207eb07d4c0c6a05fbcbfa289f232ba5667ec278 (patch)
treef40b3ce5af48b4a9c89cb6e24d2c13b5ed15db61 /include/libopencm3/stm32/common/iwdg_common_v2.h
parentf63090d9b6f8b6c106628973d09cdf708e28d565 (diff)
stm32: centralize additionnal iwdg window register definition into iwdg-v2.
stm32f0, l3, l4 are currently sharing the same duplicated header, and stm32l0 uses the same peripheral. Stop copy-pasting stuff and centralize definitions into a iwdg_common_v2.h header.
Diffstat (limited to 'include/libopencm3/stm32/common/iwdg_common_v2.h')
-rw-r--r--include/libopencm3/stm32/common/iwdg_common_v2.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/common/iwdg_common_v2.h b/include/libopencm3/stm32/common/iwdg_common_v2.h
new file mode 100644
index 00000000..5c111624
--- /dev/null
+++ b/include/libopencm3/stm32/common/iwdg_common_v2.h
@@ -0,0 +1,82 @@
+/** @addtogroup iwdg_defines
+
+ @author @htmlonly &copy; @endhtmlonly 2018 Guillame Revaillot <revaillot@archos.com>
+
+ */
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2018 Guillaume Revaillot <revaillot@archos.com>
+ * Copyright (C) 2010 Thomas Otto <tommi@viadmin.org>
+ *
+ * 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/>.
+ */
+
+/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA IWDG.H
+The order of header inclusion is important. iwdg.h includes the device
+specific memorymap.h header before including this header file.*/
+
+/** @cond */
+#ifdef LIBOPENCM3_IWDG_H
+/** @endcond */
+#pragma once
+
+/**@{*/
+
+#include <libopencm3/stm32/common/iwdg_common_all.h>
+
+/*****************************************************************************/
+/* Module definitions */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* Register definitions */
+/*****************************************************************************/
+
+/* Key Register (IWDG_WINR) */
+#define IWDG_WINR MMIO32(IWDG_BASE + 0x10)
+
+/*****************************************************************************/
+/* Register values */
+/*****************************************************************************/
+/** @{*/
+
+/* --- IWDG_SR values ------------------------------------------------------ */
+
+/* WVU: Watchdog counter window value update */
+#define IWDG_SR_WVU (1 << 2)
+
+/**@}*/
+
+/*****************************************************************************/
+/* API definitions */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* API Functions */
+/*****************************************************************************/
+
+
+BEGIN_DECLS
+
+END_DECLS
+
+/**@}*/
+
+/** @cond */
+#else
+#warning "iwdg_common_v2.h should not be included explicitly, only via iwdg.h"
+#endif
+/** @endcond */
+