CMSIS-Driver  Version 2.6.0
Peripheral Interface for Middleware and Application Code
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USB OHCI/EHCI

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. More...
 

Functions

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

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 Common 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. More...
 
ARM_USBH_HCI_CAPABILITIES(* GetCapabilities )(void)
 Pointer to ARM_USBH_HCI_GetCapabilities : Get driver capabilities. More...
 
int32_t(* Initialize )(ARM_USBH_HCI_Interrupt_t cb_interrupt)
 Pointer to ARM_USBH_HCI_Initialize : Initialize USB Host HCI (OHCI/EHCI) Interface. More...
 
int32_t(* Uninitialize )(void)
 Pointer to ARM_USBH_HCI_Uninitialize : De-initialize USB Host HCI (OHCI/EHCI) Interface. More...
 
int32_t(* PowerControl )(ARM_POWER_STATE state)
 Pointer to ARM_USBH_HCI_PowerControl : Control USB Host HCI (OHCI/EHCI) Interface Power. More...
 
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. More...
 

Field Documentation

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.

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 data fields of this structure encode the capabilities implemented by this driver.

Returned by:

Note
The struct must remain unchanged.
Data Fields
uint32_t port_mask: 15 Root HUB available Ports Mask.
uint32_t reserved: 17 Reserved (must be zero)

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:

Function Documentation

ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion ( void  )

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

Returns
ARM_DRIVER_VERSION

The function ARM_USBH_HCI_GetVersion 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) {
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;
}
}
ARM_USBH_HCI_CAPABILITIES ARM_USBH_HCI_GetCapabilities ( void  )

Get driver capabilities.

Returns
ARM_USBH_HCI_CAPABILITIES

The function ARM_USBH_HCI_GetCapabilities returns information about capabilities in this driver implementation. The data fields of the structure ARM_USBH_HCI_CAPABILITIES encode various capabilities, for example available HUB ports.

Example:

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

Initialize USB Host HCI (OHCI/EHCI) Interface.

Parameters
[in]cb_interruptPointer to Interrupt Handler Routine
Returns
Status Error Codes

The function ARM_USBH_HCI_Initialize 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 that needs to be registered. This function is called as ECHI Interrupt Service Handler.

Example:

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.

int32_t ARM_USBH_HCI_PowerControl ( ARM_POWER_STATE  state)

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

Parameters
[in]statePower state
Returns
Status Error Codes

The function ARM_USBH_HCI_PowerControl operates the power modes of the USB Host HCI (OHCI/EHCI) interface.

The parameter state sets the operation and can have the following values:

  • ARM_POWER_FULL : set-up peripheral for data transfers, enable interrupts (NVIC) and optionally DMA. Can be called multiple times. If the peripheral is already in this mode the function performs no operation and returns with ARM_DRIVER_OK.
  • ARM_POWER_LOW : may use power saving. Returns ARM_DRIVER_ERROR_UNSUPPORTED when not implemented.
  • ARM_POWER_OFF : terminates any pending data transfers, disables peripheral, disables related interrupts and DMA.

Refer to Function Call Sequence for more information.

int32_t ARM_USBH_HCI_PortVbusOnOff ( uint8_t  port,
bool  vbus 
)

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

Parameters
[in]portRoot HUB Port Number
[in]vbus
  • false VBUS off
  • true VBUS on
Returns
Status Error Codes

The function ARM_USBH_HCI_PortVbusOnOff controls the VBUS signal of the specified port. Most HCI complained USB Host controllers do not require this optional function. It is only required when a external VBUS interface (for example via I/O pin) is required.

void ARM_USBH_HCI_Interrupt ( void  )

USB Host HCI Interrupt Handler.

Returns
none

The function ARM_USBH_HCI_Interrupt is called from the USBH HCI Interrupt Handler.