hv_vos_Task.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * @file hv_vos_Task.h
  3. * @brief Header file of task.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use ()
  10. *
  11. * @endverbatim
  12. * @author HiView SoC Software Team
  13. * @version 1.0.0
  14. * @date 2023-03-01
  15. */
  16. #ifndef _HV_VOS_TASK_H
  17. #define _HV_VOS_TASK_H
  18. VOS_EXTERN_C_BEGIN
  19. /** @defgroup VOS_TASK VOS_TASK
  20. * VOS task functions
  21. * @{
  22. */
  23. /** @brief task forward declaration */
  24. typedef struct _HV_VOS_TASK_S HV_VOS_TASK_S;
  25. /** task entry function type */
  26. typedef void (*HV_VOS_TASK_ENTRY_FN)(void *arg);
  27. typedef struct _HV_VOS_TASK_INIT_PARAMS{
  28. HV_VOS_TASK_ENTRY_FN entry;
  29. const CHAR8* name;
  30. void *arg;
  31. UINT32 stackSize;
  32. UINT32 priority;
  33. } Hv_Vos_TASK_INIT_PARAMS;
  34. /** @brief Create task
  35. * @param param pointer to task init parameters structure
  36. * @return task pointer, return NULL if create fail
  37. */
  38. HV_VOS_TASK_S *Hv_Vos_TaskInit(Hv_Vos_TASK_INIT_PARAMS *param);
  39. /** @brief Destroy task
  40. *
  41. * @param self task pointer, NULL for current task
  42. * @return result
  43. */
  44. void Hv_Vos_TaskCleanup(HV_VOS_TASK_S *self);
  45. /** @brief Start OS scheduler
  46. */
  47. void Hv_Vos_TaskStart();
  48. /** @brief yield current task
  49. */
  50. void Hv_Vos_TaskYield();
  51. /** get current task id */
  52. UINT32 Hv_Vos_TASK_CurrentTaskId();
  53. UINT32 Hv_Vos_TASK_NotifyWait(UINT32* puiValue);
  54. /** @} */ //end of group VOS_TASK
  55. BOOL Hv_Vos_TaskNotifyFromISR(HV_VOS_TASK_S *self);
  56. VOID Hv_Vos_TaskEnterCritical();
  57. VOID Hv_Vos_TaskExitCritical();
  58. VOS_EXTERN_C_END
  59. #endif