cmem7_wdg.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 Deinitializes the Watchdog peripheral registers to their default reset values.
  55. * @param[in] None
  56. * @retval None
  57. */
  58. void WDG_DeInit(void);
  59. /**
  60. * @brief Watchdog initialization
  61. * @note This function should be called at first before any other interfaces.
  62. * @param[in] trigger Watchdog interrupt trigger mode, which is a value of @ref WDG_TRIGGER_MODE
  63. * @param[in] ResetMillSecond MillSeconds lasts before global reset
  64. * @retval None
  65. */
  66. void WDG_Init(uint8_t trigger, uint16_t ResetMillSecond);
  67. /**
  68. * @brief Enable or disable watchdog interrupt.
  69. * @param[in] Int interrupt mask bits, which is a value of @ref WDG_INT
  70. * @param[in] Enable The bit indicates if the specific interrupt are enable or not
  71. * @retval None
  72. */
  73. void WDG_ITConfig(uint8_t Int, BOOL Enable);
  74. /**
  75. * @brief Check the specific interrupt are set or not
  76. * @param None
  77. * @retval BOOL The bit indicates if the specific interrupt are set or not
  78. */
  79. BOOL WDG_GetITStatus(void);
  80. /**
  81. * @brief Clear the specific interrupt
  82. * @param None
  83. * @retval None
  84. */
  85. void WDG_ClearITPendingBit(void);
  86. /**
  87. * @brief Enable or disable watchdog.
  88. * @param[in] Enable The bit indicates if watchdog is enable or not
  89. * @retval None
  90. */
  91. void WDG_Cmd(BOOL Enable);
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95. #endif /* __CMEM7_WDG_H */