watchdog.h 733 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /*
  5. setup the watchdog
  6. */
  7. void stm32_watchdog_init(void);
  8. /*
  9. pat the dog, to prevent a reset. If not called for 1s
  10. after stm32_watchdog_init() then MCU will reset
  11. */
  12. void stm32_watchdog_pat(void);
  13. /*
  14. return true if reboot was from a watchdog reset
  15. */
  16. bool stm32_was_watchdog_reset(void);
  17. /*
  18. save the reset reason code
  19. */
  20. void stm32_watchdog_save_reason(void);
  21. /*
  22. clear reset reason code
  23. */
  24. void stm32_watchdog_clear_reason(void);
  25. /*
  26. save persistent watchdog data
  27. */
  28. void stm32_watchdog_save(const uint32_t *data, uint32_t nwords);
  29. /*
  30. load persistent watchdog data
  31. */
  32. void stm32_watchdog_load(uint32_t *data, uint32_t nwords);
  33. #ifdef __cplusplus
  34. }
  35. #endif