NetBurner 3.5.7
PDF Version
Usb_host_controller_ehci

Classes

struct  _usb_host_ehci_pipe
 EHCI pipe structure. More...
 
struct  _usb_host_ehci_qh
 EHCI QH structure. See the USB EHCI specification. More...
 
struct  _usb_host_ehci_qtd
 EHCI QTD structure. See the USB EHCI specification. More...
 
struct  _usb_host_ehci_itd
 EHCI ITD structure. See the USB EHCI specification. More...
 
struct  _usb_host_ehci_sitd
 EHCI SITD structure. See the USB EHCI specification. More...
 
struct  _usb_host_ehci_iso
 EHCI ISO structure; An ISO pipe has an instance of this structure to keep the ISO pipe-specific information. More...
 
struct  _usb_host_ehci_instance
 EHCI instance structure. More...
 
struct  _usb_host_ehci_data
 EHCI data structure. More...
 

Macros

#define USB_HOST_EHCI_ISO_NUMBER   USB_HOST_CONFIG_EHCI_MAX_ITD
 The maximum supported ISO pipe number.
 
#define USB_HOST_EHCI_PORT_CONNECT_DEBOUNCE_DELAY   (101U)
 Check the port connect state delay if the state is unstable.
 
#define USB_HOST_EHCI_PORT_RESET_DELAY   (11U)
 Delay for port reset.
 
#define USB_HOST_EHCI_ISO_MAX_CONTINUOUS_TRANSFER   (8U)
 The MAX continuous transfers that application can send.
 
#define USB_HOST_EHCI_ISO_BOUNCE_FRAME_NUMBER   (2U)
 The SITD inserts a frame interval for putting more SITD continuously. There is an interval when an application sends two FS/LS ISO transfers. When the interval is less than the macro, the two transfers are continuous in the frame list. Otherwise, the two transfers are not continuous. For example:
 
#define USB_HOST_EHCI_ISO_BOUNCE_UFRAME_NUMBER   (16U)
 The ITD inserts a micro-frame interval for putting more ITD continuously. There is an interval when an application sends two HS ISO transfers. When the interval is less than the macro, the two transfers are continuous in the frame list. Otherwise, the two transfers are not continuous. For example:
 
#define USB_HOST_EHCI_CONTROL_BULK_TIME_OUT_VALUE   (50U)
 Control or bulk transaction timeout value (unit: 100 ms)
 

Typedefs

typedef enum _host_ehci_device_state_ host_ehci_device_state_t
 EHCI state for device attachment/detachment.
 
typedef struct _usb_host_ehci_pipe usb_host_ehci_pipe_t
 EHCI pipe structure.
 
typedef struct _usb_host_ehci_qh usb_host_ehci_qh_t
 EHCI QH structure. See the USB EHCI specification.
 
typedef struct _usb_host_ehci_qtd usb_host_ehci_qtd_t
 EHCI QTD structure. See the USB EHCI specification.
 
typedef struct _usb_host_ehci_itd usb_host_ehci_itd_t
 EHCI ITD structure. See the USB EHCI specification.
 
typedef struct _usb_host_ehci_sitd usb_host_ehci_sitd_t
 EHCI SITD structure. See the USB EHCI specification.
 
typedef struct _usb_host_ehci_iso usb_host_ehci_iso_t
 EHCI ISO structure; An ISO pipe has an instance of this structure to keep the ISO pipe-specific information.
 
typedef struct _usb_host_ehci_instance usb_host_ehci_instance_t
 EHCI instance structure.
 
typedef struct _usb_host_ehci_data usb_host_ehci_data_t
 EHCI data structure.
 

Enumerations

enum  _host_ehci_device_state_ { kEHCIDevicePhyAttached = 1 , kEHCIDeviceAttached , kEHCIDeviceDetached }
 EHCI state for device attachment/detachment. More...
 

USB host EHCI APIs

usb_status_t USB_HostEhciCreate (uint8_t controllerId, usb_host_handle upperLayerHandle, usb_host_controller_handle *controllerHandle)
 Creates the USB host EHCI instance.
 
