Modules | Classes | Macros | Typedefs | Enumerations | Functions
USB Descriptors
Collaboration diagram for USB Descriptors:

Modules

 USB Descriptor types
 
 USB release numbers
 
 USB Device Attributes
 
 USB Endpoint definitions
 
 USB String Descriptor Definitions
 

Classes

struct  __attribute__
 A standard USB string descriptor structure. More...
 
struct  _USB_DeviceLPMDescriptor
 USB Device LPM Descriptor structure. More...
 
struct  _USBConfigurationDescriptor
 
struct  _USBDeviceBOSDescriptor
 
struct  _USBDeviceCapabilities
 
struct  _USBDeviceDescriptor
 
struct  _USBDeviceQualifierDescriptor
 
struct  _USBEndpointDescriptor
 
struct  _USBGenericDescriptor
 
struct  _USBInterfaceAssociationDescriptor
 
struct  _USBInterfaceDescriptor
 
struct  _USBOtgDescriptor
 

Macros

#define BESL_10000_US   15
 
#define BESL_1000_US   6
 
#define BESL_125_US   0
 
#define BESL_150_US   1
 
#define BESL_2000_US   7
 
#define BESL_200_US   2
 
#define BESL_3000_US   8
 
#define BESL_300_US   3
 
#define BESL_4000_US   9
 
#define BESL_400_US   4
 
#define BESL_5000_US   10
 
#define BESL_500_US   5
 
#define BESL_6000_US   11
 
#define BESL_7000_US   12
 
#define BESL_8000_US   13
 
#define BESL_9000_US   14
 
#define USB_DC_EXT_BESL_BASELINE(besl)   ((besl & 0xF) << USB_DC_EXT_BESL_BASELINE_OFFSET)
 
#define USB_DC_EXT_BESL_BASELINE_OFFSET   12
 
#define USB_DC_EXT_BESL_DEEP(besl)   ((besl & 0xF) << USB_DC_EXT_BESL_DEEP_OFFSET)
 
#define USB_DC_EXT_BESL_DEEP_OFFSET   8
 
#define USB_EP_ADDR_MASK   0x0f
 
#define USB_EP_DIR_IN   0x80
 Endpoint transfer direction is IN. More...
 
#define USB_EP_DIR_IN   0x80
 Endpoint transfer direction is IN. More...
 
#define USB_EP_DIR_OUT   0x00
 Endpoint transfer direction is OUT. More...
 
#define USB_EP_DIR_OUT   0x00
 Endpoint transfer direction is OUT. More...
 
#define USB_EP_TYPE_MASK   0x03
 
#define USB_LPM_ATTRIBUT_BESL(value)   ((value & 0xF) << 4)
 
#define USB_LPM_ATTRIBUT_BESL_MASK   (0xF << 4)
 
#define USB_LPM_ATTRIBUT_BLINKSTATE(value)   ((value & 0xF) << 0)
 
#define USB_LPM_ATTRIBUT_BLINKSTATE_L1   USB_LPM_ATTRIBUT_BLINKSTATE(1)
 
#define USB_LPM_ATTRIBUT_BLINKSTATE_MASK   (0xF << 0)
 
#define USB_LPM_ATTRIBUT_REMOTEWAKE(value)   ((value & 1) << 8)
 
#define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK   (1 << 8)
 
#define USB_REQ_DIR_IN   (1<<7)
 Device to host. More...
 
#define USB_REQ_DIR_MASK   (1<<7)
 Mask. More...
 
#define USB_REQ_DIR_OUT   (0<<7)
 USB request data transfer direction (bmRequestType) More...
 
#define USB_REQ_RECIP_DEVICE   (0<<0)
 USB recipient codes (bmRequestType) More...
 
#define USB_REQ_RECIP_ENDPOINT   (2<<0)
 Recipient endpoint. More...
 
#define USB_REQ_RECIP_INTERFACE   (1<<0)
 Recipient interface. More...
 
#define USB_REQ_RECIP_MASK   (0x1F)
 Mask. More...
 
#define USB_REQ_RECIP_OTHER   (3<<0)
 Recipient other. More...
 
#define USB_REQ_TYPE_CLASS   (1<<5)
 Class-specific request. More...
 
#define USB_REQ_TYPE_MASK   (3<<5)
 Mask. More...
 
#define USB_REQ_TYPE_STANDARD   (0<<5)
 USB request types (bmRequestType) More...
 
#define USB_REQ_TYPE_VENDOR   (2<<5)
 Vendor-specific request. More...
 

