Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:03

0001 /**
0002  * @file
0003  *
0004  * @ingroup RTEMSBSPsARMLPC176X
0005  *
0006  * @brief API of the Watchdog driver for the lpc176x bsp in RTEMS.
0007  */
0008 
0009 /*
0010  * Copyright (c) 2014 Taller Technologies.
0011  *
0012  * @author  Boretto Martin    (martin.boretto@tallertechnologies.com)
0013  * @author  Diaz Marcos (marcos.diaz@tallertechnologies.com)
0014  * @author  Lenarduzzi Federico  (federico.lenarduzzi@tallertechnologies.com)
0015  * @author  Daniel Chicco  (daniel.chicco@tallertechnologies.com)
0016  *
0017  * The license and distribution terms for this file may be
0018  * found in the file LICENSE in this distribution or at
0019  * http://www.rtems.org/license/LICENSE.
0020  */
0021 
0022 #ifndef LIBBSP_ARM_LPC176X_WATCHDOG_H
0023 #define LIBBSP_ARM_LPC176X_WATCHDOG_H
0024 
0025 #include <bsp/watchdog-defs.h>
0026 
0027 #ifdef __cplusplus
0028 extern "C" {
0029 #endif /* __cplusplus */
0030 
0031 /**
0032  * @brief Checks if the watchdog was executed by software or not. Set when
0033  *        the watchdog timer times out, cleared by software.
0034  *
0035  * @return TRUE if the watchdog was executed.
0036  *         FALSE otherwise.
0037  */
0038 bool lpc176x_been_reset_by_watchdog( void );
0039 
0040 /**
0041  * @brief Resets the watchdog timer.
0042  */
0043 void lpc176x_watchdog_reset( void );
0044 
0045 /**
0046  * @brief Configures the watchdog's timer.
0047  *
0048  * @param tcount Timer's out value.
0049  * @return RTEMS_SUCCESSFUL if the watchdog was configured successfully.
0050  */
0051 rtems_status_code lpc176x_watchdog_config( lpc176x_microseconds tcount );
0052 
0053 /**
0054  * @brief Configures the timer watchdog using interrupt.
0055  *
0056  * @param tcount Timer's out value.
0057  * @param interrupt Interrupt to register.
0058  * @return RTEMS_SUCCESSFUL if the watchdog was configured successfully
0059  *                          with interrupts.
0060  */
0061 rtems_status_code lpc176x_watchdog_config_with_interrupt(
0062   lpc176x_wd_isr_funct interrupt,
0063   lpc176x_microseconds tcount
0064 );
0065 
0066 #ifdef __cplusplus
0067 }
0068 #endif /* __cplusplus */
0069 
0070 #endif  /* LIBBSP_ARM_LPC176X_WATCHDOG_H */