usb_status_t USB_HostEhciDestory (usb_host_controller_handle controllerHandle)
 Destroys the USB host EHCI instance.
 
usb_status_t USB_HostEhciOpenPipe (usb_host_controller_handle controllerHandle, usb_host_pipe_handle *pipeHandle, usb_host_pipe_init_t *pipeInit)
 Opens the USB host pipe.
 
usb_status_t USB_HostEhciClosePipe (usb_host_controller_handle controllerHandle, usb_host_pipe_handle pipeHandle)
 Closes the USB host pipe.
 
usb_status_t USB_HostEhciWritePipe (usb_host_controller_handle controllerHandle, usb_host_pipe_handle pipeHandle, usb_host_transfer_t *transfer)
 Sends data to the pipe.
 
usb_status_t USB_HostEhciReadpipe (usb_host_controller_handle controllerHandle, usb_host_pipe_handle pipeHandle, usb_host_transfer_t *transfer)
 Receives data from the pipe.
 
usb_status_t USB_HostEhciIoctl (usb_host_controller_handle controllerHandle, uint32_t ioctlEvent, void *ioctlParam)
 Controls the EHCI.
 

Detailed Description

Macro Definition Documentation

◆ USB_HOST_EHCI_ISO_BOUNCE_FRAME_NUMBER

#define USB_HOST_EHCI_ISO_BOUNCE_FRAME_NUMBER   (2U)

#include <usb_host_ehci.h>

The SITD inserts a frame interval for putting more SITD continuously. There is an interval when an application sends two FS/LS ISO transfers. When the interval is less than the macro, the two transfers are continuous in the frame list. Otherwise, the two transfers are not continuous. For example:

  • Use case 1: when inserting the SITD first, the inserted frame = the current frame value + this MACRO value.
  • Use case 2: when inserting SITD is not first, choose between the last inserted frame value and the current frame value according to the following criteria: If the interval is less than the MACRO value, the new SITD is continuous with the last SITD. If not, the new SITD inserting frame = the current frame value + this MACRO value.

◆ USB_HOST_EHCI_ISO_BOUNCE_UFRAME_NUMBER

#define USB_HOST_EHCI_ISO_BOUNCE_UFRAME_NUMBER   (16U)

#include <usb_host_ehci.h>

The ITD inserts a micro-frame interval for putting more ITD continuously. There is an interval when an application sends two HS ISO transfers. When the interval is less than the macro, the two transfers are continuous in the frame list. Otherwise, the two transfers are not continuous. For example:

  • Use case 1: when inserting ITD first, the inserted micro-frame = the current micro-frame value + this MACRO value.
  • Use case 2: when inserting ITD is not first, choose between the last inserted micro-frame value and the current micro-frame value according to the following criteria: If the interval is less than this MACRO value, the new ITD is continuous with the last ITD. If not, the new ITD inserting micro-frame = the current micro-frame value + this MACRO value.

Enumeration Type Documentation

◆ _host_ehci_device_state_

#include <usb_host_ehci.h>

EHCI state for device attachment/detachment.

Enumerator
kEHCIDevicePhyAttached 

Device is physically attached

kEHCIDeviceAttached 

Device is attached and initialized

kEHCIDeviceDetached 

Device is detached and de-initialized

Function Documentation

◆ USB_HostEhciClosePipe()

usb_status_t USB_HostEhciClosePipe ( usb_host_controller_handle controllerHandle,
usb_host_pipe_handle pipeHandle )
extern

#include <usb_host_ehci.h>

Closes the USB host pipe.

This function closes a pipe and releases related resources.

Parameters
[in]controllerHandleThe controller handle.
[in]pipeHandleThe closing pipe handle.
Return values
kStatus_USB_SuccessThe host is initialized successfully.

◆ USB_HostEhciCreate()

