srv_wdt.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _SRV_WDT_H_
  13. #define _SRV_WDT_H_
  14. #include "osi_compiler.h"
  15. OSI_EXTERN_C_BEGIN
  16. #include "srv_config.h"
  17. #include <stdint.h>
  18. #include <stdbool.h>
  19. #include <stddef.h>
  20. /**
  21. * \brief service start watchdog
  22. *
  23. * \param max_interval_ms max interval before re-feed the watchdog
  24. * \param feed_interval_ms normal interval to feed the watchdog
  25. * \return true on succeed else false
  26. */
  27. bool srvWdtInit(uint32_t max_interval_ms, uint32_t feed_interval_ms);
  28. /**
  29. * \brief start watchdog
  30. * \return true on succeed else false
  31. */
  32. bool srvWdtStart();
  33. /**
  34. * \brief stop watchdog
  35. */
  36. void srvWdtStop();
  37. /**
  38. * @brief Reset watch dog when entering deep sleep
  39. *
  40. * @param reset_ms set the next feed time of the watchdog
  41. */
  42. void srvWdtEnterDeepSleep(int64_t reset_ms);
  43. /**
  44. * @brief Reset watch dog when exit from deep sleep
  45. *
  46. */
  47. void srvWdtExitDeepSleep(void);
  48. OSI_EXTERN_C_END
  49. #endif