Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

The following structures provide the USB device descriptors required for USB Device with a single interface HID mouse.

It is ready to use and do not require more definition.

Data Structures

struct  udc_desc_t
 Structure for USB Device Configuration Descriptor. More...
 

Macros

#define UDI_HID_MOUSE_EP_IN   (1 | USB_EP_DIR_IN)
 Endpoint number used by HID mouse interface. More...
 
#define UDI_HID_MOUSE_IFACE_NUMBER   0
 Interface number. More...
 
#define USB_DEVICE_EP_CTRL_SIZE   8
 Control endpoint size. More...
 
#define USB_DEVICE_NB_INTERFACE   1
 Only one interface for this device. More...
 
#define USB_VERSION   USB_V2_1
 

Variables

COMPILER_WORD_ALIGNED
UDC_DESC_STORAGE udc_desc_t 
udc_desc
 USB Device Configuration Descriptor filled for FS and HS. More...
 
COMPILER_WORD_ALIGNED
UDC_DESC_STORAGE
usb_dev_desc_t 
udc_device_desc
 USB Device Descriptor. More...
 
COMPILER_WORD_ALIGNED
UDC_DESC_STORAGE
usb_dev_lpm_desc_t 
udc_device_lpm
 USB Device Qualifier Descriptor. More...
 

UDC structures which contains all USB Device definitions

UDC_DESC_STORAGE udi_api_tudi_apis [USB_DEVICE_NB_INTERFACE]
 Associate an UDI for each USB interface. More...
 
UDC_DESC_STORAGE udc_config_speed_t udc_config_fshs [1]
 Add UDI with USB Descriptors FS & HS. More...
 
UDC_DESC_STORAGE udc_config_t udc_config
 Add all information about USB Device in global structure for UDC. More...
 

UDD Configuration

#define USB_DEVICE_MAX_EP   1
 1 endpoint used by HID mouse standard interface More...
 

#define UDI_HID_MOUSE_EP_IN   (1 | USB_EP_DIR_IN)

Endpoint number used by HID mouse interface.

Referenced by udi_hid_mouse_send_report().

#define UDI_HID_MOUSE_IFACE_NUMBER   0

Interface number.

#define USB_DEVICE_EP_CTRL_SIZE   8
#define USB_DEVICE_MAX_EP   1

1 endpoint used by HID mouse standard interface

#define USB_DEVICE_NB_INTERFACE   1

Only one interface for this device.

#define USB_VERSION   USB_V2_1

Initial value:
= {
.confdev_lsfs = &udc_device_desc,
.conf_lsfs = udc_config_fshs,
.conf_bos = &udc_device_lpm.bos,
}
COMPILER_WORD_ALIGNED UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc
USB Device Descriptor.
Definition: udi_hid_mouse_desc.c:66
COMPILER_WORD_ALIGNED UDC_DESC_STORAGE usb_dev_lpm_desc_t udc_device_lpm
USB Device Qualifier Descriptor.
Definition: udi_hid_mouse_desc.c:115
UDC_DESC_STORAGE udc_config_speed_t udc_config_fshs[1]
Add UDI with USB Descriptors FS & HS.
Definition: udi_hid_mouse_desc.c:161
usb_dev_bos_desc_t bos
Definition: usb_protocol.h:388

Add all information about USB Device in global structure for UDC.

Global variables of USB Device Descriptor and UDI links.

Referenced by udc_req_std_dev_get_descriptor(), and udc_req_std_dev_set_configuration().

Initial value:
= { {
}}
COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udc_desc_t udc_desc
USB Device Configuration Descriptor filled for FS and HS.
Definition: udi_hid_mouse_desc.c:137
Standard USB configuration descriptor structure.
Definition: usb_protocol.h:410
#define UDC_DESC_STORAGE
Defines the memory's location of USB descriptors.
Definition: udc_desc.h:70
UDC_DESC_STORAGE udi_api_t * udi_apis[USB_DEVICE_NB_INTERFACE]
Associate an UDI for each USB interface.
Definition: udi_hid_mouse_desc.c:156

Add UDI with USB Descriptors FS & HS.

