lib_wdt.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. ******************************************************************************
  3. * @file lib_wdt.h
  4. * @author Application Team
  5. * @version V4.4.0
  6. * @date 2018-09-27
  7. * @brief WDT library.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. ******************************************************************************
  12. */
  13. #ifndef __LIB_WDT_H
  14. #define __LIB_WDT_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "target.h"
  19. #define WDT_2_SECS PMU_WDTEN_WDTSEL_0
  20. #define WDT_1_SECS PMU_WDTEN_WDTSEL_1
  21. #define WDT_0_5_SECS PMU_WDTEN_WDTSEL_2
  22. #define WDT_0_25_SECS PMU_WDTEN_WDTSEL_3
  23. /* Private macros ------------------------------------------------------------*/
  24. #define IS_WDT_PERIOD(__PERIOD__) (((__PERIOD__) == WDT_2_SECS) ||\
  25. ((__PERIOD__) == WDT_1_SECS) ||\
  26. ((__PERIOD__) == WDT_0_5_SECS) ||\
  27. ((__PERIOD__) == WDT_0_25_SECS))
  28. /* Exported Functions ------------------------------------------------------- */
  29. void WDT_Enable(void);
  30. void WDT_Disable(void);
  31. void WDT_Clear(void);
  32. void WDT_SetPeriod(uint32_t period);
  33. uint16_t WDT_GetCounterValue(void);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* __LIB_WDT_H */
  38. /*********************************** END OF FILE ******************************/