task_wdt_manager.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2018 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file task wdt manager interface
  8. */
  9. #ifndef __TASK_WDT_MANAGER_H__
  10. #define __TASK_WDT_MANAGER_H__
  11. #include <os_common_api.h>
  12. #include <task_wdt/task_wdt.h>
  13. /**
  14. * @brief task_wdt_manager_init
  15. *
  16. * This routine task_wdt_manager_init
  17. *
  18. * @return true init success
  19. * @return false init failed
  20. */
  21. int task_wdt_manager_init(void);
  22. /**
  23. * @brief start task wdt for current task
  24. *
  25. * This routine add on soft task wdt for current task
  26. *
  27. * @param reload_period the period for task wdt
  28. *
  29. * @retval channel_id If successful, a non-negative value indicating the index
  30. * of the channel to which the timeout was assigned. This
  31. * ID is supposed to be used as the parameter in calls to
  32. * task_wdt_feed().
  33. * @retval -EINVAL If the reload_period is invalid.
  34. * @retval -ENOMEM If no more timeouts can be installed.
  35. */
  36. int task_wdt_start(uint32_t reload_period);
  37. /**
  38. * @brief Delete task watchdog channel for current task.
  39. *
  40. * Deletes the current task's wdt channel from the list of task watchdog channels. The
  41. * channel is now available again for other tasks via task_wdt_add() function.
  42. *
  43. * @retval 0 If successful.
  44. * @retval -EINVAL If there is no installed timeout for supplied channel.
  45. */
  46. int task_wdt_stop(void);
  47. /**
  48. * @brief Feed the current task's watchdog channel for current task.
  49. *
  50. * This function loops through all installed task watchdogs and updates the
  51. * internal kernel timer used as for the software watchdog with the next due
  52. * timeout.
  53. *
  54. * @retval 0 If successful.
  55. * @retval -EINVAL If there is no installed timeout for supplied channel.
  56. */
  57. int task_wdt_user_feed(void);
  58. #endif