Typedefs

typedef uint32_t(* USBDescriptorParseFunction) (void *descriptor, void *parseArg)
 

Enumerations

enum  usb_capability_extension_attr {
  USB_DC_EXT_LPM = 0x00000002, USB_DC_EXT_LPM = 0x00000002, USB_DC_EXT_BESL = 0x00000004, USB_DC_EXT_BESL_BASELINE_VALID = 0x00000008,
  USB_DC_EXT_BESL_DEEP_VALID = 0x00000010
}
 USB Device Capability - USB 2.0 Extension To fill bmAttributes field of usb_capa_ext_desc_t structure. More...
 
enum  usb_capability_type { USB_DC_USB20_EXTENSION = 0x02, USB_DC_USB20_EXTENSION = 0x02 }
 USB Device Capability types. More...
 
enum  usb_device_feature {
  USB_DEV_FEATURE_REMOTE_WAKEUP = 1, USB_DEV_FEATURE_TEST_MODE = 2, USB_DEV_FEATURE_OTG_B_HNP_ENABLE = 3, USB_DEV_FEATURE_OTG_A_HNP_SUPPORT = 4,
  USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT = 5, USB_DEV_FEATURE_REMOTE_WAKEUP = 1, USB_DEV_FEATURE_TEST_MODE = 2, USB_DEV_FEATURE_OTG_B_HNP_ENABLE = 3,
  USB_DEV_FEATURE_OTG_A_HNP_SUPPORT = 4, USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT = 5
}
 Standard USB device feature flags. More...
 
enum  usb_endpoint_feature { USB_EP_FEATURE_HALT = 0, USB_EP_FEATURE_HALT = 0 }
 Standard USB endpoint feature/status flags. More...
 
enum  usb_endpoint_status { USB_EP_STATUS_HALTED = 1, USB_EP_STATUS_HALTED = 1 }
 Standard USB endpoint status flags. More...
 
enum  usb_interface_status { USB_IFACE_STATUS_RESERVED = 0, USB_IFACE_STATUS_RESERVED = 0 }
 Standard USB Interface status flags. More...
 
enum  usb_reqid {
  USB_REQ_GET_STATUS = 0, USB_REQ_CLEAR_FEATURE = 1, USB_REQ_SET_FEATURE = 3, USB_REQ_SET_ADDRESS = 5,
  USB_REQ_GET_DESCRIPTOR = 6, USB_REQ_SET_DESCRIPTOR = 7, USB_REQ_GET_CONFIGURATION = 8, USB_REQ_SET_CONFIGURATION = 9,
  USB_REQ_GET_INTERFACE = 10, USB_REQ_SET_INTERFACE = 11, USB_REQ_SYNCH_FRAME = 12, USB_REQ_GET_STATUS = 0,
  USB_REQ_CLEAR_FEATURE = 1, USB_REQ_SET_FEATURE = 3, USB_REQ_SET_ADDRESS = 5, USB_REQ_GET_DESCRIPTOR = 6,
  USB_REQ_SET_DESCRIPTOR = 7, USB_REQ_GET_CONFIGURATION = 8, USB_REQ_SET_CONFIGURATION = 9, USB_REQ_GET_INTERFACE = 10,
  USB_REQ_SET_INTERFACE = 11, USB_REQ_SYNCH_FRAME = 12
}
 Standard USB requests (bRequest) More...
 

Functions

struct _USBGenericDescriptor __attribute__ ((__packed__)) USB_DeviceLPMDescriptor
 USB Device LPM Descriptor structure. More...
 
unsigned char USBConfigurationDescriptor_GetNumInterfaces (const USBConfigurationDescriptor *configuration)
 
uint32_t USBConfigurationDescriptor_GetTotalLength (const USBConfigurationDescriptor *configuration)
 
unsigned char USBConfigurationDescriptor_IsSelfPowered (const USBConfigurationDescriptor *configuration)
 
void USBConfigurationDescriptor_Parse (const USBConfigurationDescriptor *configuration, USBInterfaceDescriptor **interfaces, USBEndpointDescriptor **endpoints, USBGenericDescriptor **others)
 
uint8_t USBEndpointDescriptor_GetDirection (const USBEndpointDescriptor *endpoint)
 
uint8_t USBEndpointDescriptor_GetInterval (const USBEndpointDescriptor *endpoint)
 
uint16_t USBEndpointDescriptor_GetMaxPacketSize (const USBEndpointDescriptor *endpoint)
 
