hv_drv_UsbComm.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * @file hv_drv_UsbComm.h
  3. * @brief Header file of usb common driver for host and device.
  4. *
  5. * @author HiView SoC Software Team
  6. * @version 1.0.0
  7. * @date 2022-06-15
  8. */
  9. #ifndef __HV_DRV_USB_COMMON_H
  10. #define __HV_DRV_USB_COMMON_H
  11. #include "hv_comm_DataType.h"
  12. #include "hv_vos_Comm.h"
  13. //#define USB_TRACKED_FILE_POSITION
  14. /**
  15. * @brief driver层获取mw层队列消息的回调函数定义
  16. */
  17. typedef HV_VOS_QUEUE_S* (*GetUsbOtaQueue)(void);
  18. #ifdef USB_TRACKED_FILE_POSITION
  19. VOID* HV_Drv_USB_TrackedMalloc(UINT32 size, const char* file, UINT32 line);
  20. #else
  21. VOID* HV_Drv_USB_TrackedMalloc(UINT32 size);
  22. #endif
  23. VOID HV_Drv_USB_TrackedFree(VOID* ptr);
  24. VOID HV_Drv_USB_GlobalFreeAll(VOID);
  25. /**
  26. * @brief 注册获取mw层usb消息队列的回调函数.
  27. * @param[in] CbFunc callback function.
  28. * @return NONE
  29. */
  30. VOID Hv_Drv_USB_RegisterGetQueueCb(VOID *CbFunc);
  31. /**
  32. * @brief Send the event to queue of usb.
  33. * @param[in] usEventId the event id to send.
  34. * @param[in] usValue the value to send.
  35. * @return Status, 0:HV_SUCCESS, 1:HV_FAILURE.
  36. */
  37. Status Hv_Drv_USB_SendEventToUsbQueue(USHORT16 usEventId, USHORT16 usValue);
  38. /**
  39. * @brief Send the event to queue of usb from ISR.
  40. * @param[in] usEventId the event id to send.
  41. * @param[in] usValue the value to send.
  42. * @return Status, 0:HV_SUCCESS, 1:HV_FAILURE.
  43. */
  44. Status Hv_Drv_USB_SendEventToUsbQueueFromISR(USHORT16 usEventId, USHORT16 usValue);
  45. #endif