MT2523 API Reference  LinkIt SDK v4
Enum.
HAL » USB

Overview

Enumerations

enum  hal_usb_status_t {
  HAL_USB_STATUS_INVALID_PARAMETER = -2,
  HAL_USB_STATUS_ERROR = -1,
  HAL_USB_STATUS_OK = 0
}
 USB status. More...
 
enum  hal_usb_power_state_t {
  HAL_USB_POWER_STATE_NORMAL = 0,
  HAL_USB_POWER_STATE_SUSPEND
}
 USB power state. More...
 
enum  hal_usb_dma_type_t {
  HAL_USB_DMA0_TYPE = 0,
  HAL_USB_DMA1_TYPE
}
 USB DMA usage type. More...
 
enum  hal_usb_dma_usage_t {
  HAL_USB_EP_USE_NO_DMA = 0,
  HAL_USB_EP_USE_ONLY_DMA
}
 USB DMA usage. More...
 
enum  hal_usb_test_mode_type_t {
  HAL_USB_TEST_MODE_TYPE_NONE = 0,
  HAL_USB_TEST_MODE_TYPE_J,
  HAL_USB_TEST_MODE_TYPE_K,
  HAL_USB_TEST_MODE_TYPE_SE0_NAK,
  HAL_USB_TEST_MODE_TYPE_PACKET
}
 USB Test Mode. More...
 
enum  hal_usb_endpoint_direction_t {
  HAL_USB_EP_DIRECTION_TX = 0,
  HAL_USB_EP_DIRECTION_RX
}
 This is the direction of USB endpoint. More...
 
enum  hal_usb_endpoint_transfer_type_t {
  HAL_USB_EP_TRANSFER_CTRL = 0,
  HAL_USB_EP_TRANSFER_BULK,
  HAL_USB_EP_TRANSFER_INTR,
  HAL_USB_EP_TRANSFER_ISO
}
 Endpoint type defined in USB 2.0 Specification. More...
 
enum  hal_usb_endpoint_state_t {
  HAL_USB_EP_STATE_DISABLE = 0,
  HAL_USB_EP_STATE_FIFO,
  HAL_USB_EP_STATE_DMA
}
 Endpoint state. More...
 
enum  hal_usb_endpoint_0_driver_state_t {
  HAL_USB_EP0_DRV_STATE_READ_END = 0,
  HAL_USB_EP0_DRV_STATE_WRITE_RDY,
  HAL_USB_EP0_DRV_STATE_TRANSACTION_END,
  HAL_USB_EP0_DRV_STATE_CLEAR_SENT_STALL
}
 Endpoint 0 hardware control state. More...
 
enum  hal_usb_driver_handler_type_t {
  HAL_USB_DRV_HDLR_RESET = 0,
  HAL_USB_DRV_HDLR_SUSPEND,
  HAL_USB_DRV_HDLR_RESUME,
  HAL_USB_DRV_HDLR_EP0,
  HAL_USB_DRV_HDLR_EP_TX,
  HAL_USB_DRV_HDLR_EP_RX
}
 Interrupt handler type. More...
 
enum  hal_usb_set_address_state_t {
  HAL_USB_SET_ADDR_DATA = 0,
  HAL_USB_SET_ADDR_STATUS
}
 The set address action may be different for different hardware. More...
 

Enumeration Type Documentation

USB DMA usage type.

Enumerator
HAL_USB_DMA0_TYPE 

Single packet operation.

HAL_USB_DMA1_TYPE 

Multiple packets operation.

USB DMA usage.

Enumerator
HAL_USB_EP_USE_NO_DMA 

Endpoint use with PIO mode.

HAL_USB_EP_USE_ONLY_DMA 

Endpoint use with DMA mode.

Interrupt handler type.

Enumerator
HAL_USB_DRV_HDLR_RESET 

USB bus reset callback function.

HAL_USB_DRV_HDLR_SUSPEND 

USB bus suspended callback function.

HAL_USB_DRV_HDLR_RESUME 

USB bus resumed callback function.

