2 \defgroup usbh_interface_gr USB Host Interface
3 \ingroup usb_interface_gr
4 \brief Driver API for USB Host Peripheral (%Driver_USBH.h)
8 \defgroup usbh_host_gr USB Host
9 \ingroup usbh_interface_gr
10 \brief Driver API for USB Host
16 \struct ARM_DRIVER_USBH
18 The functions of the USB Host driver are accessed by function pointers. Refer to \ref DriverFunctions for
21 Each instance of an USBH provides such an access struct. The instance is indicated by
22 a postfix in the symbol name of the access struct, for example:
23 - \b Driver_USBH0 is the name of the access struct of the first instance (no. 0).
24 - \b Driver_USBH1 is the name of the access struct of the second instance (no. 1).
27 A configuration setting in the middleware allows connecting the middleware to a specific driver instance <b>Driver_USBH<i>n</i></b>.
28 The default is \token{0}, which connects a middleware to the first instance of a driver.
30 \note The struct must remain unchanged.
31 *****************************************************************************************************************/
34 \struct ARM_USBH_CAPABILITIES
36 A USB Host driver can be implemented with different capabilities.
37 The data fields of this structure encode the capabilities implemented by this driver.
40 - \ref ARM_USBH_GetCapabilities
42 \note The struct must remain unchanged.
43 *****************************************************************************************************************/
46 \struct ARM_USBH_PORT_STATE
48 This structure stores information about the state of the USB Host Port. The data fields encode whether a device
49 is connected to the port, if port overcurrent is detected, and the port speed.
52 - \ref ARM_USBH_PortGetState
53 *****************************************************************************************************************/
56 \typedef uint32_t ARM_USBH_PIPE_HANDLE
58 Each pipe is identified through a unique number, which is created by the function \ref ARM_USBH_PipeCreate.
61 - \ref ARM_USBH_PipeModify,
62 \ref ARM_USBH_PipeDelete,
63 \ref ARM_USBH_PipeReset,
64 \ref ARM_USBH_PipeTransfer,
65 \ref ARM_USBH_PipeTransferGetResult,
66 \ref ARM_USBH_PipeTransferAbort,
67 \ref ARM_USBH_SignalPipeEvent
70 - \ref ARM_USBH_PipeCreate
71 *****************************************************************************************************************/
74 \typedef ARM_USBH_SignalPortEvent_t
76 Provides the typedef for the callback function \ref ARM_USBH_SignalPortEvent.
79 - \ref ARM_USBH_Initialize
80 *******************************************************************************************************************/
83 \typedef ARM_USBH_SignalPipeEvent_t
85 Provides the typedef for the callback function \ref ARM_USBH_SignalPipeEvent.
88 - \ref ARM_USBH_Initialize
89 *******************************************************************************************************************/
92 \defgroup USBH_port_events USBH Port Events
94 \brief The USB Host driver generates Port call back events that are notified via the function \ref ARM_USBH_SignalPortEvent.
96 This section provides the event values for the \ref ARM_USBH_SignalPortEvent callback function.
98 The following call back notification events are generated:
100 \def ARM_USBH_EVENT_CONNECT
101 \def ARM_USBH_EVENT_DISCONNECT
102 \def ARM_USBH_EVENT_OVERCURRENT
103 \def ARM_USBH_EVENT_RESET
104 \def ARM_USBH_EVENT_SUSPEND
105 \def ARM_USBH_EVENT_RESUME
106 \def ARM_USBH_EVENT_REMOTE_WAKEUP
111 \defgroup USBH_pipe_events USBH Pipe Events
112 \ingroup usbh_host_gr
113 \brief The USB Host driver generates Pipe call back events that are notified via the function \ref ARM_USBH_SignalPipeEvent.
115 This section provides the event values for the \ref ARM_USBH_SignalPipeEvent callback function.
117 The following call back notification events are generated:
119 \def ARM_USBH_EVENT_TRANSFER_COMPLETE
120 \def ARM_USBH_EVENT_HANDSHAKE_NAK
121 \def ARM_USBH_EVENT_HANDSHAKE_NYET
122 \def ARM_USBH_EVENT_HANDSHAKE_MDATA
123 \def ARM_USBH_EVENT_HANDSHAKE_STALL
124 \def ARM_USBH_EVENT_HANDSHAKE_ERR
125 \def ARM_USBH_EVENT_BUS_ERROR
130 \defgroup USBH_packets USBH Packet Information
131 \ingroup usbh_host_gr
132 \brief Specify USB packet information used by the function \ref ARM_USBH_PipeTransfer
134 This section provides the packet information values (parameter \em packet) for the \ref ARM_USBH_PipeTransfer function.
136 The following values are defined:
138 \def ARM_USBH_PACKET_SETUP
139 Generate SETUP transaction.
140 \def ARM_USBH_PACKET_OUT
141 Generate OUT transaction.
142 \def ARM_USBH_PACKET_IN
143 Generate IN transaction.
144 \def ARM_USBH_PACKET_PING
145 Generate PING transaction (no data packet).
146 \def ARM_USBH_PACKET_DATA0
147 Force DATA0 PID (Packet Identifier) for the initial data packet. When not specified than the driver provides the initial value according to the current state.
148 \def ARM_USBH_PACKET_DATA1
149 Force DATA1 PID (Packet Identifier) for the initial data packet. When not specified than the driver provides the initial value according to the current state.
150 \def ARM_USBH_PACKET_SSPLIT
151 Used when driver does not support automatic handling of SPLIT packets and indicates Start-Split packet.
152 For isochronous OUT it indicates that the High-speed data is in the middle of the Full-speed data payload.
153 \def ARM_USBH_PACKET_SSPLIT_S
154 Used when driver does not support automatic handling of SPLIT packets and indicates Start-Split packet.
155 Valid only for isochronous OUT and indicates that the High-speed data is the start of the Full-speed data payload.
156 \def ARM_USBH_PACKET_SSPLIT_E
157 Used when driver does not support automatic handling of SPLIT packets and indicates Start-Split packet.
158 Valid only for isochronous OUT and indicates that the High-speed data is the end of the Full-speed data payload.
159 \def ARM_USBH_PACKET_SSPLIT_S_E
160 Used when driver does not support automatic handling of SPLIT packets and indicates Start-Split packet.
161 Valid only for isochronous OUT and indicates that the High-speed data is all of the Full-speed data payload.
162 \def ARM_USBH_PACKET_CSPLIT
163 Used when driver does not support automatic handling of SPLIT packets and indicates Complete-Split packet.
164 \def ARM_USBH_PACKET_PRE
165 Generate PRE (Preamble) for low-speed devices within a full/low-speed signaling environment.
174 ARM_DRIVER_VERSION ARM_USBH_GetVersion (void) {
178 \fn ARM_DRIVER_VERSION ARM_USBH_GetVersion (void)
180 The function \b ARM_USBH_GetVersion returns version information of the driver implementation in \ref ARM_DRIVER_VERSION
181 - API version is the version of the CMSIS-Driver specification used to implement this driver.
182 - Driver version is source code version of the actual driver implementation.
186 extern ARM_DRIVER_USBH Driver_USBH0;
187 ARM_DRIVER_USBH *drv_info;
189 void setup_usbh (void) {
190 ARM_DRIVER_VERSION version;
192 drv_info = &Driver_USBH0;
193 version = drv_info->GetVersion ();
194 if (version.api < 0x10A) { // requires at minimum API version 1.10 or higher
200 *****************************************************************************************************************/
202 ARM_USBH_CAPABILITIES ARM_USBH_GetCapabilities (void) {
206 \fn ARM_USBH_CAPABILITIES ARM_USBH_GetCapabilities (void)
208 The function \b ARM_USBH_GetCapabilities returns information about capabilities in this driver implementation.
209 The data fields of the structure \ref ARM_USBH_CAPABILITIES encode various capabilities, for example
210 available HUB ports or if the hardware can generate signal events using the \ref ARM_USBH_SignalPortEvent
215 extern ARM_DRIVER_USBH Driver_USBH0;
216 ARM_DRIVER_USBH *drv_info;
218 void read_capabilities (void) {
219 ARM_USBH_CAPABILITIES drv_capabilities;
221 drv_info = &Driver_USBH0;
222 drv_capabilities = drv_info->GetCapabilities ();
223 // interrogate capabilities
227 *****************************************************************************************************************/
229 int32_t ARM_USBH_Initialize (ARM_USBH_SignalPortEvent_t cb_port_event,
230 ARM_USBH_SignalPipeEvent_t cb_pipe_event) {
231 return ARM_DRIVER_OK;
234 \fn int32_t ARM_USBH_Initialize (ARM_USBH_SignalPortEvent_t cb_port_event, ARM_USBH_SignalPipeEvent_t cb_pipe_event)
236 The function \b ARM_USBH_Initialize initializes the USB Host interface.
237 It is called when the middleware component starts operation.
239 The function performs the following operations:
240 - Initializes the resources needed for the USBH interface.
241 - Registers the \ref ARM_USBH_SignalPortEvent callback function.
242 - Registers the \ref ARM_USBH_SignalPipeEvent callback function.
244 The parameter \em cb_port_event is a pointer to the \ref ARM_USBH_SignalPortEvent callback function; use a NULL pointer
245 when no port callback signals are required.
247 The parameter \em cb_pipe_event is a pointer to the \ref ARM_USBH_SignalPipeEvent callback function.
250 - see \ref usbh_interface_gr - Driver Functions
252 *****************************************************************************************************************/
254 int32_t ARM_USBH_Uninitialize (void) {
255 return ARM_DRIVER_OK;
258 \fn int32_t ARM_USBH_Uninitialize (void)
260 The function \b ARM_USBH_Uninitialize de-initializes the resources of USB Host interface.
262 It is called when the middleware component stops operation and releases the software resources used by the interface.
263 *****************************************************************************************************************/
265 int32_t ARM_USBH_PowerControl (ARM_POWER_STATE state) {
266 return ARM_DRIVER_OK;
269 \fn int32_t ARM_USBH_PowerControl (ARM_POWER_STATE state)
271 The function \b ARM_USBH_PowerControl operates the power modes of the USB Host interface.
273 The parameter \em state sets the operation and can have the following values:
274 - \ref ARM_POWER_FULL : set-up peripheral for data transfers, enable interrupts (NVIC) and optionally DMA.
275 Can be called multiple times. If the peripheral is already in this mode the function performs
276 no operation and returns with \ref ARM_DRIVER_OK.
277 - \ref ARM_POWER_LOW : may use power saving. Returns \ref ARM_DRIVER_ERROR_UNSUPPORTED when not implemented.
278 - \ref ARM_POWER_OFF : terminates any pending data transfers, disables peripheral, disables related interrupts and DMA.
280 Refer to \ref CallSequence for more information.
281 *****************************************************************************************************************/
283 int32_t ARM_USBH_PortVbusOnOff (uint8_t port, bool vbus) {
284 return ARM_DRIVER_OK;
287 \fn int32_t ARM_USBH_PortVbusOnOff (uint8_t port, bool vbus)
289 The function \b ARM_USBH_PortVbusOnOff controls the VBUS signal of the specified port.
290 *****************************************************************************************************************/
292 int32_t ARM_USBH_PortReset (uint8_t port) {
293 return ARM_DRIVER_OK;
296 \fn int32_t ARM_USBH_PortReset (uint8_t port)
298 Executes reset signalling on the specified port.
299 *****************************************************************************************************************/
301 int32_t ARM_USBH_PortSuspend (uint8_t port) {
302 return ARM_DRIVER_OK;
305 \fn int32_t ARM_USBH_PortSuspend (uint8_t port)
307 The function \b ARM_USBH_PortSuspend auspends USB signaling on the specified port.
308 *****************************************************************************************************************/
310 int32_t ARM_USBH_PortResume (uint8_t port) {
311 return ARM_DRIVER_OK;
314 \fn int32_t ARM_USBH_PortResume (uint8_t port)
316 The function \b ARM_USBH_PortResume resumes USB signaling on the specified port.
317 *****************************************************************************************************************/
319 ARM_USBH_PORT_STATE ARM_USBH_PortGetState (uint8_t port) {
323 \fn ARM_USBH_PORT_STATE ARM_USBH_PortGetState (uint8_t port)
325 The function \b ARM_USBH_PortGetState returns the current state of the specified port.
326 *****************************************************************************************************************/
328 ARM_USBH_PIPE_HANDLE ARM_USBH_PipeCreate (uint8_t dev_addr,
334 uint16_t ep_max_packet_size,
335 uint8_t ep_interval) {
339 \fn ARM_USBH_PIPE_HANDLE ARM_USBH_PipeCreate (uint8_t dev_addr, uint8_t dev_speed, uint8_t hub_addr, uint8_t hub_port, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_max_packet_size, uint8_t ep_interval)
341 The function \b ARM_USBH_PipeCreate creates a pipe for transfers (allocates required resources and configures the pipe).
343 The parameters specify pipe information (connection between host and device endpoint):
344 - device: address and speed
345 - hub (optional): hub address and number of the hub port to which the device is connected
346 - endpoint: address, type, maximum packet size and polling interval
348 The function returns an pipe handle that is used for all subsequent operations on that pipe.
349 In case of errors an invalid handle (\em NULL) is returned.
350 *****************************************************************************************************************/
352 int32_t ARM_USBH_PipeModify (ARM_USBH_PIPE_HANDLE pipe_hndl,
357 uint16_t ep_max_packet_size) {
358 return ARM_DRIVER_OK;
361 \fn int32_t ARM_USBH_PipeModify (ARM_USBH_PIPE_HANDLE pipe_hndl, uint8_t dev_addr, uint8_t dev_speed, uint8_t hub_addr, uint8_t hub_port, uint16_t ep_max_packet_size)
363 The function \b ARM_USBH_PipeModify modifies a pipe configuration that was created with \ref ARM_USBH_PipeCreate.
364 *****************************************************************************************************************/
366 int32_t ARM_USBH_PipeDelete (ARM_USBH_PIPE_HANDLE pipe_hndl) {
367 return ARM_DRIVER_OK;
370 \fn int32_t ARM_USBH_PipeDelete (ARM_USBH_PIPE_HANDLE pipe_hndl)
372 The function \b ARM_USBH_PipeDelete deletes a pipe that was created with \ref ARM_USBH_PipeCreate (deactivates the pipe and releases used resources).
373 *****************************************************************************************************************/
375 int32_t ARM_USBH_PipeReset (ARM_USBH_PIPE_HANDLE pipe_hndl) {
376 return ARM_DRIVER_OK;
379 \fn int32_t ARM_USBH_PipeReset (ARM_USBH_PIPE_HANDLE pipe_hndl)
381 The function \b ARM_USBH_PipeReset clears Halt condition and resets data toggle on the specified pipe.
382 *****************************************************************************************************************/
384 int32_t ARM_USBH_PipeTransfer (ARM_USBH_PIPE_HANDLE pipe_hndl,
388 return ARM_DRIVER_OK;
391 \fn int32_t ARM_USBH_PipeTransfer (ARM_USBH_PIPE_HANDLE pipe_hndl, uint32_t packet, uint8_t *data, uint32_t num)
393 The function \b ARM_USBH_PipeTransfer generates packets for sending or receiving data from an USB Endpoint.
395 The function specifies the buffer with data to send or for data to receive and the number of bytes to transfer (must be multiple of device endpoint maximum packet size for receive).
396 It also specifies \ref USBH_packets with parameter \em packet.
398 The function is non-blocking and returns as soon as the driver starts the operation on the specified pipe. During the operation it is not allowed to call this function again on the same pipe. Also the data buffer must stay allocated and the contents of data must not be modified.
400 Operation is completed when the the requested number of data bytes have been transferred and is indicated with \ref ARM_USBH_EVENT_TRANSFER_COMPLETE event.
401 It can also finish earlier on reception of different handshake tokens which are also indicated through \ref USBH_pipe_events.
403 Transfer operation can be aborted by calling \ref ARM_USBH_PipeTransferAbort.
404 *****************************************************************************************************************/
406 uint32_t ARM_USBH_PipeTransferGetResult (ARM_USBH_PIPE_HANDLE pipe_hndl) {
410 \fn uint32_t ARM_USBH_PipeTransferGetResult (ARM_USBH_PIPE_HANDLE pipe_hndl)
412 The function \b ARM_USBH_PipeTransferGetResult returns the number of successfully transferred data bytes started by \ref ARM_USBH_PipeTransfer operation.
413 *****************************************************************************************************************/
415 int32_t ARM_USBH_PipeTransferAbort (ARM_USBH_PIPE_HANDLE pipe_hndl) {
416 return ARM_DRIVER_OK;
419 \fn int32_t ARM_USBH_PipeTransferAbort (ARM_USBH_PIPE_HANDLE pipe_hndl)
422 The function \b ARM_USBH_PipeTransferAbort aborts an active pipe transfer started by \ref ARM_USBH_PipeTransfer.
423 *****************************************************************************************************************/
425 uint16_t ARM_USBH_GetFrameNumber (void) {
429 \fn uint16_t ARM_USBH_GetFrameNumber (void)
431 The function \b ARM_USBH_GetFrameNumber returns the sequential 11-bit frame number of the last Start of Frame (SOF) packet.
432 *****************************************************************************************************************/
434 void ARM_USBH_SignalPortEvent (uint8_t port, uint32_t event) {
438 \fn void ARM_USBH_SignalPortEvent (uint8_t port, uint32_t event)
440 The function \b ARM_USBH_SignalPortEvent is a callback function registered by the function \ref ARM_USBH_Initialize.
442 The parameter \em port specifies the root hub port number. \n
443 The parameter \em event indicates one or more events that occurred during driver operation.
444 Each event is encoded in a separate bit and therefore it is possible to signal multiple events within the same call.
446 Not every event is necessarily generated by the driver. This depends on the implemented capabilities stored in the
447 data fields of the structure \ref ARM_USBH_CAPABILITIES, which can be retrieved with the function \ref ARM_USBH_GetCapabilities.
449 The following events can be generated:
451 Parameter \em event | Bit | Description | supported when ARM_USBH_CAPABILITIES
452 :---------------------------------|:---:|:---------------------------------------------------------------------------|---------------------------------------
453 \ref ARM_USBH_EVENT_CONNECT | 0 | Occurs when USB Device connects to the Host. | data field \em event_connect=\token{1}
454 \ref ARM_USBH_EVENT_DISCONNECT | 1 | Occurs when USB Device disconnects from the Host. | data field \em event_disconnect=\token{1}
455 \ref ARM_USBH_EVENT_OVERCURRENT | 2 | Occurs when USB Overcurrent it detected. | data field \em event_overcurrent=\token{1}
456 \ref ARM_USBH_EVENT_RESET | 3 | Occurs when USB Reset is completed after calling \ref ARM_USBH_PortReset. | <i>always supported</i>
457 \ref ARM_USBH_EVENT_SUSPEND | 4 | Occurs when USB Suspend is detected. | <i>always supported</i>
458 \ref ARM_USBH_EVENT_RESUME | 5 | Occurs when USB Resume is detected. | <i>always supported</i>
459 \ref ARM_USBH_EVENT_REMOTE_WAKEUP | 6 | Occurs when USB Remote wakeup is detected. | <i>always supported</i>
460 *****************************************************************************************************************/
462 void ARM_USBH_SignalPipeEvent (ARM_USBH_PIPE_HANDLE pipe_hndl, uint32_t event) {
466 \fn void ARM_USBH_SignalPipeEvent (ARM_USBH_PIPE_HANDLE pipe_hndl, uint32_t event)
468 The function \b ARM_USBH_SignalPipeEvent is a callback function registered by the function \ref ARM_USBH_Initialize.
470 The parameter \em pipe_hndl specifies the pipe handle. \n
471 The parameter \em event indicates one or more events that occurred during driver operation.
472 Each event is encoded in a separate bit and therefore it is possible to signal multiple events within the same call.
474 The following events can be generated:
476 Parameter \em event | Bit| Description
477 :-----------------------------------------|---:|:-----------
478 \ref ARM_USBH_EVENT_TRANSFER_COMPLETE | 0 | Occurs after all the data has been transferred without errors.
479 \ref ARM_USBH_EVENT_HANDSHAKE_NAK | 1 | Occurs when NAK Handshake is received before all the data is transferred.
480 \ref ARM_USBH_EVENT_HANDSHAKE_NYET | 2 | Occurs when NYET Handshake is received before all the data is transferred.
481 \ref ARM_USBH_EVENT_HANDSHAKE_MDATA | 3 | Occurs when MDATA Handshake is received before all the data is transferred.
482 \ref ARM_USBH_EVENT_HANDSHAKE_STALL | 4 | Occurs when STALL Handshake is received before all the data is transferred.
483 \ref ARM_USBH_EVENT_HANDSHAKE_ERR | 5 | Occurs when ERR Handshake is received before all the data is transferred.
484 \ref ARM_USBH_EVENT_BUS_ERROR | 6 | Occurs when bus error is detected before all the data is transferred.
487 - ARM_USBH_PipeCreate
488 *****************************************************************************************************************/
497 \defgroup usbh_hci_gr USB OHCI/EHCI
498 \ingroup usbh_interface_gr
499 \brief Driver API for USB OHCI/EHCI
501 OHCI and EHCI compliant interfaces have memory mapped registers that are used to control the USB host.
503 Only certain functionalities (interrupts, VBUS control, power control) require device specific interface which is provided through functions
504 of the struct \ref ARM_DRIVER_USBH_HCI (functionality accessed with the struct \ref ARM_DRIVER_USBH is not needed).
509 \struct ARM_DRIVER_USBH_HCI
511 The functions of the USB Host HCI (OHCI/EHCI) driver are accessed by function pointers. Refer to \ref DriverFunctions for
512 overview information.
514 Each instance of an USBH provides such an access struct. The instance is indicated by
515 a postfix in the symbol name of the access struct, for example:
516 - \b Driver_USBH0_HCI is the name of the access struct of the first instance (no. 0).
517 - \b Driver_USBH1_HCI is the name of the access struct of the second instance (no. 1).
520 A configuration setting in the middleware allows connecting the middleware to a specific driver instance <b>Driver_USBH<i>n</i>_HCI</b>.
521 The default is \token{0}, which connects a middleware to the first instance of a driver.
523 \note The struct must remain unchanged.
528 \struct ARM_USBH_HCI_CAPABILITIES
530 A USB Host HCI (OHCI/EHCI) driver can be implemented with different capabilities.
531 The data fields of this structure encode the capabilities implemented by this driver.
534 - \ref ARM_USBH_HCI_GetCapabilities
536 \note The struct must remain unchanged.
537 *****************************************************************************************************************/
540 \typedef ARM_USBH_HCI_Interrupt_t
542 Provides the typedef for the interrupt handler \ref ARM_USBH_HCI_Interrupt.
544 <b>Parameter for:</b>
545 - \ref ARM_USBH_HCI_Initialize
546 *******************************************************************************************************************/
553 ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion (void) {
557 \fn ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion (void)
559 The function \b ARM_USBH_HCI_GetVersion returns version information of the driver implementation in \ref ARM_DRIVER_VERSION
560 - API version is the version of the CMSIS-Driver specification used to implement this driver.
561 - Driver version is source code version of the actual driver implementation.
565 extern ARM_DRIVER_USBH Driver_USBH0_HCI;
566 ARM_DRIVER_USBH *drv_info;
568 void setup_usbh (void) {
569 ARM_DRIVER_VERSION version;
571 drv_info = &Driver_USBH0_HCI;
572 version = drv_info->GetVersion ();
573 if (version.api < 0x10A) { // requires at minimum API version 1.10 or higher
579 *****************************************************************************************************************/
581 ARM_USBH_HCI_CAPABILITIES ARM_USBH_HCI_GetCapabilities (void) {
585 \fn ARM_USBH_HCI_CAPABILITIES ARM_USBH_HCI_GetCapabilities (void)
587 The function \b ARM_USBH_HCI_GetCapabilities returns information about capabilities in this driver implementation.
588 The data fields of the structure \ref ARM_USBH_HCI_CAPABILITIES encode various capabilities, for example
593 extern ARM_DRIVER_USBH_HCI Driver_USBH0_HCI;
594 ARM_DRIVER_USBH_HCI *drv_info;
596 void read_capabilities (void) {
597 ARM_USBH_HCI_CAPABILITIES drv_capabilities;
599 drv_info = &Driver_USBH0_HCI;
600 drv_capabilities = drv_info->GetCapabilities ();
601 // interrogate capabilities
605 *****************************************************************************************************************/
607 int32_t ARM_USBH_HCI_Initialize (ARM_USBH_HCI_Interrupt_t *cb_interrupt) {
608 return ARM_DRIVER_OK;
611 \fn int32_t ARM_USBH_HCI_Initialize (ARM_USBH_HCI_Interrupt_t *cb_interrupt)
613 The function \b ARM_USBH_HCI_Initialize initializes the USB Host HCI (OHCI/EHCI) interface.
614 It is called when the middleware component starts operation.
616 The function performs the following operations:
617 - Initializes the resources needed for the USBH interface.
618 - Registers the \ref ARM_USBH_HCI_Interrupt interrupt handler.
620 The parameter \em cb_interrupt is a pointer to the interrupt routine of the OHCI/EHCI peripheral
621 that needs to be registered. This function is called as ECHI Interrupt Service Handler.
624 - see \ref usbh_interface_gr - Driver Functions
626 *****************************************************************************************************************/
628 int32_t ARM_USBH_HCI_Uninitialize (void) {
629 return ARM_DRIVER_OK;
632 \fn int32_t ARM_USBH_HCI_Uninitialize (void)
634 The function \ref ARM_USBH_HCI_Uninitialize de-initializes the resources of USB Host HCI (OHCI/EHCI) interface.
636 It is called when the middleware component stops operation and releases the software resources used by the interface.
637 *****************************************************************************************************************/
639 int32_t ARM_USBH_HCI_PowerControl (ARM_POWER_STATE state) {
640 return ARM_DRIVER_OK;
643 \fn int32_t ARM_USBH_HCI_PowerControl (ARM_POWER_STATE state)
645 The function \b ARM_USBH_HCI_PowerControl operates the power modes of the USB Host HCI (OHCI/EHCI) interface.
647 The parameter \em state sets the operation and can have the following values:
648 - \ref ARM_POWER_FULL : set-up peripheral for data transfers, enable interrupts (NVIC) and optionally DMA.
649 Can be called multiple times. If the peripheral is already in this mode the function performs
650 no operation and returns with \ref ARM_DRIVER_OK.
651 - \ref ARM_POWER_LOW : may use power saving. Returns \ref ARM_DRIVER_ERROR_UNSUPPORTED when not implemented.
652 - \ref ARM_POWER_OFF : terminates any pending data transfers, disables peripheral, disables related interrupts and DMA.
654 Refer to \ref CallSequence for more information.
655 *****************************************************************************************************************/
657 int32_t ARM_USBH_HCI_PortVbusOnOff (uint8_t port, bool vbus) {
658 return ARM_DRIVER_OK;
661 \fn int32_t ARM_USBH_HCI_PortVbusOnOff (uint8_t port, bool vbus)
663 The function \b ARM_USBH_HCI_PortVbusOnOff controls the VBUS signal of the specified port.
664 Most HCI complained USB Host controllers do not require this optional function.
665 It is only required when a external VBUS interface (for example via I/O pin) is required.
667 *****************************************************************************************************************/
669 void ARM_USBH_HCI_Interrupt (void) {
673 \fn void ARM_USBH_HCI_Interrupt (void)
675 The function \b ARM_USBH_HCI_Interrupt is called from the USBH HCI Interrupt Handler.
676 *****************************************************************************************************************/
681 // End USBH Interface