CMSIS-Driver
Version 2.8.0
Peripheral Interface for Middleware and Application Code
|
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... | |
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).
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:
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.
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... | |
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:
Data Fields | ||
---|---|---|
uint32_t | port_mask: 15 | Root HUB available Ports Mask. |
uint32_t | reserved: 17 | Reserved (must be zero) |
ARM_USBH_HCI_Interrupt_t |
Pointer to Interrupt Handler Routine.
Provides the typedef for the interrupt handler ARM_USBH_HCI_Interrupt.
Parameter for:
ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion | ( | void | ) |
Get USB Host HCI (OHCI/EHCI) driver version.
The function ARM_USBH_HCI_GetVersion returns version information of the driver implementation in ARM_DRIVER_VERSION
Example:
ARM_USBH_HCI_CAPABILITIES ARM_USBH_HCI_GetCapabilities | ( | void | ) |
Get driver 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:
int32_t ARM_USBH_HCI_Initialize | ( | ARM_USBH_HCI_Interrupt_t * | cb_interrupt | ) |
Initialize USB Host HCI (OHCI/EHCI) Interface.
[in] | cb_interrupt | Pointer to Interrupt Handler Routine |
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:
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.
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.
[in] | state | Power state |
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:
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.
[in] | port | Root HUB Port Number |
[in] | vbus |
|
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.
The function ARM_USBH_HCI_Interrupt is called from the USBH HCI Interrupt Handler.