uint8_t USBEndpointDescriptor_GetNumber (const USBEndpointDescriptor *endpoint)
 
uint8_t USBEndpointDescriptor_GetType (const USBEndpointDescriptor *endpoint)
 
uint32_t USBGenericDescriptor_GetLength (const USBGenericDescriptor *descriptor)
 
USBGenericDescriptor * USBGenericDescriptor_GetNextDescriptor (const USBGenericDescriptor *descriptor)
 
uint8_t USBGenericDescriptor_GetType (const USBGenericDescriptor *descriptor)
 
USBGenericDescriptor * USBGenericDescriptor_Parse (const USBGenericDescriptor *descriptor, uint32_t totalLength, USBDescriptorParseFunction parseFunction, void *parseArg)
 

Detailed Description

Macro Definition Documentation

◆ BESL_10000_US

#define BESL_10000_US   15

Definition at line 198 of file USBDescriptors.h.

◆ BESL_1000_US

#define BESL_1000_US   6

Definition at line 189 of file USBDescriptors.h.

◆ BESL_125_US

#define BESL_125_US   0

Definition at line 183 of file USBDescriptors.h.

◆ BESL_150_US

#define BESL_150_US   1

Definition at line 184 of file USBDescriptors.h.

◆ BESL_2000_US

#define BESL_2000_US   7

Definition at line 190 of file USBDescriptors.h.

◆ BESL_200_US

#define BESL_200_US   2

Definition at line 185 of file USBDescriptors.h.

◆ BESL_3000_US

#define BESL_3000_US   8

Definition at line 191 of file USBDescriptors.h.

◆ BESL_300_US

#define BESL_300_US   3

Definition at line 186 of file USBDescriptors.h.

◆ BESL_4000_US

#define BESL_4000_US   9

Definition at line 192 of file USBDescriptors.h.

◆ BESL_400_US

#define BESL_400_US   4

Definition at line 187 of file USBDescriptors.h.

◆ BESL_5000_US

#define BESL_5000_US   10

Definition at line 193 of file USBDescriptors.h.

◆ BESL_500_US

#define BESL_500_US   5

Definition at line 188 of file USBDescriptors.h.

◆ BESL_6000_US

#define BESL_6000_US   11

Definition at line 194 of file USBDescriptors.h.

◆ BESL_7000_US

#define BESL_7000_US   12

Definition at line 195 of file USBDescriptors.h.

◆ BESL_8000_US

#define BESL_8000_US   13

Definition at line 196 of file USBDescriptors.h.

◆ BESL_9000_US

#define BESL_9000_US   14

Definition at line 197 of file USBDescriptors.h.

◆ USB_DC_EXT_BESL_BASELINE

#define USB_DC_EXT_BESL_BASELINE (   besl)    ((besl & 0xF) << USB_DC_EXT_BESL_BASELINE_OFFSET)

Definition at line 181 of file USBDescriptors.h.

◆ USB_DC_EXT_BESL_BASELINE_OFFSET

#define USB_DC_EXT_BESL_BASELINE_OFFSET   12

Definition at line 180 of file USBDescriptors.h.

◆ USB_DC_EXT_BESL_DEEP

#define USB_DC_EXT_BESL_DEEP (   besl)    ((besl & 0xF) << USB_DC_EXT_BESL_DEEP_OFFSET)

Definition at line 179 of file USBDescriptors.h.

◆ USB_DC_EXT_BESL_DEEP_OFFSET

#define USB_DC_EXT_BESL_DEEP_OFFSET   8

Definition at line 178 of file USBDescriptors.h.

◆ USB_EP_ADDR_MASK

#define USB_EP_ADDR_MASK   0x0f

Definition at line 109 of file USBDescriptors.h.

◆ USB_EP_DIR_IN [1/2]

#define USB_EP_DIR_IN   0x80

Endpoint transfer direction is IN.

Definition at line 337 of file USBDescriptors.h.

◆ USB_EP_DIR_IN [2/2]

#define USB_EP_DIR_IN   0x80

Endpoint transfer direction is IN.

Definition at line 337 of file USBDescriptors.h.

◆ USB_EP_DIR_OUT [1/2]

#define USB_EP_DIR_OUT   0x00

Endpoint transfer direction is OUT.

Definition at line 342 of file USBDescriptors.h.

◆ USB_EP_DIR_OUT [2/2]

#define USB_EP_DIR_OUT   0x00

Endpoint transfer direction is OUT.

Definition at line 342 of file USBDescriptors.h.

