Microchip® Advanced Software Framework

composite/device/example1/conf_usb.h File Reference

USB configuration file.

Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "udi_hid_mouse.h"
#include "udi_msc.h"
#include "main.h"

Macros

#define USB_DEVICE_VENDOR_ID   USB_VID_ATMEL
 USB Device Configuration. More...
 
#define USB_DEVICE_PRODUCT_ID   USB_PID_ATMEL_ASF_MSC_HIDMOUSE
 
#define USB_DEVICE_MAJOR_VERSION   1
 
#define USB_DEVICE_MINOR_VERSION   0
 
#define USB_DEVICE_POWER   100
 
#define USB_DEVICE_ATTR   (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED)
 
#define USB_DEVICE_MANUFACTURE_NAME   "ATMEL ASF"
 USB Device string definitions (Optional) More...
 
#define USB_DEVICE_PRODUCT_NAME   "HID Mouse and MSC"
 
#define USB_DEVICE_SERIAL_NAME   "123123123123"
 
#define UDC_VBUS_EVENT(b_vbus_high)
 Device speeds support. More...
 
#define UDC_SOF_EVENT()   main_sof_action()
 
#define UDC_SUSPEND_EVENT()   main_suspend_action()
 
#define UDC_RESUME_EVENT()   main_resume_action()
 
#define UDC_REMOTEWAKEUP_ENABLE()   main_remotewakeup_enable()
 Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature. More...
 
#define UDC_REMOTEWAKEUP_DISABLE()   main_remotewakeup_disable()
 
#define USB_DEVICE_EP_CTRL_SIZE   64
 When a extra string descriptor must be supported other than manufacturer, product and serial string. More...
 
#define USB_DEVICE_NB_INTERFACE   2
 Two interfaces for this device (MSC + HID mouse) More...
 
#define USB_DEVICE_MAX_EP   3
 3 endpoints used by HID mouse and MSC interfaces More...
 
#define UDI_MSC_GLOBAL_VENDOR_ID   'A', 'T', 'M', 'E', 'L', ' ', ' ', ' '
 USB Interface Configuration. More...
 
#define UDI_MSC_GLOBAL_PRODUCT_VERSION   '1', '.', '0', '0'
 
#define UDI_MSC_ENABLE_EXT()   main_msc_enable()
 Interface callback definition. More...
 
#define UDI_MSC_DISABLE_EXT()   main_msc_disable()
 
#define UDI_MSC_EP_IN   (1 | USB_EP_DIR_IN)
 USB MSC low level configuration In standalone these configurations are defined by the MSC module. More...
 
#define UDI_MSC_EP_OUT   (2 | USB_EP_DIR_OUT)
 
#define UDI_MSC_IFACE_NUMBER   0
 Interface number. More...
 
#define UDI_HID_MOUSE_ENABLE_EXT()   main_mouse_enable()
 Configuration of HID Mouse interface. More...
 
#define UDI_HID_MOUSE_DISABLE_EXT()   main_mouse_disable()
 
#define UDI_HID_MOUSE_EP_IN   (3 | USB_EP_DIR_IN)
 USB HID Mouse low level configuration In standalone these configurations are defined by the HID Mouse module. More...
 
#define UDI_HID_MOUSE_IFACE_NUMBER   1
 Interface number. More...
 
#define UDI_COMPOSITE_DESC_T
 Description of Composite Device. More...
 
#define UDI_COMPOSITE_DESC_FS
 USB Interfaces descriptor value for Full Speed. More...
 
#define UDI_COMPOSITE_DESC_HS
 USB Interfaces descriptor value for High Speed. More...
 
#define UDI_COMPOSITE_API
 USB Interface APIs. More...
 

#define UDC_REMOTEWAKEUP_DISABLE ( )    main_remotewakeup_disable()
#define UDC_REMOTEWAKEUP_ENABLE ( )    main_remotewakeup_enable()

Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature.

#define UDC_RESUME_EVENT ( )    main_resume_action()
#define UDC_SOF_EVENT ( )    main_sof_action()
#define UDC_SUSPEND_EVENT ( )    main_suspend_action()
#define UDC_VBUS_EVENT (   b_vbus_high)

Device speeds support.

To define a Low speed device To authorize the High speed USB Device Callbacks definitions (Optional)

