M480 BSP V3.05.005
The Board Support Package for M480 Series
Modules | Macros
USB Host Exported Constants

Modules

 USB Host Exported Structures
 
 USB Host Typedef
 

Macros

#define CONFIG_HID_MAX_DEV   4
 
#define CONFIG_HID_DEV_MAX_PIPE   8
 
#define HID_REPORT_GET   0x01
 
#define HID_GET_IDLE   0x02
 
#define HID_GET_PROTOCOL   0x03
 
#define HID_REPORT_SET   0x09
 
#define HID_SET_IDLE   0x0A
 
#define HID_SET_PROTOCOL   0x0B
 
#define RT_INPUT
 
#define RT_OUTPUT
 
#define RT_FEATURE
 
#define USBH_OK   0
 
#define USBH_ERR_MEMORY_OUT   -10
 
#define USBH_ERR_IF_ALT_LIMIT   -11
 
#define USBH_ERR_IF_EP_LIMIT   -15
 
#define USBH_ERR_NOT_SUPPORTED   -101
 
#define USBH_ERR_NOT_MATCHED   -103
 
#define USBH_ERR_NOT_EXPECTED   -104
 
#define USBH_ERR_INVALID_PARAM   -105
 
#define USBH_ERR_NOT_FOUND   -106
 
#define USBH_ERR_EP_NOT_FOUND   -107
 
#define USBH_ERR_DESCRIPTOR   -137
 
#define USBH_ERR_SET_DEV_ADDR   -139
 
#define USBH_ERR_SET_CONFIG   -151
 
#define USBH_ERR_TRANSFER   -201
 
#define USBH_ERR_TIMEOUT   -203
 
#define USBH_ERR_ABORT   -205
 
#define USBH_ERR_PORT_RESET   -255
 
#define USBH_ERR_SCH_OVERRUN   -257
 
#define USBH_ERR_DISCONNECTED   -259
 
#define USBH_ERR_TRANSACTION   -271
 
#define USBH_ERR_BABBLE_DETECTED   -272
 
#define USBH_ERR_DATA_BUFF   -274
 
#define USBH_ERR_CC_NO_ERR   -280
 
#define USBH_ERR_CRC   -281
 
#define USBH_ERR_BIT_STUFF   -282
 
#define USBH_ERR_DATA_TOGGLE   -283
 
#define USBH_ERR_STALL   -284
 
#define USBH_ERR_DEV_NO_RESP   -285
 
#define USBH_ERR_PID_CHECK   -286
 
#define USBH_ERR_UNEXPECT_PID   -287
 
#define USBH_ERR_DATA_OVERRUN   -288
 
#define USBH_ERR_DATA_UNDERRUN   -289
 
#define USBH_ERR_BUFF_OVERRUN   -292
 
#define USBH_ERR_BUFF_UNDERRUN   -293
 
#define USBH_ERR_NOT_ACCESS0   -294
 
#define USBH_ERR_NOT_ACCESS1   -295
 
#define USBH_ERR_OHCI_INIT   -301
 
#define USBH_ERR_OHCI_EP_BUSY   -303
 
#define USBH_ERR_EHCI_INIT   -501
 
#define USBH_ERR_EHCI_QH_BUSY   -503
 
#define UMAS_OK   0
 
#define UMAS_ERR_NO_DEVICE   -1031
 
#define UMAS_ERR_IO   -1033
 
#define UMAS_ERR_INIT_DEVICE   -1035
 
#define UMAS_ERR_CMD_STATUS   -1037
 
#define UMAS_ERR_IVALID_PARM   -1038
 
#define UMAS_ERR_DRIVE_NOT_FOUND   -1039
 
#define HID_RET_OK   0
 
#define HID_RET_DEV_NOT_FOUND   -1081
 
#define HID_RET_IO_ERR   -1082
 
#define HID_RET_INVALID_PARAMETER   -1083
 
#define HID_RET_OUT_OF_MEMORY   -1084
 
#define HID_RET_NOT_SUPPORTED   -1085
 
#define HID_RET_EP_NOT_FOUND   -1086
 
#define HID_RET_PARSING   -1087
 
#define HID_RET_XFER_IS_RUNNING   -1089
 
#define HID_RET_REPORT_NOT_FOUND   -1090
 
