Driver_USBD.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * Copyright (c) 2013-2018 Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #include "Driver_USBD.h"
  19. #define ARM_USBD_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
  20. /* Driver Version */
  21. static const ARM_DRIVER_VERSION usbd_driver_version = {
  22. ARM_USBD_API_VERSION,
  23. ARM_USBD_DRV_VERSION
  24. };
  25. /* Driver Capabilities */
  26. static const ARM_USBD_CAPABILITIES usbd_driver_capabilities = {
  27. 0, /* vbus_detection */
  28. 0, /* event_vbus_on */
  29. 0 /* event_vbus_off */
  30. };
  31. //
  32. // Functions
  33. //
  34. ARM_DRIVER_VERSION ARM_USBD_GetVersion(void)
  35. {
  36. }
  37. ARM_USBD_CAPABILITIES ARM_USBD_GetCapabilities(void)
  38. {
  39. }
  40. int32_t ARM_USBD_Initialize(ARM_USBD_SignalDeviceEvent_t cb_device_event,
  41. ARM_USBD_SignalEndpointEvent_t cb_endpoint_event)
  42. {
  43. }
  44. int32_t ARM_USBD_Uninitialize(void)
  45. {
  46. }
  47. int32_t ARM_USBD_PowerControl(ARM_POWER_STATE state)
  48. {
  49. switch (state)
  50. {
  51. case ARM_POWER_OFF:
  52. break;
  53. case ARM_POWER_LOW:
  54. break;
  55. case ARM_POWER_FULL:
  56. break;
  57. default:
  58. return ARM_DRIVER_ERROR_UNSUPPORTED;
  59. }
  60. }
  61. int32_t ARM_USBD_DeviceConnect(void)
  62. {
  63. }
  64. int32_t ARM_USBD_DeviceDisconnect(void)
  65. {
  66. }
  67. ARM_USBD_STATE ARM_USBD_DeviceGetState(void)
  68. {
  69. }
  70. int32_t ARM_USBD_DeviceRemoteWakeup(void)
  71. {
  72. }
  73. int32_t ARM_USBD_DeviceSetAddress(uint8_t dev_addr)
  74. {
  75. }
  76. int32_t ARM_USBD_ReadSetupPacket(uint8_t *setup)
  77. {
  78. }
  79. int32_t ARM_USBD_EndpointConfigure(uint8_t ep_addr,
  80. uint8_t ep_type,
  81. uint16_t ep_max_packet_size)
  82. {
  83. }
  84. int32_t ARM_USBD_EndpointUnconfigure(uint8_t ep_addr)
  85. {
  86. }
  87. int32_t ARM_USBD_EndpointStall(uint8_t ep_addr, bool stall)
  88. {
  89. }
  90. int32_t ARM_USBD_EndpointTransfer(uint8_t ep_addr, uint8_t *data, uint32_t num)
  91. {
  92. }
  93. uint32_t ARM_USBD_EndpointTransferGetResult(uint8_t ep_addr)
  94. {
  95. }
  96. int32_t ARM_USBD_EndpointTransferAbort(uint8_t ep_addr)
  97. {
  98. }
  99. uint16_t ARM_USBD_GetFrameNumber(void)
  100. {
  101. }
  102. void ARM_USBD_SignalDeviceEvent(uint32_t event)
  103. {
  104. // function body
  105. }
  106. void ARM_USBD_SignalEndpointEvent(uint8_t ep_addr, uint32_t ep_event)
  107. {
  108. // function body
  109. }
  110. // End USBD Interface
  111. ARM_DRIVER_USBD Driver_USBD =
  112. {
  113. ARM_USBD_GetVersion,
  114. ARM_USBD_GetCapabilities,
  115. ARM_USBD_Initialize,
  116. ARM_USBD_Uninitialize,
  117. ARM_USBD_PowerControl,
  118. ARM_USBD_DeviceConnect,
  119. ARM_USBD_DeviceDisconnect,
  120. ARM_USBD_DeviceGetState,
  121. ARM_USBD_DeviceRemoteWakeup,
  122. ARM_USBD_DeviceSetAddress,
  123. ARM_USBD_ReadSetupPacket,
  124. ARM_USBD_EndpointConfigure,
  125. ARM_USBD_EndpointUnconfigure,
  126. ARM_USBD_EndpointStall,
  127. ARM_USBD_EndpointTransfer,
  128. ARM_USBD_EndpointTransferGetResult,
  129. ARM_USBD_EndpointTransferAbort,
  130. ARM_USBD_GetFrameNumber
  131. };