aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-03 13:49:06 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-03 13:49:06 +0000
commit304c76dddd3f2a84062588c434c034d83f82fa52 (patch)
treef3a86a734b76dd6b8084abe4ac0fa15447b47f3c /os/hal/include
parent69492747606d30c64b7719172d4a5ec804421b99 (diff)
downloadChibiOS-304c76dddd3f2a84062588c434c034d83f82fa52.tar.gz
ChibiOS-304c76dddd3f2a84062588c434c034d83f82fa52.tar.bz2
ChibiOS-304c76dddd3f2a84062588c434c034d83f82fa52.zip
Added watchdog driver model (WDG), to be completed and tested.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8555 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/hal.h1
-rw-r--r--os/hal/include/wdg.h89
2 files changed, 90 insertions, 0 deletions
diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h
index 9ececfe77..89ef9e08d 100644
--- a/os/hal/include/hal.h
+++ b/os/hal/include/hal.h
@@ -60,6 +60,7 @@
#include "spi.h"
#include "uart.h"
#include "usb.h"
+#include "wdg.h"
/*
* The ST driver is a special case, it is only included if the OSAL is
diff --git a/os/hal/include/wdg.h b/os/hal/include/wdg.h
new file mode 100644
index 000000000..764e0b2b1
--- /dev/null
+++ b/os/hal/include/wdg.h
@@ -0,0 +1,89 @@
+/*
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/**
+ * @file wdg.h
+ * @brief WDG Driver macros and structures.
+ *
+ * @addtogroup WDG
+ * @{
+ */
+
+#ifndef _WDG_H_
+#define _WDG_H_
+
+#if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__)
+
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Driver data structures and types. */
+/*===========================================================================*/
+
+/**
+ * @brief Driver state machine possible states.
+ */
+typedef enum {
+ WDG_UNINIT = 0, /**< Not initialized. */
+ WDG_STOP = 1, /**< Stopped. */
+ WDG_READY = 2, /**< Ready. */
+} wdgstate_t;
+
+#include "wdg_lld.h"
+
+/*===========================================================================*/
+/* Driver macros. */
+/*===========================================================================*/
+
+/**
+ * @brief Resets WDG's counter.
+ *
+ * @param[in] wdgp pointer to the @p WDGDriver object
+ *
+ * @iclass
+ */
+#define wdgResetI(wdgp) wdg_lld_reset(wdgp)
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void wdgInit(void);
+ void wdgStart(WDGDriver *wdgp, const WDGConfig * config);
+ void wdgStop(WDGDriver *wdgp);
+ void wdgReset(WDGDriver *wdgp);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HAL_USE_WDG == TRUE */
+
+#endif /* _WDG_H_ */
+
+/** @} */