#define UAC_RET_OK   0
 
#define UAC_RET_DEV_NOT_FOUND   -2001
 
#define UAC_RET_FUNC_NOT_FOUND   -2002
 
#define UAC_RET_IO_ERR   -2003
 
#define UAC_RET_DATA_LEN   -2004
 
#define UAC_RET_INVALID   -2005
 
#define UAC_RET_OUT_OF_MEMORY   -2007
 
#define UAC_RET_DRV_NOT_SUPPORTED   -2009
 
#define UAC_RET_DEV_NOT_SUPPORTED   -2011
 
#define UAC_RET_PARSER   -2013
 
#define UAC_RET_IS_STREAMING   -2015
 
#define CONFIG_UAC_MAX_DEV   3
 
#define NUM_UTR   2
 
#define UAC_REQ_TIMEOUT   50
 
#define UAC_SPEAKER
 
#define UAC_MICROPHONE
 
#define UAC_SET_CUR   0x01
 
#define UAC_GET_CUR   0x81
 
#define UAC_SET_MIN   0x02
 
#define UAC_GET_MIN   0x82
 
#define UAC_SET_MAX   0x03
 
#define UAC_GET_MAX   0x83
 
#define UAC_SET_RES   0x04
 
#define UAC_GET_RES   0x84
 
#define UAC_GET_STAT   0xFF
 
#define UAC_CH_MASTER
 
#define UAC_CH_LEFT_FRONT
 
#define UAC_CH_RIGHT_FRONT
 
#define UAC_CH_CENTER_FRONT
 
#define UAC_CH_LOW_FREQ_EN
 
#define UAC_CH_LEFT_SRN
 
#define UAC_CH_RIGHT_SRN
 
#define UAC_CH_LEFT_OF_CENTER
 
#define UAC_CH_RIGHT_OF_CENTER
 
#define UAC_CH_SURROUND
 
#define UAC_CH_SIDE_LEFT
 
#define UAC_CH_SIDE_RIGHT
 
#define UAC_CH_TOP
 

Detailed Description

Macro Definition Documentation

◆ CONFIG_HID_DEV_MAX_PIPE

#define CONFIG_HID_DEV_MAX_PIPE   8

Maximum number of interrupt in/out pipes allowed per HID device

Definition at line 53 of file usbh_hid.h.

◆ CONFIG_HID_MAX_DEV

#define CONFIG_HID_MAX_DEV   4

Maximum number of HID devices (interface) allowed at the same time.

Definition at line 52 of file usbh_hid.h.

◆ CONFIG_UAC_MAX_DEV

#define CONFIG_UAC_MAX_DEV   3

Maximum number of Audio Class device.

Definition at line 31 of file usbh_uac.h.

◆ HID_GET_IDLE

#define HID_GET_IDLE   0x02

HID Class command Get_Idle code.

Definition at line 157 of file usbh_hid.h.

◆ HID_GET_PROTOCOL

#define HID_GET_PROTOCOL   0x03

HID Class command Get_Protocol code.

Definition at line 158 of file usbh_hid.h.

◆ HID_REPORT_GET

#define HID_REPORT_GET   0x01

HID Class command Get_Report_Request code.

Definition at line 156 of file usbh_hid.h.

◆ HID_REPORT_SET

#define HID_REPORT_SET   0x09

HID Class command Set_Report_Request code.

Definition at line 159 of file usbh_hid.h.

◆ HID_RET_DEV_NOT_FOUND

#define HID_RET_DEV_NOT_FOUND   -1081

HID device not found or removed.

Definition at line 86 of file usbh_lib.h.

◆ HID_RET_EP_NOT_FOUND

#define HID_RET_EP_NOT_FOUND   -1086

Endpoint not found.

Definition at line 91 of file usbh_lib.h.

◆ HID_RET_INVALID_PARAMETER

#define HID_RET_INVALID_PARAMETER   -1083

Invalid parameter.

Definition at line 88 of file usbh_lib.h.

◆ HID_RET_IO_ERR

#define HID_RET_IO_ERR   -1082

USB transfer failed.

Definition at line 87 of file usbh_lib.h.

◆ HID_RET_NOT_SUPPORTED

#define HID_RET_NOT_SUPPORTED   -1085

Function not supported.