#define UDI_COMPOSITE_API
Value:
UDC_DESC_STORAGE udi_api_t udi_api_msc
Global structure which contains standard UDI API for UDC.
Definition: udi_msc.c:66
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

USB Interface APIs.

#define UDI_COMPOSITE_DESC_FS
Value:
.udi_msc = UDI_MSC_DESC_FS, \
.hid_mouse = UDI_HID_MOUSE_DESC
#define UDI_MSC_DESC_FS
Content of MSC interface descriptor for full speed only.
Definition: udi_msc.h:108
#define UDI_HID_MOUSE_DESC
Content of HID mouse interface descriptor for all speed.
Definition: udi_hid_mouse.h:89

USB Interfaces descriptor value for Full Speed.

#define UDI_COMPOSITE_DESC_HS
Value:
.udi_msc = UDI_MSC_DESC_HS, \
.hid_mouse = UDI_HID_MOUSE_DESC
#define UDI_HID_MOUSE_DESC
Content of HID mouse interface descriptor for all speed.
Definition: udi_hid_mouse.h:89
#define UDI_MSC_DESC_HS
Content of MSC interface descriptor for high speed only.
Definition: udi_msc.h:115

USB Interfaces descriptor value for High Speed.

#define UDI_COMPOSITE_DESC_T
Value:
udi_msc_desc_t udi_msc; \
udi_hid_mouse_desc_t hid_mouse
Interface descriptor structure for MSC.
Definition: udi_msc.h:69

Description of Composite Device.

USB Interfaces descriptor structure

#define UDI_HID_MOUSE_DISABLE_EXT ( )    main_mouse_disable()
#define UDI_HID_MOUSE_ENABLE_EXT ( )    main_mouse_enable()

Configuration of HID Mouse interface.

Interface callback definition

#define UDI_HID_MOUSE_EP_IN   (3 | USB_EP_DIR_IN)

USB HID Mouse low level configuration In standalone these configurations are defined by the HID Mouse module.

For composite device, these configuration must be defined hereEndpoint numbers definition

Referenced by udi_hid_mouse_send_report().

#define UDI_HID_MOUSE_IFACE_NUMBER   1

Interface number.

#define UDI_MSC_DISABLE_EXT ( )    main_msc_disable()
#define UDI_MSC_ENABLE_EXT ( )    main_msc_enable()

Interface callback definition.

#define UDI_MSC_EP_IN   (1 | USB_EP_DIR_IN)

USB MSC low level configuration In standalone these configurations are defined by the MSC module.

For composite device, these configuration must be defined hereEndpoint numbers definition

#define UDI_MSC_EP_OUT   (2 | USB_EP_DIR_OUT)
#define UDI_MSC_GLOBAL_PRODUCT_VERSION   '1', '.', '0', '0'
#define UDI_MSC_GLOBAL_VENDOR_ID   'A', 'T', 'M', 'E', 'L', ' ', ' ', ' '

USB Interface Configuration.

Configuration of MSC interfaceVendor name and Product version of MSC interface

#define UDI_MSC_IFACE_NUMBER   0

Interface number.

#define USB_DEVICE_EP_CTRL_SIZE   64

When a extra string descriptor must be supported other than manufacturer, product and serial string.

USB Device low level configuration When only one interface is used, these configurations are defined by the class module. For composite device, these configuration must be defined hereControl endpoint size

#define USB_DEVICE_MAJOR_VERSION   1
#define USB_DEVICE_MANUFACTURE_NAME   "ATMEL ASF"

USB Device string definitions (Optional)

#define USB_DEVICE_MAX_EP   3

3 endpoints used by HID mouse and MSC interfaces

#define USB_DEVICE_MINOR_VERSION   0
#define USB_DEVICE_NB_INTERFACE   2

Two interfaces for this device (MSC + HID mouse)

#define USB_DEVICE_POWER   100
#define USB_DEVICE_PRODUCT_ID   USB_PID_ATMEL_ASF_MSC_HIDMOUSE
#define USB_DEVICE_PRODUCT_NAME   "HID Mouse and MSC"
#define USB_DEVICE_SERIAL_NAME   "123123123123"
#define USB_DEVICE_VENDOR_ID   USB_VID_ATMEL

USB Device Configuration.

Device definition (mandatory)