12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /**
- * @file hv_mw_UsbTask.h
- * @brief Header file of USB task module.
- *
- * @verbatim
- * ==============================================================================
- * ##### How to use #####
- * ==============================================================================
- * (+) Use Hv_Mw_UsbTaskHandle(...) s a task function handle.
- *
- * @endverbatim
- *
- * @author HiView SoC Software Team
- * @version 1.0.0
- * @date 2022-08-10
- */
- #ifndef __SDK_MIDDLEWARE_RUNTIME_USBTASK_INC_USBTASK_H__
- #define __SDK_MIDDLEWARE_RUNTIME_USBTASK_INC_USBTASK_H__
- #ifdef CONFIG_USER_USB_OTA_ON
- #include "hv_comm_DataType.h"
- #include "hv_comm_Event.h"
- #include "hv_drv_UsbFatfs.h"
- #include "hv_drv_UsbFatfsDiskIo.h"
- #include "hv_vos_Comm.h"
- /**
- * @brief Defines the state of USB, which can be used for state machine operation and also for event notification with other modules.
- */
- typedef enum _UsbState
- {
- USB_STATE_IDLE = 0x01, /*!< 空闲态,无实际作用 */
- USB_STATE_NO_UDISK_IN = 0x02, /*!< 端口检查结果:无设备接入 */
- USB_STATE_PLUGGED_IN = 0x03, /*!< 端口检查结果:有设备接入 */
- USB_STATE_NO_OTA_FILE = 0x04, /*!< OTA目标文件查找结果:未找到文件 */
- USB_STATE_FOUND_OTA_FILE = 0x05, /*!< OTA目标文件查找结果:命中 */
- USB_STATE_OTA_IN_PROCESSING = 0x08, /*!< OTA运行中 */
- USB_STATE_OTA_SUCCESS = 0x09, /*!< OTA结果:成功 */
- USB_STATE_OTA_FAIL = 0x0A, /*!< OTA结果:失败 */
- USB_STATE_ANY = 0xFF, /*!< 任意态,用于不限制状态机触发的初始状态时 */
- } UsbState;
- /**
- * @brief OTA State Machine
- */
- typedef struct _UsbStateMachine
- {
- USHORT16 usAcceptStates;
- UsbEventId enEventId;
- Status (*pfActionHandle)(UsbEvent *pstEvent);
- }UsbStateMachine;
- /**
- * @brief Set USB state.
- * @param[in] enState enum value of UsbOtaState
- * @return none
- */
- VOID Hv_Mw_USB_SetUsbState(UsbState enState);
- /**
- * @brief Get USB state.
- * @return enum value of UsbState.
- */
- UsbState Hv_Mw_USB_GetUsbState(VOID);
- /**
- * @brief Send event to usb module.
- * @return VOID
- */
- VOID Hv_Mw_SendEvtToUsb(UsbEventId enEvtID, USHORT16 usValue);
- /**
- * @brief Usb Host task init.
- * @return VOID
- */
- VOID Hv_Mw_UsbHost_TaskStartInit(VOID);
- #endif
- /**
- * @brief Stop Usb Host task.
- * @return VOID
- */
- VOID Hv_Mw_UsbHost_TaskStop(VOID);
- /**
- * @brief USB task function handle.
- * @param[in] arg unused.
- * @return VOID
- */
- VOID Hv_Mw_UsbTaskHandle( VOID *arg );
- #endif
|