Definition at line 90 of file usbh_lib.h.

◆ HID_RET_OK

#define HID_RET_OK   0

Return with no errors.

Definition at line 85 of file usbh_lib.h.

◆ HID_RET_OUT_OF_MEMORY

#define HID_RET_OUT_OF_MEMORY   -1084

Out of memory.

Definition at line 89 of file usbh_lib.h.

◆ HID_RET_PARSING

#define HID_RET_PARSING   -1087

Failed to parse HID descriptor

Definition at line 92 of file usbh_lib.h.

◆ HID_RET_REPORT_NOT_FOUND

#define HID_RET_REPORT_NOT_FOUND   -1090

The transfer has been enabled.

Definition at line 94 of file usbh_lib.h.

◆ HID_RET_XFER_IS_RUNNING

#define HID_RET_XFER_IS_RUNNING   -1089

The transfer has been enabled.

Definition at line 93 of file usbh_lib.h.

◆ HID_SET_IDLE

#define HID_SET_IDLE   0x0A

HID Class command Set_Idle code.

Definition at line 160 of file usbh_hid.h.

◆ HID_SET_PROTOCOL

#define HID_SET_PROTOCOL   0x0B

HID Class command Set_Protocol code.

Definition at line 161 of file usbh_hid.h.

◆ NUM_UTR

#define NUM_UTR   2

Number of UTR used for audio in/out transfer.

Definition at line 32 of file usbh_uac.h.

◆ RT_FEATURE

#define RT_FEATURE

Report type: Feature

Definition at line 166 of file usbh_hid.h.

◆ RT_INPUT

#define RT_INPUT

Report type: Input

Definition at line 164 of file usbh_hid.h.

◆ RT_OUTPUT

#define RT_OUTPUT

Report type: Output

Definition at line 165 of file usbh_hid.h.

◆ UAC_CH_CENTER_FRONT

#define UAC_CH_CENTER_FRONT

Select Center Front (C) channel.

Definition at line 57 of file usbh_uac.h.

◆ UAC_CH_LEFT_FRONT

#define UAC_CH_LEFT_FRONT

Select Left Front (L) channel.

Definition at line 55 of file usbh_uac.h.

◆ UAC_CH_LEFT_OF_CENTER

#define UAC_CH_LEFT_OF_CENTER

Select Left of Center (LC) channel.

Definition at line 61 of file usbh_uac.h.

◆ UAC_CH_LEFT_SRN

#define UAC_CH_LEFT_SRN

Select Left Surround (LS) channel.

Definition at line 59 of file usbh_uac.h.

◆ UAC_CH_LOW_FREQ_EN

#define UAC_CH_LOW_FREQ_EN

Select Low Frequency Enhancement. (LFE) channel

Definition at line 58 of file usbh_uac.h.

◆ UAC_CH_MASTER

#define UAC_CH_MASTER

Select all channels.

Definition at line 54 of file usbh_uac.h.

◆ UAC_CH_RIGHT_FRONT

#define UAC_CH_RIGHT_FRONT

Select Right Front (R) channel.

Definition at line 56 of file usbh_uac.h.

◆ UAC_CH_RIGHT_OF_CENTER

#define UAC_CH_RIGHT_OF_CENTER

Select Right of Center (RC) channel.

Definition at line 62 of file usbh_uac.h.

◆ UAC_CH_RIGHT_SRN

#define UAC_CH_RIGHT_SRN

Select Right Surround (RS) channel.

Definition at line 60 of file usbh_uac.h.

◆ UAC_CH_SIDE_LEFT

#define UAC_CH_SIDE_LEFT

Select Side Left (SL) channel.

Definition at line 64 of file usbh_uac.h.

◆ UAC_CH_SIDE_RIGHT

#define UAC_CH_SIDE_RIGHT

Select Side Right (SR) channel.

Definition at line 65 of file usbh_uac.h.

◆ UAC_CH_SURROUND

#define UAC_CH_SURROUND

Select Surround (S) channel.

Definition at line 63 of file usbh_uac.h.

◆ UAC_CH_TOP

#define UAC_CH_TOP

Select Top (T) channel.

Definition at line 66 of file usbh_uac.h.

◆ UAC_GET_CUR

#define UAC_GET_CUR   0x81

