yc_wdt.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. ******************************************************************************
  3. * @file yc_wdt.h
  4. * @author Yichip
  5. * @version V1.0
  6. * @date 7-Dec-2019
  7. * @brief watchdog encapsulation.
  8. *
  9. ******************************************************************************
  10. */
  11. #ifndef __YC_WDT_H__
  12. #define __YC_WDT_H__
  13. #include "yc3121.h"
  14. /**
  15. * @brief timer number Structure definition
  16. */
  17. typedef enum
  18. {
  19. WDT_CPUReset = 0,
  20. WDT_Interrupt,
  21. } WDT_ModeTypeDef;
  22. #define ISWDTRELOAD(load) (load>0&&load<=0x1f)
  23. /**
  24. * @brief Set reload counter
  25. * @param Reload: Reload counter equal to 2^reload.
  26. * @retval none
  27. */
  28. void WDT_SetReload(uint32_t Reload);
  29. /**
  30. * @brief Set WDT mode
  31. * @param WDT_Mode : Select the following values :
  32. * WDT_CPUReset
  33. * WDT_Interrupt.
  34. * @retval none
  35. * @description If Select WDT_CPUReset Mode,the bit for WDT RESET will be set;if
  36. * Select WDT_Interrupt the bit for WDT RESET will
  37. */
  38. void WDT_ModeConfig(WDT_ModeTypeDef WDT_Mode);
  39. /**
  40. * @brief Get interrupt Status
  41. * @param none
  42. * @retval SET:interrupt ocuured.
  43. */
  44. ITStatus WDT_GetITStatus(void);
  45. /**
  46. * @brief Clear interrupt
  47. * @param none
  48. * @retval none
  49. */
  50. void WDT_ClearITPendingBit(void);
  51. /**
  52. * @brief Enable WDT
  53. * @param none
  54. * @retval none
  55. */
  56. void WDT_Enable(void);
  57. /**
  58. * @brief Feed the watchdog function
  59. * @param none
  60. * @retval none
  61. */
  62. void WDT_ReloadCounter(void);
  63. #endif /*__YC_WDT_H__*/