| CMSIS-Driver Version 2.02 Peripheral Interface for Middleware and Application Code

- CMSIS
- CORE
- Driver
- DSP
- RTOS API
- Pack
- SVD

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
USB OHCI/EHCI
USB Host Interface

Driver API for USB OHCI/EHCI. More...

## Data Structures

struct | ARM_DRIVER_USBH_HCI
| Access structure of USB Host HCI (OHCI/EHCI) Driver. More...
struct | ARM_USBH_HCI_CAPABILITIES
| USB Host HCI (OHCI/EHCI) Driver Capabilities. More...

## Typedefs

typedef void(* | ARM_USBH_HCI_Interrupt_t )(void)
| Pointer to Interrupt Handler Routine.

## Functions

ARM_DRIVER_VERSION | ARM_USBH_HCI_GetVersion (void)
| Get USB Host HCI (OHCI/EHCI) driver version.
ARM_USBH_HCI_CAPABILITIES | ARM_USBH_HCI_GetCapabilities (void)
| Get driver capabilities.
int32_t | ARM_USBH_HCI_Initialize (ARM_USBH_HCI_Interrupt_t *cb_interrupt)
| Initialize USB Host HCI (OHCI/EHCI) Interface.
int32_t | ARM_USBH_HCI_Uninitialize (void)
| De-initialize USB Host HCI (OHCI/EHCI) Interface.
int32_t | ARM_USBH_HCI_PowerControl (ARM_POWER_STATE state)
| Control USB Host HCI (OHCI/EHCI) Interface Power.
int32_t | ARM_USBH_HCI_PortVbusOnOff (uint8_t port, bool vbus)
| USB Host HCI (OHCI/EHCI) Root HUB Port VBUS on/off.
void | ARM_USBH_HCI_Interrupt (void)
| USB Host HCI Interrupt Handler.

## Description

Driver API for USB OHCI/EHCI.

OHCI and EHCI compliant interfaces have memory mapped registers that are used to control the USB host.

Only certain functionalities (interrupts, VBUS control, power control) require device specific interface which is provided through functions of the struct ARM_DRIVER_USBH_HCI (functionality accessed with the struct ARM_DRIVER_USBH is not needed).

## Data Structure Documentation

struct ARM_DRIVER_USBH_HCI

Access structure of USB Host HCI (OHCI/EHCI) Driver.

The functions of the USB Host HCI (OHCI/EHCI) driver are accessed by function pointers. Refer to Driver Functions for overview information.

Each instance of an USBH provides such an access struct. The instance is indicated by a postfix in the symbol name of the access struct, for example:

- Driver_USBH0_HCI is the name of the access struct of the first instance (no. 0).
- Driver_USBH1_HCI is the name of the access struct of the second instance (no. 1).

A configuration setting in the middleware allows connecting the middleware to a specific driver instance Driver_USBHn_HCI. The default is 0, which connects a middleware to the first instance of a driver.

Note
  The struct must remain unchanged.

### Data Fields

ARM_DRIVER_VERSION(* | GetVersion )(void)
| Pointer to ARM_USBH_HCI_GetVersion : Get USB Host HCI (OHCI/EHCI) driver version.
ARM_USBH_HCI_CAPABILITIES(* | GetCapabilities )(void)
| Pointer to ARM_USBH_HCI_GetCapabilities : Get driver capabilities.
int32_t(* | Initialize )(ARM_USBH_HCI_Interrupt_t cb_interrupt)
| Pointer to ARM_USBH_HCI_Initialize : Initialize USB Host HCI (OHCI/EHCI) Interface.
int32_t(* | Uninitialize )(void)
| Pointer to ARM_USBH_HCI_Uninitialize : De-initialize USB Host HCI (OHCI/EHCI) Interface.
int32_t(* | PowerControl )(ARM_POWER_STATE state)
| Pointer to ARM_USBH_HCI_PowerControl : Control USB Host HCI (OHCI/EHCI) Interface Power.
int32_t(* | PortVbusOnOff )(uint8_t port, bool vbus)
| Pointer to ARM_USBH_HCI_PortVbusOnOff : USB Host HCI (OHCI/EHCI) Root HUB Port VBUS on/off.

#### Field Documentation

ARM_USBH_HCI_CAPABILITIES(* GetCapabilities)(void)

Pointer to ARM_USBH_HCI_GetCapabilities : Get driver capabilities.

ARM_DRIVER_VERSION(* GetVersion)(void)

Pointer to ARM_USBH_HCI_GetVersion : Get USB Host HCI (OHCI/EHCI) driver version.

int32_t(* Initialize)(ARM_USBH_HCI_Interrupt_t cb_interrupt)

Pointer to ARM_USBH_HCI_Initialize : Initialize USB Host HCI (OHCI/EHCI) Interface.

int32_t(* PortVbusOnOff)(uint8_t port, bool vbus)