UAC request to get current value.

Definition at line 42 of file usbh_uac.h.

◆ UAC_GET_MAX

#define UAC_GET_MAX   0x83

UAC request to get upper-bound setting.

Definition at line 46 of file usbh_uac.h.

◆ UAC_GET_MIN

#define UAC_GET_MIN   0x82

UAC request to get lower-bound setting.

Definition at line 44 of file usbh_uac.h.

◆ UAC_GET_RES

#define UAC_GET_RES   0x84

UAC request to get resolution.

Definition at line 48 of file usbh_uac.h.

◆ UAC_GET_STAT

#define UAC_GET_STAT   0xFF

UAC request to get status.

Definition at line 49 of file usbh_uac.h.

◆ UAC_MICROPHONE

#define UAC_MICROPHONE

Control target is microphone of UAC device.

Definition at line 36 of file usbh_uac.h.

◆ UAC_REQ_TIMEOUT

#define UAC_REQ_TIMEOUT   50

UAC control request timeout value in tick (10ms unit)

Definition at line 33 of file usbh_uac.h.

◆ UAC_RET_DATA_LEN

#define UAC_RET_DATA_LEN   -2004

Unexpected transfer length

Definition at line 100 of file usbh_lib.h.

◆ UAC_RET_DEV_NOT_FOUND

#define UAC_RET_DEV_NOT_FOUND   -2001

Audio Class device not found or removed.

Definition at line 97 of file usbh_lib.h.

◆ UAC_RET_DEV_NOT_SUPPORTED

#define UAC_RET_DEV_NOT_SUPPORTED   -2011

Function not supported by the UAC device.

Definition at line 104 of file usbh_lib.h.

◆ UAC_RET_DRV_NOT_SUPPORTED

#define UAC_RET_DRV_NOT_SUPPORTED   -2009

Function not supported by this UAC driver.

Definition at line 103 of file usbh_lib.h.

◆ UAC_RET_FUNC_NOT_FOUND

#define UAC_RET_FUNC_NOT_FOUND   -2002

Audio device has no this function.

Definition at line 98 of file usbh_lib.h.

◆ UAC_RET_INVALID

#define UAC_RET_INVALID   -2005

Invalid parameter or usage.

Definition at line 101 of file usbh_lib.h.

◆ UAC_RET_IO_ERR

#define UAC_RET_IO_ERR   -2003

USB transfer failed.

Definition at line 99 of file usbh_lib.h.

◆ UAC_RET_IS_STREAMING

#define UAC_RET_IS_STREAMING   -2015

Audio pipe is on streaming.

Definition at line 106 of file usbh_lib.h.

◆ UAC_RET_OK

#define UAC_RET_OK   0

Return with no errors.

Definition at line 96 of file usbh_lib.h.

◆ UAC_RET_OUT_OF_MEMORY

#define UAC_RET_OUT_OF_MEMORY   -2007

Out of memory.

Definition at line 102 of file usbh_lib.h.

◆ UAC_RET_PARSER

#define UAC_RET_PARSER   -2013

Failed to parse UAC descriptor

Definition at line 105 of file usbh_lib.h.

◆ UAC_SET_CUR

#define UAC_SET_CUR   0x01

UAC request to set current value.

Definition at line 41 of file usbh_uac.h.

◆ UAC_SET_MAX

#define UAC_SET_MAX   0x03

UAC request to set upper-bound setting.

Definition at line 45 of file usbh_uac.h.

◆ UAC_SET_MIN

#define UAC_SET_MIN   0x02

UAC request to set lower-bound setting.

Definition at line 43 of file usbh_uac.h.

◆ UAC_SET_RES

#define UAC_SET_RES   0x04

UAC request to set resolution.

Definition at line 47 of file usbh_uac.h.

◆ UAC_SPEAKER

#define UAC_SPEAKER

Control target is speaker of UAC device.

Definition at line 35 of file usbh_uac.h.

◆ UMAS_ERR_CMD_STATUS

#define UMAS_ERR_CMD_STATUS   -1037

SCSI command status failed

Definition at line 81 of file usbh_lib.h.

◆ UMAS_ERR_DRIVE_NOT_FOUND

#define UMAS_ERR_DRIVE_NOT_FOUND   -1039

drive not found