◆ USB_EP_TYPE_MASK

#define USB_EP_TYPE_MASK   0x03

USB protocol port

Definition at line 108 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_BESL

#define USB_LPM_ATTRIBUT_BESL (   value)    ((value & 0xF) << 4)

Definition at line 205 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_BESL_MASK

#define USB_LPM_ATTRIBUT_BESL_MASK   (0xF << 4)

Definition at line 202 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_BLINKSTATE

#define USB_LPM_ATTRIBUT_BLINKSTATE (   value)    ((value & 0xF) << 0)

Definition at line 204 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_BLINKSTATE_L1

#define USB_LPM_ATTRIBUT_BLINKSTATE_L1   USB_LPM_ATTRIBUT_BLINKSTATE(1)

Definition at line 207 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_BLINKSTATE_MASK

#define USB_LPM_ATTRIBUT_BLINKSTATE_MASK   (0xF << 0)

Fields definition from a LPM TOKEN

Definition at line 201 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_REMOTEWAKE

#define USB_LPM_ATTRIBUT_REMOTEWAKE (   value)    ((value & 1) << 8)

Definition at line 206 of file USBDescriptors.h.

◆ USB_LPM_ATTRIBUT_REMOTEWAKE_MASK

#define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK   (1 << 8)

Definition at line 203 of file USBDescriptors.h.

◆ USB_REQ_DIR_IN

#define USB_REQ_DIR_IN   (1<<7)

Device to host.

Definition at line 124 of file USBDescriptors.h.

◆ USB_REQ_DIR_MASK

#define USB_REQ_DIR_MASK   (1<<7)

Mask.

Definition at line 125 of file USBDescriptors.h.

◆ USB_REQ_DIR_OUT

#define USB_REQ_DIR_OUT   (0<<7)

USB request data transfer direction (bmRequestType)

Host to device

Definition at line 123 of file USBDescriptors.h.

◆ USB_REQ_RECIP_DEVICE

#define USB_REQ_RECIP_DEVICE   (0<<0)

USB recipient codes (bmRequestType)

Recipient device

Definition at line 138 of file USBDescriptors.h.

◆ USB_REQ_RECIP_ENDPOINT

#define USB_REQ_RECIP_ENDPOINT   (2<<0)

Recipient endpoint.

Definition at line 140 of file USBDescriptors.h.

◆ USB_REQ_RECIP_INTERFACE

#define USB_REQ_RECIP_INTERFACE   (1<<0)

Recipient interface.

Definition at line 139 of file USBDescriptors.h.

◆ USB_REQ_RECIP_MASK

#define USB_REQ_RECIP_MASK   (0x1F)

Mask.

Definition at line 142 of file USBDescriptors.h.

◆ USB_REQ_RECIP_OTHER

#define USB_REQ_RECIP_OTHER   (3<<0)

Recipient other.

Definition at line 141 of file USBDescriptors.h.

◆ USB_REQ_TYPE_CLASS

#define USB_REQ_TYPE_CLASS   (1<<5)

Class-specific request.

Definition at line 131 of file USBDescriptors.h.

◆ USB_REQ_TYPE_MASK

#define USB_REQ_TYPE_MASK   (3<<5)

Mask.

Definition at line 133 of file USBDescriptors.h.

◆ USB_REQ_TYPE_STANDARD

#define USB_REQ_TYPE_STANDARD   (0<<5)

USB request types (bmRequestType)

Standard request

Definition at line 130 of file USBDescriptors.h.

◆ USB_REQ_TYPE_VENDOR

#define USB_REQ_TYPE_VENDOR   (2<<5)

Vendor-specific request.

Definition at line 132 of file USBDescriptors.h.

Typedef Documentation

◆ USBDescriptorParseFunction

typedef uint32_t(* USBDescriptorParseFunction) (void *descriptor, void *parseArg)

Definition at line 462 of file USBDescriptors.h.

Enumeration Type Documentation

◆ usb_capability_extension_attr

USB Device Capability - USB 2.0 Extension To fill bmAttributes field of usb_capa_ext_desc_t structure.

Enumerator
USB_DC_EXT_LPM 
USB_DC_EXT_LPM 
USB_DC_EXT_BESL 
USB_DC_EXT_BESL_BASELINE_VALID 
USB_DC_EXT_BESL_DEEP_VALID 

Definition at line 172 of file USBDescriptors.h.

◆ usb_capability_type

USB Device Capability types.

Enumerator
USB_DC_USB20_EXTENSION 
USB_DC_USB20_EXTENSION 

