hv_mw_SystemManager.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /**
  2. * @file hv_mw_SystemManager.h
  3. * @brief Header file of SystemManager module.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use hv_mw_SystemManager(...) s a task function handle.
  10. *
  11. * @endverbatim
  12. *
  13. * @author HiView SoC Software Team
  14. * @version 1.0.0
  15. * @date 2022-08-10
  16. */
  17. #ifndef __SDK_MIDDLEWARE_RUNTIME_SYSTEM_MANAGER_INC_SYSTEM_MANAGER_H__
  18. #define __SDK_MIDDLEWARE_RUNTIME_SYSTEM_MANAGER_INC_SYSTEM_MANAGER_H__
  19. #include "hv_comm_DataType.h"
  20. #include "hv_comm_Define.h"
  21. #include "hv_vos_Comm.h"
  22. typedef struct _SystemManager
  23. {
  24. HV_VOS_QUEUE_S* xSystemQueue; /*系统主任务接收消息队列,用于接受其他任务、中断发送给System任务的消息*/
  25. HV_VOS_QUEUE_S* xOsdQueue; /*OSD任务接收消息队列,用于接受其他任务、中断发送给OSD任务的消息*/
  26. HV_VOS_QUEUE_S* xEventHubQueue; /*EventHub任务接收消息队列,用于接受其他任务、中断发送给EventHub任务的消息*/
  27. HV_VOS_QUEUE_S* xUrgentQueue; /*Urgent任务接收消息队列,用于接受其他任务、中断发送给Urgent任务的消息*/
  28. #ifdef CONFIG_USER_TYPE_C_ON
  29. HV_VOS_QUEUE_S* xTypecQueue; /*Type-c任务接收消息队列,用于接受发送给Type-c任务的消息*/
  30. #endif
  31. #ifdef CONFIG_USER_USB_OTA_ON
  32. HV_VOS_QUEUE_S* xUsbQueue; /*USB任务接收消息队列,用于接受发送给USB任务的消息*/
  33. #endif
  34. HV_VOS_TASK_S* xAmbLightTaskHandle;/*AmbLight任务接收句柄*/
  35. HV_VOS_TASK_S* xUrgentTaskHandle; /*Urgent任务接收句柄*/
  36. HV_VOS_TASK_S* xShellTaskHandle; /*Cli Shell任务接收句柄*/
  37. HV_TIMER_S* pstDatabaseSyncTimer;/*Database and flash data sync timer,同步全局userdata数据到eeprom或者flash*/
  38. }SystemManager;
  39. /**
  40. * @brief system main init.
  41. * @param[in] None.
  42. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  43. */
  44. Status Hv_Mw_System_Init( VOID );
  45. /**
  46. * @brief create all module task,include eventhubtask systemtask osdtask ...and so on.
  47. * @param[in] None.
  48. * @return none.
  49. */
  50. VOID Hv_Mw_System_TaskCreate( VOID );
  51. /**
  52. * @brief create all module Queue,include eventhubQueue OsdQueue systemtaskQueue ...and so on.
  53. * @param[in] None.
  54. * @return none.
  55. */
  56. VOID Hv_Mw_System_AllMessageQueueCreate( VOID );
  57. /**
  58. * @brief 返回系统接收消息队列.
  59. * @param[in] None.
  60. * @return the point of systemQueue.
  61. */
  62. HV_VOS_QUEUE_S* Hv_Mw_System_GetSystemQueue( VOID );
  63. /**
  64. * @brief 返回OSD接收消息队列.
  65. * @param[in] None.
  66. * @return the point of OsdQueue.
  67. */
  68. HV_VOS_QUEUE_S* Hv_Mw_System_GetOsdQueue( VOID );
  69. #ifdef CONFIG_USER_TYPE_C_ON
  70. /**
  71. * @brief 返回Type-c接收消息队列.
  72. * @param[in] None.
  73. * @return the point of TypecQueue.
  74. */
  75. HV_VOS_QUEUE_S* Hv_Mw_System_GetTypecQueue( VOID );
  76. #endif
  77. #ifdef CONFIG_USER_USB_OTA_ON
  78. /**
  79. * @brief 返回USB接收消息队列.
  80. * @param[in] None.
  81. * @return the pointer of UsbQueue.
  82. */
  83. HV_VOS_QUEUE_S* Hv_Mw_System_GetUsbQueue( VOID );
  84. #endif
  85. /**
  86. * @brief 返回EventHub接收消息队列.
  87. * @param[in] None.
  88. * @return the point of EventHubQueue.
  89. */
  90. HV_VOS_QUEUE_S* Hv_Mw_System_GetEventHubQueue( VOID );
  91. /**
  92. * @brief 返回Urgent接收消息队列.
  93. * @param[in] None.
  94. * @return the point of UrgentQueue.
  95. */
  96. HV_VOS_QUEUE_S* Hv_Mw_System_GetUrgentQueue( VOID );
  97. /**
  98. * @brief SystemTask启动后在for循环前仅运行一次的初始化函数接口.
  99. * @param[in] None.
  100. * @return none.
  101. */
  102. VOID Hv_Mw_System_TaskStartInit( VOID );
  103. /**
  104. * @brief SystemTask入口函数.
  105. * @param[in] unused.
  106. * @return none.
  107. */
  108. VOID Hv_Mw_System_TaskHandle( VOID *arg );
  109. /**
  110. * @brief Urgent task任务句柄.
  111. * @param[in] None.
  112. * @return Urgent task任务句柄指针.
  113. */
  114. HV_VOS_TASK_S* Hv_Mw_System_UrgentTaskHandle( VOID );
  115. /**
  116. * @brief shell task任务句柄.
  117. * @param[in] None.
  118. * @return shell task任务句柄指针.
  119. */
  120. #ifdef HV_SCALER_DEBUG_VERSION
  121. HV_VOS_TASK_S* Hv_Mw_System_ShellTaskHandle( VOID );
  122. #endif
  123. /**
  124. * @brief 系统启动函数,包含任务启动函数,全局中断使能.
  125. * @param[in] None.
  126. * @return none.
  127. */
  128. VOID Hv_Mw_System_TaskAndIrqEnable( VOID );
  129. /**
  130. * @brief 设置Database同步定时器启动和停止.
  131. * @param[in] bEn.
  132. * @return none.
  133. */
  134. VOID Hv_Mw_System_SetDatabaseSyncTimerEnable(BOOL bEn);
  135. #endif