Pointer to ARM_USBH_HCI_PortVbusOnOff : USB Host HCI (OHCI/EHCI) Root HUB Port VBUS on/off.

int32_t(* PowerControl)(ARM_POWER_STATE state)

Pointer to ARM_USBH_HCI_PowerControl : Control USB Host HCI (OHCI/EHCI) Interface Power.

int32_t(* Uninitialize)(void)

Pointer to ARM_USBH_HCI_Uninitialize : De-initialize USB Host HCI (OHCI/EHCI) Interface.

struct ARM_USBH_HCI_CAPABILITIES

USB Host HCI (OHCI/EHCI) Driver Capabilities.

A USB Host HCI (OHCI/EHCI) driver can be implemented with different capabilities. The bitfield members of this struct encode the capabilities implemented by this driver.

Returned by:

- ARM_USBH_HCI_GetCapabilities

Note
  The struct must remain unchanged.

Data Fields
uint32_t | port_mask: 15 | Root HUB available Ports Mask.

## Typedef Documentation

ARM_USBH_HCI_Interrupt_t

Pointer to Interrupt Handler Routine.

Provides the typedef for the interrupt handler ARM_USBH_HCI_Interrupt.

Parameter for:

- ARM_USBH_HCI_Initialize

## Function Documentation

ARM_USBH_HCI_CAPABILITIES ARM_USBH_HCI_GetCapabilities | ( | void |  | ) |

Get driver capabilities.

Returns
  ARM_USBH_HCI_CAPABILITIES

Retrieves information about capabilities in this driver implementation. The bitfield members of the struct ARM_USBH_HCI_CAPABILITIES encode various capabilities, for example available HUB ports.

Example:

extern ARM_DRIVER_USBH_HCI Driver_USBH0_HCI;
ARM_DRIVER_USBH_HCI *drv_info;
void read_capabilities (void) {
ARM_USBH_HCI_CAPABILITIES drv_capabilities;
drv_info = &Driver_USBH0_HCI;
drv_capabilities = drv_info->GetCapabilities ();
// interrogate capabilities
}

ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion | ( | void |  | ) |

Get USB Host HCI (OHCI/EHCI) driver version.

Returns
  ARM_DRIVER_VERSION

Returns version information of the driver implementation in ARM_DRIVER_VERSION

- API version is the version of the CMSIS-Driver specification used to implement this driver.
- Driver version is source code version of the actual driver implementation.

Example:

extern ARM_DRIVER_USBH Driver_USBH0_HCI;
ARM_DRIVER_USBH *drv_info;
void setup_usbh (void) {
ARM_DRIVER_VERSION version;
drv_info = &Driver_USBH0_HCI;
version = drv_info->GetVersion ();
if (version.api < 0x10A) { // requires at minimum API version 1.10 or higher
// error handling
return;
}
}

int32_t ARM_USBH_HCI_Initialize | ( | ARM_USBH_HCI_Interrupt_t * | cb_interrupt | ) |

Initialize USB Host HCI (OHCI/EHCI) Interface.

Parameters

  [in] | cb_interrupt | Pointer to Interrupt Handler Routine

Returns
  Status Error Codes

The function initializes the USB Host HCI (OHCI/EHCI) interface. It is called when the middleware component starts operation.

The function performs the following operations:

- Initializes the resources needed for the USBH interface.
- Registers the ARM_USBH_HCI_Interrupt interrupt handler.

The parameter cb_interrupt is a pointer to the interrupt routine of the OHCI/EHCI peripheral.

Example:

- see USB Host Interface - Driver Functions

void ARM_USBH_HCI_Interrupt | ( | void |  | ) |

USB Host HCI Interrupt Handler.

Returns
  none

int32_t ARM_USBH_HCI_PortVbusOnOff | ( | uint8_t | port,
|  | bool | vbus
| ) |  |

USB Host HCI (OHCI/EHCI) Root HUB Port VBUS on/off.

Parameters

  [in] | port | Root HUB Port Number

  [in]

  vbus

  - false VBUS off
  - true VBUS on

Returns
  Status Error Codes

Allows you to control the VBUS signal of the specified port.

int32_t ARM_USBH_HCI_PowerControl | ( | ARM_POWER_STATE | state | ) |

Control USB Host HCI (OHCI/EHCI) Interface Power.

Parameters

  [in] | state | Power state

Returns
  Status Error Codes

Allows you to control the power modes of the USB Host HCI (OHCI/EHCI) interface.

int32_t ARM_USBH_HCI_Uninitialize | ( | void |  | ) |

De-initialize USB Host HCI (OHCI/EHCI) Interface.

Returns
  Status Error Codes

The function ARM_USBH_HCI_Uninitialize de-initializes the resources of USB Host HCI (OHCI/EHCI) interface.

It is called when the middleware component stops operation and releases the software resources used by the interface.