Initial value:
= {
.conf.bLength = sizeof(usb_conf_desc_t),
.conf.bDescriptorType = USB_DT_CONFIGURATION,
.conf.wTotalLength = LE16(sizeof(udc_desc_t)),
.conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE,
.conf.bConfigurationValue = 1,
.conf.iConfiguration = 0,
.conf.bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_DEVICE_ATTR,
.hid_mouse = UDI_HID_MOUSE_DESC,
}
Definition: usb_protocol.h:191
#define USB_DEVICE_ATTR
Definition: conf_usb.h:53
#define UDI_HID_MOUSE_DESC
Content of HID mouse interface descriptor for all speed.
Definition: udi_hid_mouse.h:89
#define USB_CONFIG_ATTR_MUST_SET
Must always be set.
Definition: usb_protocol.h:422
Standard USB configuration descriptor structure.
Definition: usb_protocol.h:410
#define USB_DEVICE_POWER
Definition: conf_usb.h:52
#define USB_DEVICE_NB_INTERFACE
Only one interface for this device.
Definition: udi_hid_mouse_desc.c:56
#define USB_CONFIG_MAX_POWER(ma)
Max power in mA.
Definition: usb_protocol.h:427
#define LE16(x)
Definition: compiler.h:773
Structure for USB Device Configuration Descriptor.
Definition: udi_hid_mouse_desc.c:129

USB Device Configuration Descriptor filled for FS and HS.

Initial value:
= {
.bLength = sizeof(usb_dev_desc_t),
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = LE16(USB_VERSION),
.bDeviceClass = 0,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE,
.idVendor = LE16(USB_DEVICE_VENDOR_ID),
.idProduct = LE16(USB_DEVICE_PRODUCT_ID),
.bcdDevice = LE16((USB_DEVICE_MAJOR_VERSION << 8)
.iManufacturer = 1,
.iProduct = 2,
.iSerialNumber = 0,
.bNumConfigurations = 1
}
Standard USB device descriptor structure.
Definition: usb_protocol.h:313
#define USB_DEVICE_MAJOR_VERSION
Definition: conf_usb.h:50
#define USB_DEVICE_VENDOR_ID
USB Device Configuration.
Definition: conf_usb.h:48
Definition: usb_protocol.h:190
#define USB_DEVICE_MINOR_VERSION
Definition: conf_usb.h:51
#define USB_VERSION
Definition: udi_hid_mouse_desc.c:59
#define USB_DEVICE_EP_CTRL_SIZE
Control endpoint size.
Definition: udi_hid_mouse_conf.h:50
#define LE16(x)
Definition: compiler.h:773
#define USB_DEVICE_PRODUCT_ID
Definition: conf_usb.h:49

USB Device Descriptor.

Initial value:
= {
.bos.bLength = sizeof(usb_dev_bos_desc_t),
.bos.bDescriptorType = USB_DT_BOS,
.bos.wTotalLength = LE16(sizeof(usb_dev_bos_desc_t) + sizeof(usb_dev_capa_ext_desc_t)),
.bos.bNumDeviceCaps = 1,
.capa_ext.bLength = sizeof(usb_dev_capa_ext_desc_t),
.capa_ext.bDescriptorType = USB_DT_DEVICE_CAPABILITY,
.capa_ext.bDevCapabilityType = USB_DC_USB20_EXTENSION,
.capa_ext.bmAttributes = USB_DC_EXT_LPM,
}
Definition: usb_protocol.h:200
Definition: usb_protocol.h:201
USB Device Capabilities - USB 2.0 Extension Descriptor structure.
Definition: usb_protocol.h:375
Definition: usb_protocol.h:208
#define LE16(x)
Definition: compiler.h:773
USB Device BOS descriptor structure.
Definition: usb_protocol.h:362
Definition: usb_protocol.h:216

USB Device Qualifier Descriptor.

Initial value:
= {
}
UDC_DESC_STORAGE udi_api_t udi_api_hid_mouse
Global structure which contains standard UDI interface for UDC.
Definition: udi_hid_mouse.c:59

Associate an UDI for each USB interface.