Definition at line 83 of file usbh_lib.h.

◆ UMAS_ERR_INIT_DEVICE

#define UMAS_ERR_INIT_DEVICE   -1035

failed to init MSC device

Definition at line 80 of file usbh_lib.h.

◆ UMAS_ERR_IO

#define UMAS_ERR_IO   -1033

Device read/write failed.

Definition at line 79 of file usbh_lib.h.

◆ UMAS_ERR_IVALID_PARM

#define UMAS_ERR_IVALID_PARM   -1038

Invalid parameter.

Definition at line 82 of file usbh_lib.h.

◆ UMAS_ERR_NO_DEVICE

#define UMAS_ERR_NO_DEVICE   -1031

No Mass Stroage Device found.

Definition at line 78 of file usbh_lib.h.

◆ UMAS_OK

#define UMAS_OK   0

No error.

Definition at line 77 of file usbh_lib.h.

◆ USBH_ERR_ABORT

#define USBH_ERR_ABORT   -205

USB transfer aborted due to disconnect or reset

Definition at line 47 of file usbh_lib.h.

◆ USBH_ERR_BABBLE_DETECTED

#define USBH_ERR_BABBLE_DETECTED   -272

A ¡§babble¡¨ is detected during the transaction

Definition at line 53 of file usbh_lib.h.

◆ USBH_ERR_BIT_STUFF

#define USBH_ERR_BIT_STUFF   -282

USB transfer bit stuffing error

Definition at line 58 of file usbh_lib.h.

◆ USBH_ERR_BUFF_OVERRUN

#define USBH_ERR_BUFF_OVERRUN   -292

USB trasfer buffer overrun error

Definition at line 66 of file usbh_lib.h.

◆ USBH_ERR_BUFF_UNDERRUN

#define USBH_ERR_BUFF_UNDERRUN   -293

USB trasfer buffer underrun error

Definition at line 67 of file usbh_lib.h.

◆ USBH_ERR_CC_NO_ERR

#define USBH_ERR_CC_NO_ERR   -280

OHCI CC code - no error

Definition at line 56 of file usbh_lib.h.

◆ USBH_ERR_CRC

#define USBH_ERR_CRC   -281

USB trasfer CRC error

Definition at line 57 of file usbh_lib.h.

◆ USBH_ERR_DATA_BUFF

#define USBH_ERR_DATA_BUFF   -274

Data buffer overrun or underrun

Definition at line 54 of file usbh_lib.h.

◆ USBH_ERR_DATA_OVERRUN

#define USBH_ERR_DATA_OVERRUN   -288

USB trasfer data overrun error

Definition at line 64 of file usbh_lib.h.

◆ USBH_ERR_DATA_TOGGLE

#define USBH_ERR_DATA_TOGGLE   -283

USB trasfer data toggle error

Definition at line 59 of file usbh_lib.h.

◆ USBH_ERR_DATA_UNDERRUN

#define USBH_ERR_DATA_UNDERRUN   -289

USB trasfer data underrun error

Definition at line 65 of file usbh_lib.h.

◆ USBH_ERR_DESCRIPTOR

#define USBH_ERR_DESCRIPTOR   -137

Failed to parse USB descriptors

Definition at line 41 of file usbh_lib.h.

◆ USBH_ERR_DEV_NO_RESP

#define USBH_ERR_DEV_NO_RESP   -285

USB trasfer device no response error

Definition at line 61 of file usbh_lib.h.

◆ USBH_ERR_DISCONNECTED

#define USBH_ERR_DISCONNECTED   -259

USB device was disconnected

Definition at line 50 of file usbh_lib.h.

◆ USBH_ERR_EHCI_INIT

#define USBH_ERR_EHCI_INIT   -501

Failed to initialize EHCI controller.

Definition at line 74 of file usbh_lib.h.

◆ USBH_ERR_EHCI_QH_BUSY

#define USBH_ERR_EHCI_QH_BUSY   -503

the Queue Head is busy.

Definition at line 75 of file usbh_lib.h.

◆ USBH_ERR_EP_NOT_FOUND

#define USBH_ERR_EP_NOT_FOUND   -107

Endpoint not found

Definition at line 40 of file usbh_lib.h.

◆ USBH_ERR_IF_ALT_LIMIT

