hv_mw_SystemManager.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. #if (defined(CONFIG_USER_USB_OTA_ON) || defined(CONFIG_USER_USB_BILLBOARD_ON) || defined(CONFIG_USER_USB_HID_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. #if (HV_PROJECT_CONFIG_SMART_POWER == HV_CONFIG_ON)
  39. HV_TIMER_S* pstPowerLoadCheckTimer;/*周期性检测SDR和ucBrightness的大小*/
  40. #endif
  41. }SystemManager;
  42. /**
  43. * @brief system main init.
  44. * @param[in] None.
  45. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  46. */
  47. Status Hv_Mw_System_Init( VOID );
  48. /**
  49. * @brief create all module task,include eventhubtask systemtask osdtask ...and so on.
  50. * @param[in] None.
  51. * @return none.
  52. */
  53. VOID Hv_Mw_System_TaskCreate( VOID );
  54. /**
  55. * @brief create all module Queue,include eventhubQueue OsdQueue systemtaskQueue ...and so on.
  56. * @param[in] None.
  57. * @return none.
  58. */
  59. VOID Hv_Mw_System_AllMessageQueueCreate( VOID );
  60. /**
  61. * @brief 返回系统接收消息队列.
  62. * @param[in] None.
  63. * @return the point of systemQueue.
  64. */
  65. HV_VOS_QUEUE_S* Hv_Mw_System_GetSystemQueue( VOID );
  66. /**
  67. * @brief 返回OSD接收消息队列.
  68. * @param[in] None.
  69. * @return the point of OsdQueue.
  70. */
  71. HV_VOS_QUEUE_S* Hv_Mw_System_GetOsdQueue( VOID );
  72. #ifdef CONFIG_USER_TYPE_C_ON
  73. /**
  74. * @brief 返回Type-c接收消息队列.
  75. * @param[in] None.
  76. * @return the point of TypecQueue.
  77. */
  78. HV_VOS_QUEUE_S* Hv_Mw_System_GetTypecQueue( VOID );
  79. #endif
  80. #if (defined(CONFIG_USER_USB_OTA_ON) || defined(CONFIG_USER_USB_BILLBOARD_ON) || defined(CONFIG_USER_USB_HID_ON))
  81. /**
  82. * @brief 返回USB接收消息队列.
  83. * @param[in] None.
  84. * @return the pointer of UsbQueue.
  85. */
  86. HV_VOS_QUEUE_S* Hv_Mw_System_GetUsbQueue( VOID );
  87. #endif
  88. /**
  89. * @brief 返回EventHub接收消息队列.
  90. * @param[in] None.
  91. * @return the point of EventHubQueue.
  92. */
  93. HV_VOS_QUEUE_S* Hv_Mw_System_GetEventHubQueue( VOID );
  94. /**
  95. * @brief 返回Urgent接收消息队列.
  96. * @param[in] None.
  97. * @return the point of UrgentQueue.
  98. */
  99. HV_VOS_QUEUE_S* Hv_Mw_System_GetUrgentQueue( VOID );
  100. /**
  101. * @brief SystemTask启动后在for循环前仅运行一次的初始化函数接口.
  102. * @param[in] None.
  103. * @return none.
  104. */
  105. VOID Hv_Mw_System_TaskStartInit( VOID );
  106. /**
  107. * @brief SystemTask入口函数.
  108. * @param[in] unused.
  109. * @return none.
  110. */
  111. VOID Hv_Mw_System_TaskHandle( VOID *arg );
  112. /**
  113. * @brief Urgent task任务句柄.
  114. * @param[in] None.
  115. * @return Urgent task任务句柄指针.
  116. */
  117. HV_VOS_TASK_S* Hv_Mw_System_UrgentTaskHandle( VOID );
  118. /**
  119. * @brief shell task任务句柄.
  120. * @param[in] None.
  121. * @return shell task任务句柄指针.
  122. */
  123. #ifdef HV_SCALER_DEBUG_VERSION
  124. HV_VOS_TASK_S* Hv_Mw_System_ShellTaskHandle( VOID );
  125. #endif
  126. /**
  127. * @brief 系统启动函数,包含任务启动函数,全局中断使能.
  128. * @param[in] None.
  129. * @return none.
  130. */
  131. VOID Hv_Mw_System_TaskAndIrqEnable( VOID );
  132. /**
  133. * @brief 设置Database同步定时器启动和停止.
  134. * @param[in] bEn.
  135. * @return none.
  136. */
  137. VOID Hv_Mw_System_SetDatabaseSyncTimerEnable(BOOL bEn);
  138. #endif