Definition at line 164 of file USBDescriptors.h.

◆ usb_device_feature

Standard USB device feature flags.

Note
valid for SetFeature request.
Enumerator
USB_DEV_FEATURE_REMOTE_WAKEUP 

Remote wakeup enabled.

USB_DEV_FEATURE_TEST_MODE 

USB test mode.

USB_DEV_FEATURE_OTG_B_HNP_ENABLE 
USB_DEV_FEATURE_OTG_A_HNP_SUPPORT 
USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT 
USB_DEV_FEATURE_REMOTE_WAKEUP 

Remote wakeup enabled.

USB_DEV_FEATURE_TEST_MODE 

USB test mode.

USB_DEV_FEATURE_OTG_B_HNP_ENABLE 
USB_DEV_FEATURE_OTG_A_HNP_SUPPORT 
USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT 

Definition at line 286 of file USBDescriptors.h.

◆ usb_endpoint_feature

Standard USB endpoint feature/status flags.

Enumerator
USB_EP_FEATURE_HALT 
USB_EP_FEATURE_HALT 

Definition at line 277 of file USBDescriptors.h.

◆ usb_endpoint_status

Standard USB endpoint status flags.

Enumerator
USB_EP_STATUS_HALTED 
USB_EP_STATUS_HALTED 

Definition at line 270 of file USBDescriptors.h.

◆ usb_interface_status

Standard USB Interface status flags.

Enumerator
USB_IFACE_STATUS_RESERVED 
USB_IFACE_STATUS_RESERVED 

Definition at line 262 of file USBDescriptors.h.

◆ usb_reqid

enum usb_reqid

Standard USB requests (bRequest)

Enumerator
USB_REQ_GET_STATUS 
USB_REQ_CLEAR_FEATURE 
USB_REQ_SET_FEATURE 
USB_REQ_SET_ADDRESS 
USB_REQ_GET_DESCRIPTOR 
USB_REQ_SET_DESCRIPTOR 
USB_REQ_GET_CONFIGURATION 
USB_REQ_SET_CONFIGURATION 
USB_REQ_GET_INTERFACE 
USB_REQ_SET_INTERFACE 
USB_REQ_SYNCH_FRAME 
USB_REQ_GET_STATUS 
USB_REQ_CLEAR_FEATURE 
USB_REQ_SET_FEATURE 
USB_REQ_SET_ADDRESS 
USB_REQ_GET_DESCRIPTOR 
USB_REQ_SET_DESCRIPTOR 
USB_REQ_GET_CONFIGURATION 
USB_REQ_SET_CONFIGURATION 
USB_REQ_GET_INTERFACE 
USB_REQ_SET_INTERFACE 
USB_REQ_SYNCH_FRAME 

Definition at line 147 of file USBDescriptors.h.

Function Documentation

◆ __attribute__()

struct _USBGenericDescriptor __attribute__ ( (__packed__)  )

USB Device LPM Descriptor structure.

The BOS descriptor and capabilities descriptors for LPM.

◆ USBConfigurationDescriptor_GetNumInterfaces()

uint8_t USBConfigurationDescriptor_GetNumInterfaces ( const USBConfigurationDescriptor *  configuration)

Returns the number of interfaces in a configuration.

Parameters
configurationPointer to a USBConfigurationDescriptor instance.
Returns
Number of interfaces in configuration.

Definition at line 206 of file USBDescriptors.c.

◆ USBConfigurationDescriptor_GetTotalLength()

uint32_t USBConfigurationDescriptor_GetTotalLength ( const USBConfigurationDescriptor *  configuration)

Returns the total length of a configuration, i.e. including the descriptors following it.

Parameters
configurationPointer to a USBConfigurationDescriptor instance.
Returns
Total length (in bytes) of the configuration.

Definition at line 196 of file USBDescriptors.c.

◆ USBConfigurationDescriptor_IsSelfPowered()

uint8_t USBConfigurationDescriptor_IsSelfPowered ( const USBConfigurationDescriptor *  configuration)

Indicates if the device is self-powered when in a given configuration.

Parameters
configurationPointer to a USBConfigurationDescriptor instance.
Returns
1 if the device is self-powered when in the given configuration; otherwise 0.

Definition at line 217 of file USBDescriptors.c.

◆ USBConfigurationDescriptor_Parse()

void USBConfigurationDescriptor_Parse ( const USBConfigurationDescriptor *  configuration,
USBInterfaceDescriptor **  interfaces,
USBEndpointDescriptor **  endpoints,
USBGenericDescriptor **  others 
)

