diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_USBH.c')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_USBH.c | 225 |
1 files changed, 225 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_USBH.c b/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_USBH.c new file mode 100644 index 000000000..12074ed7a --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_USBH.c | |||
@@ -0,0 +1,225 @@ | |||
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 | |||
19 | #include "Driver_USBH.h" | ||
20 | |||
21 | /* USB Host Driver */ | ||
22 | |||
23 | #define ARM_USBH_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */ | ||
24 | |||
25 | /* Driver Version */ | ||
26 | static const ARM_DRIVER_VERSION usbh_driver_version = { | ||
27 | ARM_USBH_API_VERSION, | ||
28 | ARM_USBH_DRV_VERSION | ||
29 | }; | ||
30 | |||
31 | /* Driver Capabilities */ | ||
32 | static const ARM_USBH_CAPABILITIES usbd_driver_capabilities = { | ||
33 | 0x0001, /* Root HUB available Ports Mask */ | ||
34 | 0, /* Automatic SPLIT packet handling */ | ||
35 | 0, /* Signal Connect event */ | ||
36 | 0, /* Signal Disconnect event */ | ||
37 | 0 /* Signal Overcurrent event */ | ||
38 | }; | ||
39 | |||
40 | // | ||
41 | // Functions | ||
42 | // | ||
43 | |||
44 | ARM_DRIVER_VERSION ARM_USBH_GetVersion(void) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | ARM_USBH_CAPABILITIES ARM_USBH_GetCapabilities(void) | ||
49 | { | ||
50 | } | ||
51 | |||
52 | int32_t ARM_USBH_Initialize(ARM_USBH_SignalPortEvent_t cb_port_event, | ||
53 | ARM_USBH_SignalEndpointEvent_t cb_endpoint_event) | ||
54 | { | ||
55 | } | ||
56 | |||
57 | int32_t ARM_USBH_Uninitialize(void) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | int32_t ARM_USBH_PowerControl(ARM_POWER_STATE state) | ||
62 | { | ||
63 | switch (state) | ||
64 | { | ||
65 | case ARM_POWER_OFF: | ||
66 | break; | ||
67 | |||
68 | case ARM_POWER_LOW: | ||
69 | break; | ||
70 | |||
71 | case ARM_POWER_FULL: | ||
72 | break; | ||
73 | |||
74 | default: | ||
75 | return ARM_DRIVER_ERROR_UNSUPPORTED; | ||
76 | } | ||
77 | } | ||
78 | |||
79 | int32_t ARM_USBH_PortVbusOnOff(uint8_t port, bool vbus) | ||
80 | { | ||
81 | } | ||
82 | |||
83 | int32_t ARM_USBH_PortReset(uint8_t port) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | int32_t ARM_USBH_PortSuspend(uint8_t port) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | int32_t ARM_USBH_PortResume(uint8_t port) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | ARM_USBH_PORT_STATE ARM_USBH_PortGetState(uint8_t port) | ||
96 | { | ||
97 | } | ||
98 | |||
99 | ARM_USBH_EP_HANDLE ARM_USBH_EndpointCreate(uint8_t dev_addr, | ||
100 | uint8_t dev_speed, | ||
101 | uint8_t hub_addr, | ||
102 | uint8_t hub_port, | ||
103 | uint8_t ep_addr, | ||
104 | uint8_t ep_type, | ||
105 | uint16_t ep_max_packet_size, | ||
106 | uint8_t ep_interval) | ||
107 | { | ||
108 | } | ||
109 | |||
110 | int32_t ARM_USBH_EndpointModify(ARM_USBH_EP_HANDLE ep_hndl, | ||
111 | uint8_t dev_addr, | ||
112 | uint8_t dev_speed, | ||
113 | uint8_t hub_addr, | ||
114 | uint8_t hub_port, | ||
115 | uint16_t ep_max_packet_size) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | int32_t ARM_USBH_EndpointDelete(ARM_USBH_EP_HANDLE ep_hndl) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | int32_t ARM_USBH_EndpointReset(ARM_USBH_EP_HANDLE ep_hndl) | ||
124 | { | ||
125 | } | ||
126 | |||
127 | int32_t ARM_USBH_EndpointTransfer(ARM_USBH_EP_HANDLE ep_hndl, | ||
128 | uint32_t packet, | ||
129 | uint8_t *data, | ||
130 | uint32_t num) | ||
131 | { | ||
132 | } | ||
133 | |||
134 | uint32_t ARM_USBH_EndpointTransferGetResult(ARM_USBH_EP_HANDLE ep_hndl) | ||
135 | { | ||
136 | } | ||
137 | |||
138 | int32_t ARM_USBH_EndpointTransferAbort(ARM_USBH_EP_HANDLE ep_hndl) | ||
139 | { | ||
140 | } | ||
141 | |||
142 | uint16_t ARM_USBH_GetFrameNumber(void) | ||
143 | { | ||
144 | } | ||
145 | |||
146 | void ARM_USBH_SignalPortEvent(uint8_t port, uint32_t event) | ||
147 | { | ||
148 | // function body | ||
149 | } | ||
150 | |||
151 | void ARM_USBH_SignalEndpointEvent(ARM_USBH_EP_HANDLE ep_hndl, uint32_t event) | ||
152 | { | ||
153 | // function body | ||
154 | } | ||
155 | |||
156 | /* USB Host HCI (OHCI/EHCI) Driver */ | ||
157 | |||
158 | /* Driver Version */ | ||
159 | static const ARM_DRIVER_VERSION usbh_hci_driver_version = { | ||
160 | ARM_USBH_API_VERSION, | ||
161 | ARM_USBH_DRV_VERSION | ||
162 | }; | ||
163 | |||
164 | /* Driver Capabilities */ | ||
165 | static const ARM_USBH_HCI_CAPABILITIES usbh_hci_driver_capabilities = { | ||
166 | 0x0001 /* Root HUB available Ports Mask */ | ||
167 | }; | ||
168 | |||
169 | // | ||
170 | // Functions | ||
171 | // | ||
172 | |||
173 | ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion(void) | ||
174 | { | ||
175 | } | ||
176 | |||
177 | ARM_USBH_HCI_CAPABILITIES ARM_USBH_HCI_GetCapabilities(void) | ||
178 | { | ||
179 | } | ||
180 | |||
181 | int32_t ARM_USBH_HCI_Initialize(ARM_USBH_HCI_Interrupt_t cb_interrupt) | ||
182 | { | ||
183 | } | ||
184 | |||
185 | int32_t ARM_USBH_HCI_Uninitialize(void) | ||
186 | { | ||
187 | } | ||
188 | |||
189 | int32_t ARM_USBH_HCI_PowerControl(ARM_POWER_STATE state) | ||
190 | { | ||
191 | switch (state) | ||
192 | { | ||
193 | case ARM_POWER_OFF: | ||
194 | break; | ||
195 | |||
196 | case ARM_POWER_LOW: | ||
197 | break; | ||
198 | |||
199 | case ARM_POWER_FULL: | ||
200 | break; | ||
201 | |||
202 | default: | ||
203 | return ARM_DRIVER_ERROR_UNSUPPORTED; | ||
204 | } | ||
205 | } | ||
206 | |||
207 | int32_t ARM_USBH_HCI_PortVbusOnOff(uint8_t port, bool vbus) | ||
208 | { | ||
209 | } | ||
210 | |||
211 | void ARM_USBH_HCI_Interrupt(void) | ||
212 | { | ||
213 | // function body | ||
214 | } | ||
215 | |||
216 | // End USBH Interface | ||
217 | |||
218 | ARM_DRIVER_USBH_HCI Driver_USBH_HCI = { | ||
219 | ARM_USBH_HCI_GetVersion, | ||
220 | ARM_USBH_HCI_GetCapabilities, | ||
221 | ARM_USBH_HCI_Initialize, | ||
222 | ARM_USBH_HCI_Uninitialize, | ||
223 | ARM_USBH_HCI_PowerControl, | ||
224 | ARM_USBH_HCI_PortVbusOnOff | ||
225 | }; | ||