HAL_USB_DRV_HDLR_EP0 

USB endpoint 0 callback function.

HAL_USB_DRV_HDLR_EP_TX 

USB endpoint n TX callback function.

HAL_USB_DRV_HDLR_EP_RX 

USB endpoint n RX callback function.

Endpoint 0 hardware control state.

Enumerator
HAL_USB_EP0_DRV_STATE_READ_END 

Control pipe data is received.

The hardware will acknowledge this data.

HAL_USB_EP0_DRV_STATE_WRITE_RDY 

Data is sent to the USB FIFO.

HAL_USB_EP0_DRV_STATE_TRANSACTION_END 

The contol pipe transaction is complete.

HAL_USB_EP0_DRV_STATE_CLEAR_SENT_STALL 

Clear contol pipe stall status.

This is the direction of USB endpoint.

The direction is based on the USB device's view.

Enumerator
HAL_USB_EP_DIRECTION_TX 

PC IN, such as BULK_IN is HAL_USB_EP_TX_DIR.

HAL_USB_EP_DIRECTION_RX 

PC OUT, such as BULK_OUT is HAL_USB_EP_RX_DIR.

Endpoint state.

Enumerator
HAL_USB_EP_STATE_DISABLE 

The endpoint is disabled.

HAL_USB_EP_STATE_FIFO 

The endpoint operates in the PIO mode.

HAL_USB_EP_STATE_DMA 

The endpoint operates in the DMA mode.

Endpoint type defined in USB 2.0 Specification.

CTRL, BULK, INTR, ISO endpoint

Enumerator
HAL_USB_EP_TRANSFER_CTRL 

The transfer type defined in USB 2.0 Specification, control pipe.

HAL_USB_EP_TRANSFER_BULK 

The transfer type defined in USB 2.0 Specification, bulk pipe.

HAL_USB_EP_TRANSFER_INTR 

The transfer type defined in USB 2.0 Specification, interrupt pipe.

HAL_USB_EP_TRANSFER_ISO 

The transfer type defined in USB 2.0 Specification, isochronous pipe.

USB power state.

Enumerator
HAL_USB_POWER_STATE_NORMAL 

The maximum current consumption cannot exceed 500mA in HAL_USB_POWER_STATE_NORMAL state.

HAL_USB_POWER_STATE_SUSPEND 

The maximum current consumption cannot exceed 2.5mA in HAL_USB_POWER_STATE_SUSPEND state.

The set address action may be different for different hardware.

This is the current state for the set address function.

Enumerator
HAL_USB_SET_ADDR_DATA 

Control pipe received a SET_ADDRESS data.

HAL_USB_SET_ADDR_STATUS 

Control pipe acknowledged the SET_ADDRESS command status.

USB status.

Enumerator
HAL_USB_STATUS_INVALID_PARAMETER 

An invalid parameter was given.

HAL_USB_STATUS_ERROR 

The function call failed.

HAL_USB_STATUS_OK 

The function call was successful.

USB Test Mode.

Used in the USB compliance test.

Enumerator
HAL_USB_TEST_MODE_TYPE_NONE 

NOT in test mode.

HAL_USB_TEST_MODE_TYPE_J 

The Test_J test mode.

In this mode, the USB2.0 controller transmits a continuous J on the bus.

HAL_USB_TEST_MODE_TYPE_K 

The Test_K test mode.

In this mode, the USB2.0 controller transmits a continuous K on the bus.

HAL_USB_TEST_MODE_TYPE_SE0_NAK 

The Test_SE0_NAK test mode.

In this mode, the USB2.0 controller remains in High-speed mode but responds to any valid IN token with a NAK.

HAL_USB_TEST_MODE_TYPE_PACKET 

The Test_Packet test mode.

In this mode, the USB2.0 controller repetitively transmits on the bus a 53-byte test packet, in the form which is defined in the Universal Serial Bus Specification Revision 2.0, Section 7.1.20. Note: The test packet has a fixed format and must be loaded into the Endpoint 0 FIFO before the test mode is entered. USB2.0 IP only