2 * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
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
10 * www.apache.org/licenses/LICENSE-2.0
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.
19 #include "Driver_USBD.h"
21 #define ARM_USBD_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
24 static const ARM_DRIVER_VERSION usbd_driver_version = {
29 /* Driver Capabilities */
30 static const ARM_USBD_CAPABILITIES usbd_driver_capabilities = {
31 0, /* vbus_detection */
32 0, /* event_vbus_on */
33 0 /* event_vbus_off */
40 ARM_DRIVER_VERSION ARM_USBD_GetVersion(void)
44 ARM_USBD_CAPABILITIES ARM_USBD_GetCapabilities(void)
48 int32_t ARM_USBD_Initialize(ARM_USBD_SignalDeviceEvent_t cb_device_event,
49 ARM_USBD_SignalEndpointEvent_t cb_endpoint_event)
53 int32_t ARM_USBD_Uninitialize(void)
57 int32_t ARM_USBD_PowerControl(ARM_POWER_STATE state)
71 return ARM_DRIVER_ERROR_UNSUPPORTED;
75 int32_t ARM_USBD_DeviceConnect(void)
79 int32_t ARM_USBD_DeviceDisconnect(void)
83 ARM_USBD_STATE ARM_USBD_DeviceGetState(void)
87 int32_t ARM_USBD_DeviceRemoteWakeup(void)
91 int32_t ARM_USBD_DeviceSetAddress(uint8_t dev_addr)
95 int32_t ARM_USBD_ReadSetupPacket(uint8_t *setup)
99 int32_t ARM_USBD_EndpointConfigure(uint8_t ep_addr,
101 uint16_t ep_max_packet_size)
105 int32_t ARM_USBD_EndpointUnconfigure(uint8_t ep_addr)
109 int32_t ARM_USBD_EndpointStall(uint8_t ep_addr, bool stall)
113 int32_t ARM_USBD_EndpointTransfer(uint8_t ep_addr, uint8_t *data, uint32_t num)
117 uint32_t ARM_USBD_EndpointTransferGetResult(uint8_t ep_addr)
121 int32_t ARM_USBD_EndpointTransferAbort(uint8_t ep_addr)
125 uint16_t ARM_USBD_GetFrameNumber(void)
129 void ARM_USBD_SignalDeviceEvent(uint32_t event)
134 void ARM_USBD_SignalEndpointEvent(uint8_t ep_addr, uint32_t ep_event)
139 // End USBD Interface
141 ARM_DRIVER_USBD Driver_USBD =
144 ARM_USBD_GetCapabilities,
146 ARM_USBD_Uninitialize,
147 ARM_USBD_PowerControl,
148 ARM_USBD_DeviceConnect,
149 ARM_USBD_DeviceDisconnect,
150 ARM_USBD_DeviceGetState,
151 ARM_USBD_DeviceRemoteWakeup,
152 ARM_USBD_DeviceSetAddress,
153 ARM_USBD_ReadSetupPacket,
154 ARM_USBD_EndpointConfigure,
155 ARM_USBD_EndpointUnconfigure,
156 ARM_USBD_EndpointStall,
157 ARM_USBD_EndpointTransfer,
158 ARM_USBD_EndpointTransferGetResult,
159 ARM_USBD_EndpointTransferAbort,
160 ARM_USBD_GetFrameNumber