![]() |
CMSIS-Driver
Version 2.02
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. | |
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. | |
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 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. | |
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. | |
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:
Data Fields | ||
---|---|---|
uint32_t | port_mask: 15 | Root HUB available Ports Mask. |
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_CAPABILITIES ARM_USBH_HCI_GetCapabilities | ( | void | ) |
Get driver 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:
ARM_DRIVER_VERSION ARM_USBH_HCI_GetVersion | ( | void | ) |
Get USB Host HCI (OHCI/EHCI) driver version.
Returns version information of the driver implementation in ARM_DRIVER_VERSION
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 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.
Example:
void ARM_USBH_HCI_Interrupt | ( | void | ) |
USB Host HCI Interrupt Handler.
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 |
|
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.
[in] | state | Power state |
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.
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.