cmem7_wdg.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. *****************************************************************************
  3. * @file cmem7_wdg.h
  4. *
  5. * @brief CMEM7 watchdog header file
  6. *
  7. *
  8. * @version V1.0
  9. * @date 3. September 2013
  10. *
  11. * @note
  12. *
  13. *****************************************************************************
  14. * @attention
  15. *
  16. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  17. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  18. * TIME. AS A RESULT, CAPITAL-MICRO SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  19. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  20. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  21. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  22. *
  23. * <h2><center>&copy; COPYRIGHT 2013 Capital-micro </center></h2>
  24. *****************************************************************************
  25. */
  26. #ifndef __CMEM7_WDG_H
  27. #define __CMEM7_WDG_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #include "cmem7.h"
  32. #include "cmem7_conf.h"
  33. /** @defgroup WDG_INT
  34. * @{
  35. */
  36. #define WDG_INT_QUARTER 0
  37. #define WDG_INT_HALF 1
  38. #define IS_WDG_INT(INT) (((INT) == WDG_INT_QUARTER) || \
  39. ((INT) == WDG_INT_HALF))
  40. /**
  41. * @}
  42. */
  43. /** @defgroup WDG_TRIGGER_MODE
  44. * @{
  45. */
  46. #define WDG_TRIGGER_MODE_EDGE 0
  47. #define WDG_TRIGGER_MODE_LEVEL 1
  48. #define IS_WDG_TRIGGER_MODE(TRI) (((TRI) == WDG_TRIGGER_MODE_EDGE) || \
  49. ((TRI) == WDG_TRIGGER_MODE_LEVEL))
  50. /**
  51. * @}
  52. */
  53. /**
  54. * @brief Watchdog initialization
  55. * @note This function should be called at first before any other interfaces.
  56. * @param[in] trigger Watchdog interrupt trigger mode, which is a value of @ref WDG_TRIGGER_MODE
  57. * @param[in] ResetMicroSecond MicroSeconds lasts before global reset
  58. * @retval None
  59. */
  60. void WDG_Init(uint8_t trigger, uint16_t ResetMicroSecond);
  61. /**
  62. * @brief Enable or disable watchdog interrupt.
  63. * @param[in] Int interrupt mask bits, which is a value of @ref WDG_INT
  64. * @param[in] Enable The bit indicates if the specific interrupt are enable or not
  65. * @retval None
  66. */
  67. void WDG_EnableInt(uint8_t Int, BOOL Enable);
  68. /**
  69. * @brief Check the specific interrupt are set or not
  70. * @param None
  71. * @retval BOOL The bit indicates if the specific interrupt are set or not
  72. */
  73. BOOL WDG_GetIntStatus(void);
  74. /**
  75. * @brief Clear the specific interrupt
  76. * @param None
  77. * @retval None
  78. */
  79. void WDG_ClearInt(void);
  80. /**
  81. * @brief Enable or disable watchdog.
  82. * @param[in] Enable The bit indicates if watchdog is enable or not
  83. * @retval None
  84. */
  85. void WDG_Enable(BOOL Enable);
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #endif /* __CMEM7_WDG_H */