usb_status_t USB_HostEhciCreate ( uint8_t controllerId,
usb_host_handle upperLayerHandle,
usb_host_controller_handle * controllerHandle )
extern

#include <usb_host_ehci.h>

Creates the USB host EHCI instance.

This function initializes the USB host EHCI controller driver.

Parameters
[in]controllerIdThe controller ID of the USB IP. Please refer to the enumeration usb_controller_index_t.
[in]upperLayerHandleThe host level handle.
[out]controllerHandlereturn the controller instance handle.
Return values
kStatus_USB_SuccessThe host is initialized successfully.
kStatus_USB_AllocFailAllocating memory failed.
kStatus_USB_ErrorHost mutex create fail, KHCI/EHCI mutex or KHCI/EHCI event create fail. Or, KHCI/EHCI IP initialize fail.

◆ USB_HostEhciDestory()

usb_status_t USB_HostEhciDestory ( usb_host_controller_handle controllerHandle)
extern

#include <usb_host_ehci.h>

Destroys the USB host EHCI instance.

This function de-initializes The USB host EHCI controller driver.

Parameters
[in]controllerHandleThe controller handle.
Return values
kStatus_USB_SuccessThe host is initialized successfully.

◆ USB_HostEhciIoctl()

usb_status_t USB_HostEhciIoctl ( usb_host_controller_handle controllerHandle,
uint32_t ioctlEvent,
void * ioctlParam )
extern

#include <usb_host_ehci.h>

Controls the EHCI.

This function controls the EHCI.

Parameters
[in]controllerHandleThe controller handle.
[in]ioctlEventSee enumeration host_bus_control_t.
[in]ioctlParamThe control parameter.
Return values
kStatus_USB_SuccessCancel successfully.
kStatus_USB_InvalidHandleThe controllerHandle is a NULL pointer.

◆ USB_HostEhciOpenPipe()

usb_status_t USB_HostEhciOpenPipe ( usb_host_controller_handle controllerHandle,
usb_host_pipe_handle * pipeHandle,
usb_host_pipe_init_t * pipeInit )
extern

#include <usb_host_ehci.h>

Opens the USB host pipe.

This function opens a pipe according to the pipe_init_ptr parameter.

Parameters
[in]controllerHandleThe controller handle.
[out]pipeHandleThe pipe handle pointer, it is used to return the pipe handle.
[in]pipeInitIt is used to initialize the pipe.
Return values
kStatus_USB_SuccessThe host is initialized successfully.
kStatus_USB_ErrorThere is no idle pipe. Or, there is no idle QH for EHCI. Or, bandwidth allocate fail for EHCI.

◆ USB_HostEhciReadpipe()

usb_status_t USB_HostEhciReadpipe ( usb_host_controller_handle controllerHandle,
usb_host_pipe_handle pipeHandle,
usb_host_transfer_t * transfer )
extern

#include <usb_host_ehci.h>

Receives data from the pipe.

This function requests to receive the transfer from the specified pipe.

Parameters
[in]controllerHandleThe controller handle.
[in]pipeHandleThe receiving pipe handle.
[in]transferThe transfer information.
Return values
kStatus_USB_SuccessSend successfully.
kStatus_USB_LackSwapBufferThere is no swap buffer for KHCI.
kStatus_USB_ErrorThere is no idle QTD/ITD/SITD for EHCI.

◆ USB_HostEhciWritePipe()

usb_status_t USB_HostEhciWritePipe ( usb_host_controller_handle controllerHandle,
usb_host_pipe_handle pipeHandle,
usb_host_transfer_t * transfer )
extern

#include <usb_host_ehci.h>

Sends data to the pipe.

This function requests to send the transfer to the specified pipe.

Parameters
[in]controllerHandleThe controller handle.
[in]pipeHandleThe sending pipe handle.
[in]transferThe transfer information.
Return values
kStatus_USB_SuccessSent successfully.
kStatus_USB_LackSwapBufferThere is no swap buffer for KHCI.
kStatus_USB_ErrorThere is no idle QTD/ITD/SITD for EHCI.