hal_usbd.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * BSD 2-Clause License
  3. * Copyright (c) 2022, LiteEMF
  4. * All rights reserved.
  5. * This software component is licensed by LiteEMF under BSD 2-Clause license,
  6. * the "License"; You may not use this file except in compliance with the
  7. * License. You may obtain a copy of the License at:
  8. * opensource.org/licenses/BSD-2-Clause
  9. *
  10. */
  11. /************************************************************************************************************
  12. ** Description:
  13. ************************************************************************************************************/
  14. #include "hw_config.h"
  15. #if API_USBD_BIT_ENABLE
  16. #include "api/usb/usb_typedef.h"
  17. #include "api/usb/device/usbd.h"
  18. #include "api/api_log.h"
  19. /******************************************************************************************************
  20. ** Defined
  21. *******************************************************************************************************/
  22. /******************************************************************************************************
  23. ** public Parameters
  24. *******************************************************************************************************/
  25. /******************************************************************************************************
  26. ** static Parameters
  27. *******************************************************************************************************/
  28. /*****************************************************************************************************
  29. ** static Function
  30. ******************************************************************************************************/
  31. /*****************************************************************************************************
  32. ** Function
  33. ******************************************************************************************************/
  34. /*******************************************************************
  35. ** Parameters:
  36. ** Returns:
  37. ** Description:
  38. *******************************************************************/
  39. uint8_t *hal_usbd_get_endp_buffer(uint8_t id, uint8_t ep)
  40. {
  41. UNUSED_PARAMETER(id);
  42. UNUSED_PARAMETER(ep);
  43. return NULL;
  44. }
  45. error_t hal_usbd_endp_dma_init(uint8_t id)
  46. {
  47. UNUSED_PARAMETER(id);
  48. return ERROR_SUCCESS;
  49. }
  50. error_t hal_usbd_endp_open(uint8_t id, usb_endp_t *pendp)
  51. {
  52. UNUSED_PARAMETER(id);
  53. UNUSED_PARAMETER(pendp);
  54. return ERROR_SUCCESS;
  55. }
  56. error_t hal_usbd_endp_close(uint8_t id, uint8_t ep)
  57. {
  58. UNUSED_PARAMETER(id);
  59. UNUSED_PARAMETER(ep);
  60. return ERROR_SUCCESS;
  61. }
  62. error_t hal_usbd_endp_ack(uint8_t id, uint8_t ep, uint16_t len)
  63. {
  64. UNUSED_PARAMETER(id);
  65. UNUSED_PARAMETER(ep);
  66. UNUSED_PARAMETER(len);
  67. return ERROR_SUCCESS;
  68. }
  69. error_t hal_usbd_endp_nak(uint8_t id, uint8_t ep)
  70. {
  71. UNUSED_PARAMETER(id);
  72. UNUSED_PARAMETER(ep);
  73. return ERROR_SUCCESS;
  74. }
  75. error_t hal_usbd_clear_endp_stall(uint8_t id, uint8_t ep)
  76. {
  77. UNUSED_PARAMETER(id);
  78. UNUSED_PARAMETER(ep);
  79. return ERROR_SUCCESS;
  80. }
  81. error_t hal_usbd_endp_stall(uint8_t id, uint8_t ep)
  82. {
  83. UNUSED_PARAMETER(id);
  84. UNUSED_PARAMETER(ep);
  85. return ERROR_SUCCESS;
  86. }
  87. /*******************************************************************
  88. ** Parameters:
  89. ** Returns:
  90. ** Description: 注意: 端点0 发送需要处理usbd_req_t
  91. *******************************************************************/
  92. error_t hal_usbd_in(uint8_t id, uint8_t ep, uint8_t* buf,uint16_t len)
  93. {
  94. UNUSED_PARAMETER(id);
  95. UNUSED_PARAMETER(ep);
  96. UNUSED_PARAMETER(buf);
  97. UNUSED_PARAMETER(len);
  98. return ERROR_SUCCESS;
  99. }
  100. error_t hal_usbd_out(uint8_t id, uint8_t ep, uint8_t* buf, uint16_t* plen)
  101. {
  102. UNUSED_PARAMETER(id);
  103. UNUSED_PARAMETER(ep);
  104. UNUSED_PARAMETER(buf);
  105. UNUSED_PARAMETER(len);
  106. return ERROR_SUCCESS;
  107. }
  108. error_t hal_usbd_reset(uint8_t id)
  109. {
  110. UNUSED_PARAMETER(id);
  111. return ERROR_SUCCESS;
  112. }
  113. error_t hal_usbd_set_address(uint8_t id,uint8_t address)
  114. {
  115. UNUSED_PARAMETER(id);
  116. UNUSED_PARAMETER(address);
  117. return ERROR_SUCCESS;
  118. }
  119. error_t hal_usbd_init(uint8_t id)
  120. {
  121. UNUSED_PARAMETER(id);
  122. return ERROR_SUCCESS;
  123. }
  124. error_t hal_usbd_deinit(uint8_t id)
  125. {
  126. UNUSED_PARAMETER(id);
  127. return ERROR_SUCCESS;
  128. }
  129. #endif