summaryrefslogtreecommitdiff
path: root/c/src/lib/libbsp/arm/lpc176x/include/watchdog.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/arm/lpc176x/include/watchdog.h')
-rw-r--r--c/src/lib/libbsp/arm/lpc176x/include/watchdog.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/lpc176x/include/watchdog.h b/c/src/lib/libbsp/arm/lpc176x/include/watchdog.h
new file mode 100644
index 0000000000..241180e429
--- /dev/null
+++ b/c/src/lib/libbsp/arm/lpc176x/include/watchdog.h
@@ -0,0 +1,70 @@
+/**
+ * @file watchdog.h
+ *
+ * @ingroup lpc176x
+ *
+ * @brief API of the Watchdog driver for the lpc176x bsp in RTEMS.
+ */
+
+/*
+ * Copyright (c) 2014 Taller Technologies.
+ *
+ * @author Boretto Martin (martin.boretto@tallertechnologies.com)
+ * @author Diaz Marcos (marcos.diaz@tallertechnologies.com)
+ * @author Lenarduzzi Federico (federico.lenarduzzi@tallertechnologies.com)
+ * @author Daniel Chicco (daniel.chicco@tallertechnologies.com)
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef LIBBSP_ARM_LPC176X_WATCHDOG_H
+#define LIBBSP_ARM_LPC176X_WATCHDOG_H
+
+#include <bsp/watchdog-defs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @brief Checks if the watchdog was executed by software or not. Set when
+ * the watchdog timer times out, cleared by software.
+ *
+ * @return TRUE if the watchdog was executed.
+ * FALSE otherwise.
+ */
+bool lpc176x_been_reset_by_watchdog( void );
+
+/**
+ * @brief Resets the watchdog timer.
+ */
+void lpc176x_watchdog_reset( void );
+
+/**
+ * @brief Configures the watchdog's timer.
+ *
+ * @param tcount Timer's out value.
+ * @return RTEMS_SUCCESSFUL if the watchdog was configured successfully.
+ */
+rtems_status_code lpc176x_watchdog_config( lpc176x_microseconds tcount );
+
+/**
+ * @brief Configures the timer watchdog using interrupt.
+ *
+ * @param tcount Timer's out value.
+ * @param interrupt Interrupt to register.
+ * @return RTEMS_SUCCESSFUL if the watchdog was configured successfully
+ * with interrupts.
+ */
+rtems_status_code lpc176x_watchdog_config_with_interrupt(
+ lpc176x_wd_isr_funct interrupt,
+ lpc176x_microseconds tcount
+);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_ARM_LPC176X_WATCHDOG_H */