Parses the given Configuration descriptor (followed by relevant interface, endpoint and class-specific descriptors) into three arrays. Each array must have its size equal or greater to the number of descriptors it stores plus one. A null-value is inserted after the last descriptor of each type to indicate the array end.

Note that if the pointer to an array is null (0), nothing is stored in it.

Parameters
configurationPointer to the start of the whole Configuration descriptor.
interfacesPointer to the Interface descriptor array.
endpointsPointer to the Endpoint descriptor array.
othersPointer to the class-specific descriptor array.

Definition at line 242 of file USBDescriptors.c.

◆ USBEndpointDescriptor_GetDirection()

uint8_t USBEndpointDescriptor_GetDirection ( const USBEndpointDescriptor *  endpoint)

Returns the direction of an endpoint given its descriptor.

Parameters
endpointPointer to a USBEndpointDescriptor instance.
Returns
Endpoint direction (see USB Endpoint directions).

Definition at line 144 of file USBDescriptors.c.

◆ USBEndpointDescriptor_GetInterval()

uint8_t USBEndpointDescriptor_GetInterval ( const USBEndpointDescriptor *  endpoint)

Returns the polling interval on an endpoint given its descriptor.

Parameters
endpoint- Pointer to a USBEndpointDescriptor instance.
Returns
Polling interval of endpoint.

Definition at line 183 of file USBDescriptors.c.

◆ USBEndpointDescriptor_GetMaxPacketSize()

uint16_t USBEndpointDescriptor_GetMaxPacketSize ( const USBEndpointDescriptor *  endpoint)

Returns the maximum size of a packet (in bytes) on an endpoint given its descriptor.

Parameters
endpoint- Pointer to a USBEndpointDescriptor instance.
Returns
Maximum packet size of endpoint.

Definition at line 172 of file USBDescriptors.c.

◆ USBEndpointDescriptor_GetNumber()

uint8_t USBEndpointDescriptor_GetNumber ( const USBEndpointDescriptor *  endpoint)

Returns the number of an endpoint given its descriptor.

Parameters
endpointPointer to a USBEndpointDescriptor instance.
Returns
Endpoint number.

Definition at line 133 of file USBDescriptors.c.

◆ USBEndpointDescriptor_GetType()

uint8_t USBEndpointDescriptor_GetType ( const USBEndpointDescriptor *  endpoint)

Returns the type of an endpoint given its descriptor.

Parameters
endpointPointer to a USBEndpointDescriptor instance.
Returns
Endpoint type (see USB Endpoint types).

Definition at line 160 of file USBDescriptors.c.

◆ USBGenericDescriptor_GetLength()

uint32_t USBGenericDescriptor_GetLength ( const USBGenericDescriptor *  descriptor)

Returns the length of a descriptor.

Parameters
descriptorPointer to a USBGenericDescriptor instance.
Returns
Length of descriptor in bytes.

Definition at line 54 of file USBDescriptors.c.

◆ USBGenericDescriptor_GetNextDescriptor()

USBGenericDescriptor * USBGenericDescriptor_GetNextDescriptor ( const USBGenericDescriptor *  descriptor)

Returns a pointer to the descriptor right after the given one, when parsing a Configuration descriptor.

Parameters
descriptor- Pointer to a USBGenericDescriptor instance.
Returns
Pointer to the next descriptor.

Definition at line 77 of file USBDescriptors.c.

◆ USBGenericDescriptor_GetType()

uint8_t USBGenericDescriptor_GetType ( const USBGenericDescriptor *  descriptor)

Returns the type of a descriptor.

Parameters
descriptorPointer to a USBGenericDescriptor instance.
Returns
Type of descriptor.

Definition at line 65 of file USBDescriptors.c.

◆ USBGenericDescriptor_Parse()

USBGenericDescriptor * USBGenericDescriptor_Parse ( const USBGenericDescriptor *  descriptor,
uint32_t  totalLength,
USBDescriptorParseFunction  parseFunction,
void *  parseArg 
)

Parses the given descriptor list via customized function.

Parameters
descriptorPointer to the start of the whole descriptors list.
totalLengthTotal size of descriptors in bytes.
parseFunctionFunction to parse each descriptor scanned. Return 0 to continue parsing.
parseArgArgument passed to parse function.
Returns
Pointer to USBGenericDescriptor instance for next descriptor.

Definition at line 92 of file USBDescriptors.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:02