#define USBH_ERR_IF_ALT_LIMIT   -11

Number of alternative interface > MAX_ALT_PER_IFACE

Definition at line 33 of file usbh_lib.h.

◆ USBH_ERR_IF_EP_LIMIT

#define USBH_ERR_IF_EP_LIMIT   -15

Number of endpoints > MAX_EP_PER_IFACE

Definition at line 34 of file usbh_lib.h.

◆ USBH_ERR_INVALID_PARAM

#define USBH_ERR_INVALID_PARAM   -105

Invalid parameter

Definition at line 38 of file usbh_lib.h.

◆ USBH_ERR_MEMORY_OUT

#define USBH_ERR_MEMORY_OUT   -10

Out of memory.

Definition at line 32 of file usbh_lib.h.

◆ USBH_ERR_NOT_ACCESS0

#define USBH_ERR_NOT_ACCESS0   -294

USB trasfer not accessed error

Definition at line 68 of file usbh_lib.h.

◆ USBH_ERR_NOT_ACCESS1

#define USBH_ERR_NOT_ACCESS1   -295

USB trasfer not accessed error

Definition at line 69 of file usbh_lib.h.

◆ USBH_ERR_NOT_EXPECTED

#define USBH_ERR_NOT_EXPECTED   -104

Unknown or unexpected

Definition at line 37 of file usbh_lib.h.

◆ USBH_ERR_NOT_FOUND

#define USBH_ERR_NOT_FOUND   -106

Device or interface not found

Definition at line 39 of file usbh_lib.h.

◆ USBH_ERR_NOT_MATCHED

#define USBH_ERR_NOT_MATCHED   -103

Not macthed

Definition at line 36 of file usbh_lib.h.

◆ USBH_ERR_NOT_SUPPORTED

#define USBH_ERR_NOT_SUPPORTED   -101

Device/Class/Transfer not supported

Definition at line 35 of file usbh_lib.h.

◆ USBH_ERR_OHCI_EP_BUSY

#define USBH_ERR_OHCI_EP_BUSY   -303

The endpoint is under transfer.

Definition at line 72 of file usbh_lib.h.

◆ USBH_ERR_OHCI_INIT

#define USBH_ERR_OHCI_INIT   -301

Failed to initialize OHIC controller.

Definition at line 71 of file usbh_lib.h.

◆ USBH_ERR_PID_CHECK

#define USBH_ERR_PID_CHECK   -286

USB trasfer PID check failure

Definition at line 62 of file usbh_lib.h.

◆ USBH_ERR_PORT_RESET

#define USBH_ERR_PORT_RESET   -255

Hub port reset failed

Definition at line 48 of file usbh_lib.h.

◆ USBH_ERR_SCH_OVERRUN

#define USBH_ERR_SCH_OVERRUN   -257

USB isochronous schedule overrun

Definition at line 49 of file usbh_lib.h.

◆ USBH_ERR_SET_CONFIG

#define USBH_ERR_SET_CONFIG   -151

Failed to set device configuration

Definition at line 43 of file usbh_lib.h.

◆ USBH_ERR_SET_DEV_ADDR

#define USBH_ERR_SET_DEV_ADDR   -139

Failed to set device address

Definition at line 42 of file usbh_lib.h.

◆ USBH_ERR_STALL

#define USBH_ERR_STALL   -284

USB trasfer STALL error

Definition at line 60 of file usbh_lib.h.

◆ USBH_ERR_TIMEOUT

#define USBH_ERR_TIMEOUT   -203

USB transfer time-out

Definition at line 46 of file usbh_lib.h.

◆ USBH_ERR_TRANSACTION

#define USBH_ERR_TRANSACTION   -271

USB transaction timeout, CRC, Bad PID, etc.

Definition at line 52 of file usbh_lib.h.

◆ USBH_ERR_TRANSFER

#define USBH_ERR_TRANSFER   -201

USB transfer error

Definition at line 45 of file usbh_lib.h.

◆ USBH_ERR_UNEXPECT_PID

#define USBH_ERR_UNEXPECT_PID   -287

USB trasfer unexpected PID error

Definition at line 63 of file usbh_lib.h.

◆ USBH_OK

#define USBH_OK   0

No error.

Definition at line 31 of file usbh_lib.h.