Remove USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token, split out standard descriptors into seperate USB_Descriptor_* and USB_StdDescriptor_* structures so that both can be used within the one project.

Add guard to the HID Host Class driver SetProtocol command, to ensure that the device supports boot protocol mode before issuing the request.
pull/1469/head
Dean Camera 15 years ago
parent 524decdeb3
commit b221e7d175

@ -121,7 +121,6 @@ LUFA_PATH = ../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -121,7 +121,6 @@ LUFA_PATH = ../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
LUFA_OPTS += -D CONTROL_ONLY_DEVICE LUFA_OPTS += -D CONTROL_ONLY_DEVICE
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=32 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=32

@ -121,7 +121,6 @@ LUFA_PATH = ../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USE_NONSTANDARD_DESCRIPTOR_NAMES
LUFA_OPTS += -D CONTROL_ONLY_DEVICE LUFA_OPTS += -D CONTROL_ONLY_DEVICE
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_DEVICE_ONLY LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1

@ -116,7 +116,6 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,9 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,9 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -123,8 +123,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=2000 LUFA_OPTS += -D USB_STREAM_TIMEOUT_MS=2000

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_HOST_ONLY
LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

@ -116,8 +116,7 @@ LUFA_PATH = ../../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
# List C source files here. (C dependencies are automatically generated.) # List C source files here. (C dependencies are automatically generated.)

@ -50,12 +50,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint
return CDC_ENUMERROR_NoCDCInterfaceFound; return CDC_ENUMERROR_NoCDCInterfaceFound;
} }
CDCInterfaceInfo->State.ControlInterfaceNumber = CDCInterfaceInfo->State.ControlInterfaceNumber = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).InterfaceNumber;
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).InterfaceNumber;
#else
DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).bInterfaceNumber;
#endif
while (FoundEndpoints != (CDC_FOUND_NOTIFICATION_IN | CDC_FOUND_DATAPIPE_IN | CDC_FOUND_DATAPIPE_OUT)) while (FoundEndpoints != (CDC_FOUND_NOTIFICATION_IN | CDC_FOUND_DATAPIPE_IN | CDC_FOUND_DATAPIPE_OUT))
{ {
@ -259,7 +254,7 @@ uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* CDCInterfa
uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Data, uint16_t Length) uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Data, uint16_t Length)
{ {
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return; return PIPE_READYWAIT_NoError;
uint8_t ErrorCode; uint8_t ErrorCode;
@ -274,7 +269,7 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Da
uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Data) uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Data)
{ {
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))
return; return PIPE_READYWAIT_NoError;;
uint8_t ErrorCode; uint8_t ErrorCode;

@ -60,14 +60,16 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, uint
} while (HIDInterfaceInfo->Config.HIDInterfaceProtocol && } while (HIDInterfaceInfo->Config.HIDInterfaceProtocol &&
(CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol)); (CurrentHIDInterface->Protocol != HIDInterfaceInfo->Config.HIDInterfaceProtocol));
HIDInterfaceInfo->State.InterfaceNumber = HIDInterfaceInfo->State.InterfaceNumber = CurrentHIDInterface->InterfaceNumber;
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
CurrentHIDInterface->InterfaceNumber;
#else
CurrentHIDInterface->bInterfaceNumber;
#endif
HIDInterfaceInfo->State.SupportsBootSubClass = (CurrentHIDInterface->SubClass != 0); HIDInterfaceInfo->State.SupportsBootSubClass = (CurrentHIDInterface->SubClass != 0);
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, DComp_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)
{
return HID_ENUMERROR_NoHIDDescriptorFound;
}
HIDInterfaceInfo->State.HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_HID_Descriptor_t).HIDReportLength;
while (FoundEndpoints != (HID_FOUND_DATAPIPE_IN | HID_FOUND_DATAPIPE_OUT)) while (FoundEndpoints != (HID_FOUND_DATAPIPE_IN | HID_FOUND_DATAPIPE_OUT))
{ {
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
@ -117,6 +119,16 @@ static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound; return DESCRIPTOR_SEARCH_NotFound;
} }
static uint8_t DComp_NextHID(void* CurrentDescriptor)
{
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)
return DESCRIPTOR_SEARCH_Found;
else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
return DESCRIPTOR_SEARCH_Fail;
else
return DESCRIPTOR_SEARCH_NotFound;
}
static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor)
{ {
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint) if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
@ -170,6 +182,9 @@ uint8_t USB_HID_Host_SetProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, boo
Pipe_SelectPipe(PIPE_CONTROLPIPE); Pipe_SelectPipe(PIPE_CONTROLPIPE);
if (UseReportProtocol && !(HIDInterfaceInfo->State.SupportsBootSubClass))
return MS_ERROR_UNSUPPORTED;
return USB_Host_SendControlRequest(NULL); return USB_Host_SendControlRequest(NULL);
} }

@ -55,6 +55,10 @@
#endif #endif
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */
/** Error code for some HID Host functions, indicating a logical (and not hardware) error */
#define MS_ERROR_UNSUPPORTED 0xC0
/* Type Defines: */ /* Type Defines: */
/** Class state structure. An instance of this structure should be made within the user application, /** Class state structure. An instance of this structure should be made within the user application,
* and passed to each of the HID class driver functions as the HIDInterfaceInfo parameter. This * and passed to each of the HID class driver functions as the HIDInterfaceInfo parameter. This
@ -71,6 +75,8 @@
* boot subclass protocol is required (e.g. keyboard, mouse), or * boot subclass protocol is required (e.g. keyboard, mouse), or
* leave as 0 to match against the first HID interface found * leave as 0 to match against the first HID interface found
*/ */
HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol
* is not used */
} Config; /**< Config data for the USB class interface within the device. All elements in this section } Config; /**< Config data for the USB class interface within the device. All elements in this section
* <b>must</b> be set or the interface will fail to enumerate and operate correctly. * <b>must</b> be set or the interface will fail to enumerate and operate correctly.
*/ */
@ -88,6 +94,7 @@
bool SupportsBootSubClass; /**< Indicates if the current interface instance supports the HID Boot bool SupportsBootSubClass; /**< Indicates if the current interface instance supports the HID Boot
* Protocol when enabled via \ref USB_HID_Host_SetProtocol() * Protocol when enabled via \ref USB_HID_Host_SetProtocol()
*/ */
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device */
} State; /**< State data for the USB class interface within the device. All elements in this section } State; /**< State data for the USB class interface within the device. All elements in this section
* <b>may</b> be set to initial values, but may also be ignored to default to sane values when * <b>may</b> be set to initial values, but may also be ignored to default to sane values when
* the interface is enumerated. * the interface is enumerated.
@ -100,7 +107,8 @@
HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */ HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */ HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */ HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
HID_ENUMERROR_EndpointsNotFound = 3, /**< Compatible HID endpoints were not found in the device's HID interface */ HID_ENUMERROR_NoHIDDescriptorFound = 3, /**< The HID descriptor was not found in the device's HID interface */
HID_ENUMERROR_EndpointsNotFound = 4, /**< Compatible HID endpoints were not found in the device's HID interface */
}; };
/* Function Prototypes: */ /* Function Prototypes: */
@ -109,6 +117,7 @@
uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3); uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3);
bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
uint8_t USB_HID_Host_SetProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, bool UseReportProtocol) ATTR_NON_NULL_PTR_ARG(1); uint8_t USB_HID_Host_SetProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, bool UseReportProtocol) ATTR_NON_NULL_PTR_ARG(1);
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
@ -122,6 +131,7 @@
/* Function Prototypes: */ /* Function Prototypes: */
#if defined(INCLUDE_FROM_HID_CLASS_HOST_C) #if defined(INCLUDE_FROM_HID_CLASS_HOST_C)
static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_NextHID(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1); static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif #endif
#endif #endif

@ -50,12 +50,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint16_
return MS_ENUMERROR_NoMSInterfaceFound; return MS_ENUMERROR_NoMSInterfaceFound;
} }
MSInterfaceInfo->State.InterfaceNumber = MSInterfaceInfo->State.InterfaceNumber = DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->InterfaceNumber;
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->InterfaceNumber;
#else
DESCRIPTOR_PCAST(DeviceConfigDescriptor, USB_Descriptor_Interface_t)->bInterfaceNumber;
#endif
while (FoundEndpoints != (MS_FOUND_DATAPIPE_IN | MS_FOUND_DATAPIPE_OUT)) while (FoundEndpoints != (MS_FOUND_DATAPIPE_IN | MS_FOUND_DATAPIPE_OUT))
{ {
@ -150,7 +145,8 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, MS_
Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber); Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze(); Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t))) != PIPE_RWSTREAM_NoError) if ((ErrorCode = Pipe_Write_Stream_LE(SCSICommandBlock, sizeof(MS_CommandBlockWrapper_t),
NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
Pipe_ClearOUT(); Pipe_ClearOUT();
@ -238,7 +234,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo,
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber); Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze(); Pipe_Unfreeze();
if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = Pipe_Read_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
Pipe_ClearIN(); Pipe_ClearIN();
@ -248,7 +244,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* MSInterfaceInfo,
Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber); Pipe_SelectPipe(MSInterfaceInfo->Config.DataOUTPipeNumber);
Pipe_Unfreeze(); Pipe_Unfreeze();
if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = Pipe_Write_Stream_LE(BufferPtr, BytesRem, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
Pipe_ClearOUT(); Pipe_ClearOUT();
@ -276,7 +272,8 @@ static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* MSInterfaceInf
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber); Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
Pipe_Unfreeze(); Pipe_Unfreeze();
if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t))) != PIPE_RWSTREAM_NoError) if ((ErrorCode = Pipe_Read_Stream_LE(SCSICommandStatus, sizeof(MS_CommandStatusWrapper_t),
NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
Pipe_ClearIN(); Pipe_ClearIN();

@ -55,6 +55,7 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error */
#define MS_ERROR_LOGICAL_CMD_FAILED 0xC0 #define MS_ERROR_LOGICAL_CMD_FAILED 0xC0
/* Type Defines: */ /* Type Defines: */

@ -55,6 +55,7 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Error code for some Still Image Host functions, indicating a logical (and not hardware) error */
#define SI_ERROR_LOGICAL_CMD_FAILED 0xC0 #define SI_ERROR_LOGICAL_CMD_FAILED 0xC0
/* Type Defines: */ /* Type Defines: */
@ -134,7 +135,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure * returned a logical command failure
*/ */
uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated /** Closes an already opened PIMA session with the attached device. This should be used after all session-orientated
* PIMA commands have been issued to the device. * PIMA commands have been issued to the device.
@ -144,7 +145,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure * returned a logical command failure
*/ */
uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Sends a given PIMA command to the attached device, filling out the PIMA command header automatically as required. /** Sends a given PIMA command to the attached device, filling out the PIMA command header automatically as required.
* *
@ -157,7 +158,7 @@
* returned a logical command failure * returned a logical command failure
*/ */
uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t Operation, uint8_t TotalParams, uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t Operation, uint8_t TotalParams,
uint32_t* Params); uint32_t* Params) ATTR_NON_NULL_PTR_ARG(1);
/** Receives and checks a response block from the attached PIMA device, once a command has been issued and all data /** Receives and checks a response block from the attached PIMA device, once a command has been issued and all data
* associated with the command has been transferred. * associated with the command has been transferred.
@ -167,7 +168,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
* returned a logical command failure * returned a logical command failure
*/ */
uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe. /** Indicates if the device has issued a PIMA event block to the host via the asynchronous events pipe.
* *
@ -175,7 +176,7 @@
* *
* \return Boolean true if an event is waiting to be read, false otherwise * \return Boolean true if an event is waiting to be read, false otherwise
*/ */
bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* SIInterfaceInfo); bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Receives an asynchronous event block from the device via the asynchronous events pipe. /** Receives an asynchronous event block from the device via the asynchronous events pipe.
* *
@ -186,7 +187,7 @@
* returned a logical command failure * returned a logical command failure
*/ */
uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo,
SI_PIMA_Container_t* PIMAHeader); SI_PIMA_Container_t* PIMAHeader) ATTR_NON_NULL_PTR_ARG(1, 2);
/** Sends arbitrary data to the attached device, for use in the data phase of PIMA commands which require data /** Sends arbitrary data to the attached device, for use in the data phase of PIMA commands which require data
* transfer beyond the regular PIMA command block parameters. * transfer beyond the regular PIMA command block parameters.
@ -197,7 +198,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
*/ */
uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes); uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1, 2);
/** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data /** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data
* transfer beyond the regular PIMA command block parameters. * transfer beyond the regular PIMA command block parameters.
@ -208,7 +209,7 @@
* *
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
*/ */
uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes); uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1, 2);
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)

@ -51,11 +51,7 @@ uint8_t USB_GetDeviceConfigDescriptor(uint8_t ConfigNumber, uint16_t* const Conf
if ((ErrorCode = USB_Host_SendControlRequest(ConfigHeader)) != HOST_SENDCONTROL_Successful) if ((ErrorCode = USB_Host_SendControlRequest(ConfigHeader)) != HOST_SENDCONTROL_Successful)
return ErrorCode; return ErrorCode;
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
*ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).TotalConfigurationSize; *ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).TotalConfigurationSize;
#else
*ConfigSizePtr = DESCRIPTOR_CAST(ConfigHeader, USB_Descriptor_Configuration_Header_t).wTotalLength;
#endif
if (*ConfigSizePtr > BufferSize) if (*ConfigSizePtr > BufferSize)
return HOST_GETCONFIG_BuffOverflow; return HOST_GETCONFIG_BuffOverflow;

@ -98,18 +98,10 @@
* This value's meaning depends on the descriptor's placement in the descriptor, but standard type * This value's meaning depends on the descriptor's placement in the descriptor, but standard type
* values can be accessed in the \ref USB_DescriptorTypes_t enum. * values can be accessed in the \ref USB_DescriptorTypes_t enum.
*/ */
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
#define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Type #define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Type
#else
#define DESCRIPTOR_TYPE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bDescriptorType
#endif
/** Returns the descriptor's size, expressed as the 8-bit value indicating the number of bytes. */ /** Returns the descriptor's size, expressed as the 8-bit value indicating the number of bytes. */
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
#define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Size #define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).Size
#else
#define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength
#endif
/* Type Defines: */ /* Type Defines: */
/** Type define for a Configuration Descriptor comparator function (function taking a pointer to an array /** Type define for a Configuration Descriptor comparator function (function taking a pointer to an array
@ -268,11 +260,7 @@
static inline void USB_GetNextDescriptor(uint16_t* const BytesRem, static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
uint8_t** const CurrConfigLoc) uint8_t** const CurrConfigLoc)
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size; uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
#else
uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).bLength;
#endif
*CurrConfigLoc += CurrDescriptorSize; *CurrConfigLoc += CurrDescriptorSize;
*BytesRem -= CurrDescriptorSize; *BytesRem -= CurrDescriptorSize;

@ -34,16 +34,6 @@
* Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains * Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains
* structures and macros for the easy creation of standard USB descriptors in USB device projects. * structures and macros for the easy creation of standard USB descriptors in USB device projects.
* *
* All standard descriptors have their elements named in an identical manner to the official USB specification,
* however slightly more verbose alternate (non-standard) names are also supplied if the macro
* USE_NONSTANDARD_DESCRIPTOR_NAMES is defined in the user project makefile and passed to the compiler at
* compilation time using the -D option.
*
* The non-standard names are documented here - if USE_NONSTANDARD_DESCRIPTOR_NAMES is not defined, then all
* descriptors will contain elements named identically to the official USB specification. The alternately
* named descriptor elements are placed in the same order inside the descriptor structures as their officially
* named counterparts, thus they can be correlated easily with the official USB specification.
*
* @{ * @{
*/ */
@ -206,34 +196,39 @@
}; };
/* Type Defines: */ /* Type Defines: */
/** Type define for all descriptor's header, indicating the descriptor's length and type. /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure
* uses LUFA-specific element names to make each element's purpose clearer.
* *
* \note The non-standard structure element names are documented here. If the * \see \ref USB_StdDescriptor_Header_t for the version of this define with standard element names
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements
* with names identical to those listed in the USB standard.
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
uint8_t Size; /**< Size of the descriptor, in bytes. */ uint8_t Size; /**< Size of the descriptor, in bytes. */
uint8_t Type; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value uint8_t Type; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class. * given by the specific class.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
#endif
} USB_Descriptor_Header_t; } USB_Descriptor_Header_t;
/** Type define for a standard device descriptor. /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure
* uses the relevant standard's given element names to ensure compatibility with the standard.
* *
* \note The non-standard structure element names are documented here. If the * \see \ref USB_Descriptor_Header_t for the version of this define with non-standard LUFA specific element names
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements */
* with names identical to those listed in the USB standard. typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
} USB_StdDescriptor_Header_t;
/** Type define for a standard Device Descriptor. This structure uses LUFA-specific element names to make each
* element's purpose clearer.
*
* \see \ref USB_StdDescriptor_Device_t for the version of this define with standard element names
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
uint16_t USBSpecification; /**< BCD of the supported USB specification. */ uint16_t USBSpecification; /**< BCD of the supported USB specification. */
@ -269,37 +264,64 @@
* *
* \see ManufacturerStrIndex structure entry. * \see ManufacturerStrIndex structure entry.
*/ */
uint8_t NumberOfConfigurations; /**< Total number of configurations supported by uint8_t NumberOfConfigurations; /**< Total number of configurations supported by
* the device. * the device.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t bcdUSB;
uint8_t bDeviceClass;
uint8_t bDeviceSubClass;
uint8_t bDeviceProtocol;
uint8_t bMaxPacketSize0;
uint16_t idVendor;
uint16_t idProduct;
uint16_t bcdDevice;
uint8_t iManufacturer;
uint8_t iProduct;
uint8_t iSerialNumber;
uint8_t bNumConfigurations;
#endif
} USB_Descriptor_Device_t; } USB_Descriptor_Device_t;
/** Type define for a standard configuration descriptor. /** Type define for a standard Device Descriptor. This structure uses the relevant standard's given element names
* to ensure compatibility with the standard.
*
* \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint16_t bcdUSB; /**< BCD of the supported USB specification. */
uint8_t bDeviceClass; /**< USB device class. */
uint8_t bDeviceSubClass; /**< USB device subclass. */
uint8_t bDeviceProtocol; /**< USB device protocol. */
uint8_t bMaxPacketSize0; /**< Size of the control (address 0) endpoint's bank in bytes. */
uint16_t idVendor; /**< Vendor ID for the USB product. */
uint16_t idProduct; /**< Unique product ID for the USB product. */
uint16_t bcdDevice; /**< Product release (version) number. */
uint8_t iManufacturer; /**< String index for the manufacturer's name. The
* host will request this string via a separate
* control request for the string descriptor.
*
* \note If no string supplied, use \ref NO_DESCRIPTOR.
*/
uint8_t iProduct; /**< String index for the product name/details.
*
* \see ManufacturerStrIndex structure entry.
*/
uint8_t iSerialNumber; /**< String index for the product's globally unique hexadecimal
* serial number, in uppercase Unicode ASCII.
*
* \note On some AVR models, there is an embedded serial number
* in the chip which can be used for the device serial number.
* To use this serial number, set this to USE_INTERNAL_SERIAL.
* On unsupported devices, this will evaluate to 0 and will cause
* the host to generate a pseudo-unique value for the device upon
* insertion.
*
* \see ManufacturerStrIndex structure entry.
*/
uint8_t bNumConfigurations; /**< Total number of configurations supported by
* the device.
*/
} USB_StdDescriptor_Device_t;
/** Type define for a standard Configuration Descriptor header. This structure uses LUFA-specific element names
* to make each element's purpose clearer.
* *
* \note The non-standard structure element names are documented here. If the * \see \ref USB_StdDescriptor_Configuration_Header_t for the version of this define with standard element names
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements
* with names identical to those listed in the USB standard.
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
uint16_t TotalConfigurationSize; /**< Size of the configuration descriptor header, uint16_t TotalConfigurationSize; /**< Size of the configuration descriptor header,
@ -318,27 +340,41 @@
* current configuration, calculated by the \ref USB_CONFIG_POWER_MA() * current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
* macro. * macro.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t wTotalLength;
uint8_t bNumInterfaces;
uint8_t bConfigurationValue;
uint8_t iConfiguration;
uint8_t bmAttributes;
uint8_t bMaxPower;
#endif
} USB_Descriptor_Configuration_Header_t; } USB_Descriptor_Configuration_Header_t;
/** Type define for a standard interface descriptor. /** Type define for a standard Configuration Descriptor header. This structure uses the relevant standard's given element names
* to ensure compatibility with the standard.
*
* \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint16_t wTotalLength; /**< Size of the configuration descriptor header,
* and all sub descriptors inside the configuration.
*/
uint8_t bNumInterfaces; /**< Total number of interfaces in the configuration. */
uint8_t bConfigurationValue; /**< Configuration index of the current configuration. */
uint8_t iConfiguration; /**< Index of a string descriptor describing the configuration. */
uint8_t bmAttributes; /**< Configuration attributes, comprised of a mask of zero or
* more USB_CONFIG_ATTR_* masks.
*/
uint8_t bMaxPower; /**< Maximum power consumption of the device while in the
* current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
* macro.
*/
} USB_StdDescriptor_Configuration_Header_t;
/** Type define for a standard Interface Descriptor. This structure uses LUFA-specific element names
* to make each element's purpose clearer.
* *
* \note The non-standard structure element names are documented here. If the * \see \ref USB_StdDescriptor_Interface_t for the version of this define with standard element names
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements
* with names identical to those listed in the USB standard.
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
uint8_t InterfaceNumber; /**< Index of the interface in the current configuration. */ uint8_t InterfaceNumber; /**< Index of the interface in the current configuration. */
@ -356,20 +392,36 @@
uint8_t InterfaceStrIndex; /**< Index of the string descriptor describing the uint8_t InterfaceStrIndex; /**< Index of the string descriptor describing the
* interface. * interface.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bInterfaceNumber;
uint8_t bAlternateSetting;
uint8_t bNumEndpoints;
uint8_t bInterfaceClass;
uint8_t bInterfaceSubClass;
uint8_t bInterfaceProtocol;
uint8_t iInterface;
#endif
} USB_Descriptor_Interface_t; } USB_Descriptor_Interface_t;
/** Type define for a standard Interface Association descriptor. /** Type define for a standard Interface Descriptor. This structure uses the relevant standard's given element names
* to ensure compatibility with the standard.
*
* \see \ref USB_Descriptor_Interface_t for the version of this define with non-standard LUFA specific element names
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bInterfaceNumber; /**< Index of the interface in the current configuration. */
uint8_t bAlternateSetting; /**< Alternate setting for the interface number. The same
* interface number can have multiple alternate settings
* with different endpoint configurations, which can be
* selected by the host.
*/
uint8_t bNumEndpoints; /**< Total number of endpoints in the interface. */
uint8_t bInterfaceClass; /**< Interface class ID. */
uint8_t bInterfaceSubClass; /**< Interface subclass ID. */
uint8_t bInterfaceProtocol; /**< Interface protocol ID. */
uint8_t iInterface; /**< Index of the string descriptor describing the
* interface.
*/
} USB_StdDescriptor_Interface_t;
/** Type define for a standard Interface Association Descriptor. This structure uses LUFA-specific element names
* to make each element's purpose clearer.
* *
* This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
* <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound * <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
@ -377,13 +429,10 @@
* together at the point of enumeration, loading one generic driver for all the interfaces in the single * together at the point of enumeration, loading one generic driver for all the interfaces in the single
* function. Read the ECN for more information. * function. Read the ECN for more information.
* *
* \note The non-standard structure element names are documented here. If the * \see \ref USB_StdDescriptor_Interface_Association_t for the version of this define with standard element names
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements
* with names identical to those listed in the USB standard.
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
uint8_t FirstInterfaceIndex; /**< Index of the first associated interface. */ uint8_t FirstInterfaceIndex; /**< Index of the first associated interface. */
@ -396,27 +445,43 @@
uint8_t IADStrIndex; /**< Index of the string descriptor describing the uint8_t IADStrIndex; /**< Index of the string descriptor describing the
* interface association. * interface association.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bFirstInterface;
uint8_t bInterfaceCount;
uint8_t bFunctionClass;
uint8_t bFunctionSubClass;
uint8_t bFunctionProtocol;
uint8_t iFunction;
#endif
} USB_Descriptor_Interface_Association_t; } USB_Descriptor_Interface_Association_t;
/** Type define for a standard endpoint descriptor. /** Type define for a standard Interface Association Descriptor. This structure uses the relevant standard's given
* element names to ensure compatibility with the standard.
*
* This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
* <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
* devices with multiple interfaces related to the same function to have the multiple interfaces bound
* together at the point of enumeration, loading one generic driver for all the interfaces in the single
* function. Read the ECN for more information.
*
* \see \ref USB_Descriptor_Interface_Association_t for the version of this define with non-standard LUFA specific
* element names
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bFirstInterface; /**< Index of the first associated interface. */
uint8_t bInterfaceCount; /** Total number of associated interfaces. */
uint8_t bFunctionClass; /**< Interface class ID. */
uint8_t bFunctionSubClass; /**< Interface subclass ID. */
uint8_t bFunctionProtocol; /**< Interface protocol ID. */
uint8_t iFunction; /**< Index of the string descriptor describing the
* interface association.
*/
} USB_StdDescriptor_Interface_Association_t;
/** Type define for a standard Endpoint Descriptor. This structure uses LUFA-specific element names
* to make each element's purpose clearer.
* *
* \note The non-standard structure element names are documented here. If the * \see \ref USB_StdDescriptor_Endpoint_t for the version of this define with standard element names
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements
* with names identical to those listed in the USB standard.
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
uint8_t EndpointAddress; /**< Logical address of the endpoint within the device uint8_t EndpointAddress; /**< Logical address of the endpoint within the device
@ -434,16 +499,36 @@
uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpoint uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpoint
* if it is an INTERRUPT or ISOCHRONOUS type. * if it is an INTERRUPT or ISOCHRONOUS type.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
uint8_t bEndpointAddress;
uint8_t bmAttributes;
uint16_t wMaxPacketSize;
uint8_t bInterval;
#endif
} USB_Descriptor_Endpoint_t; } USB_Descriptor_Endpoint_t;
/** Type define for a standard Endpoint Descriptor. This structure uses the relevant standard's given
* element names to ensure compatibility with the standard.
*
* \see \ref USB_Descriptor_Endpoint_t for the version of this define with non-standard LUFA specific
* element names
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
uint8_t bEndpointAddress; /**< Logical address of the endpoint within the device
* for the current configuration, including direction
* mask.
*/
uint8_t bmAttributes; /**< Endpoint attributes, comprised of a mask of the
* endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*)
* masks.
*/
uint16_t wMaxPacketSize; /**< Size of the endpoint bank, in bytes. This indicates the
* maximum packet size that the endpoint can receive at a time.
*/
uint8_t bInterval; /**< Polling interval in milliseconds for the endpoint
* if it is an INTERRUPT or ISOCHRONOUS type.
*/
} USB_StdDescriptor_Endpoint_t;
/** Type define for a standard string descriptor. Unlike other standard descriptors, the length /** Type define for a standard string descriptor. Unlike other standard descriptors, the length
* of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN() * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN()
* macro rather than by the size of the descriptor structure, as the length is not fixed. * macro rather than by the size of the descriptor structure, as the length is not fixed.
@ -451,13 +536,12 @@
* This structure should also be used for string index 0, which contains the supported language IDs for * This structure should also be used for string index 0, which contains the supported language IDs for
* the device as an array. * the device as an array.
* *
* \note The non-standard structure element names are documented here. If the * This structure uses LUFA-specific element names to make each element's purpose clearer.
* USE_NONSTANDARD_DESCRIPTOR_NAMES token is not set, this structure contains elements *
* with names identical to those listed in the USB standard. * \see \ref USB_StdDescriptor_String_t for the version of this define with standard element names
*/ */
typedef struct typedef struct
{ {
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES) || defined(__DOXYGEN__)
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */ USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
int16_t UnicodeString[]; /**< String data, as unicode characters (alternatively, int16_t UnicodeString[]; /**< String data, as unicode characters (alternatively,
@ -471,13 +555,40 @@
* Unicode strings, and may be used instead of an explicit * Unicode strings, and may be used instead of an explicit
* array of ASCII characters. * array of ASCII characters.
*/ */
#else
uint8_t bLength;
uint8_t bDescriptorType;
int16_t bString[];
#endif
} USB_Descriptor_String_t; } USB_Descriptor_String_t;
/** Type define for a standard string descriptor. Unlike other standard descriptors, the length
* of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN()
* macro rather than by the size of the descriptor structure, as the length is not fixed.
*
* This structure should also be used for string index 0, which contains the supported language IDs for
* the device as an array.
*
* This structure uses the relevant standard's given element names to ensure compatibility with the standard.
*
* \see \ref USB_Descriptor_String_t for the version of this define with with non-standard LUFA specific
* element names
*/
typedef struct
{
uint8_t bLength; /**< Size of the descriptor, in bytes. */
uint8_t bDescriptorType; /**< Type of the descriptor, either a value in
* \ref USB_DescriptorTypes_t or a value
* given by the specific class.
*/
int16_t bString[]; /**< String data, as unicode characters (alternatively,
* string language IDs). If normal ASCII characters are
* to be used, they must be added as an array of characters
* rather than a normal C string so that they are widened to
* Unicode size.
*
* Under GCC, strings prefixed with the "L" character (before
* the opening string quotation mark) are considered to be
* Unicode strings, and may be used instead of an explicit
* array of ASCII characters.
*/
} USB_StdDescriptor_String_t;
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Macros: */ /* Macros: */

@ -232,13 +232,8 @@ static void USB_Device_GetInternalSerialDescriptor(void)
int16_t UnicodeString[20]; int16_t UnicodeString[20];
} SignatureDescriptor; } SignatureDescriptor;
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor); SignatureDescriptor.Header.Size = sizeof(SignatureDescriptor);
SignatureDescriptor.Header.Type = DTYPE_String; SignatureDescriptor.Header.Type = DTYPE_String;
#else
SignatureDescriptor.Header.bLength = sizeof(SignatureDescriptor);
SignatureDescriptor.Header.bDescriptorType = DTYPE_String;
#endif
uint8_t SigReadAddress = 0x0E; uint8_t SigReadAddress = 0x0E;

@ -137,11 +137,7 @@ void USB_Host_ProcessNextHostState(void)
break; break;
} }
#if defined(USE_NONSTANDARD_DESCRIPTOR_NAMES)
USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, Endpoint0Size)]; USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, Endpoint0Size)];
#else
USB_ControlPipeSize = DataBuffer[offsetof(USB_Descriptor_Device_t, bMaxPacketSize0)];
#endif
USB_Host_ResetDevice(); USB_Host_ResetDevice();

@ -40,6 +40,8 @@
* - Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names * - Add in new invalid event hook check targets to project makefiles to produce compilation errors when invalid event names
* are used in a project * are used in a project
* - The HID Report Parser now gives information on the total length of each report within a HID interface * - The HID Report Parser now gives information on the total length of each report within a HID interface
* - The USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token has been removed - there are now seperate USB_Descriptor_* and
* USB_StdDescriptor_* structures for both the LUFA and standardized element naming conventions so both may be used
* *
* <b>Fixed:</b> * <b>Fixed:</b>
* - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the * - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the

@ -72,12 +72,6 @@
* <b>USE_EEPROM_DESCRIPTORS</b> - ( \ref Group_Descriptors ) \n * <b>USE_EEPROM_DESCRIPTORS</b> - ( \ref Group_Descriptors ) \n
* Similar to USE_RAM_DESCRIPTORS, but all descriptors are stored in the AVR's EEPROM memory rather than RAM. * Similar to USE_RAM_DESCRIPTORS, but all descriptors are stored in the AVR's EEPROM memory rather than RAM.
* *
* <b>USE_NONSTANDARD_DESCRIPTOR_NAMES</b> - ( \ref Group_Descriptors ) \n
* The USB 2.0 standard gives some rather obscure names for the elements in the standard descriptor types (device, configuration,
* string, endpoint, etc.). By default the LUFA library uses these names in its predefined descriptor structure types for
* compatibility. If this token is defined, the structure element names are switched to the LUFA-specific but more descriptive
* names documented in the StdDescriptors.h source file.
*
* <b>NO_INTERNAL_SERIAL</b> - ( \ref Group_Descriptors ) \n * <b>NO_INTERNAL_SERIAL</b> - ( \ref Group_Descriptors ) \n
* Some AVR models contain a unique 20-digit serial number which can be used as the device serial number, while in device mode. This * Some AVR models contain a unique 20-digit serial number which can be used as the device serial number, while in device mode. This
* allows the host to uniquely identify the device regardless of if it is moved between USB ports on the same computer, allowing * allows the host to uniquely identify the device regardless of if it is moved between USB ports on the same computer, allowing

@ -14,10 +14,10 @@
* *
* <b>Non-USB Library Components</b> * <b>Non-USB Library Components</b>
* - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library. * - The ADC_Off() function has been renamed to \ref ADC_ShutDown() to be consistent with the rest of the library.
* - The Dataflash_Init() routine no longer initializes the SPI bus - the SPI bus should be initialized manually via a * - The \ref SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See
* the \ref SPI_Init() function documentation for more details
* - The \ref Dataflash_Init() routine no longer initializes the SPI bus - the SPI bus should be initialized manually via a
* call to SPI_Init() before using the Dataflash driver * call to SPI_Init() before using the Dataflash driver
* - The SPI_Init() routine's parameters have changed, so that the clock polarity and data sampling modes can be set. See
* the SPI_Init() function documentation for more details
* *
* <b>Host Mode</b> * <b>Host Mode</b>
* - The \ref USB_GetDeviceConfigDescriptor() function's parameters and behaviour has changed; the user is required to * - The \ref USB_GetDeviceConfigDescriptor() function's parameters and behaviour has changed; the user is required to
@ -28,6 +28,14 @@
* is interested in into the processed HID report item structure to save RAM. See \ref CALLBACK_HIDParser_FilterHIDReportItem(). * is interested in into the processed HID report item structure to save RAM. See \ref CALLBACK_HIDParser_FilterHIDReportItem().
* - The HID report parser now always parses FEATURE and always ignores constant-data items - the HID_ENABLE_FEATURE_PROCESSING * - The HID report parser now always parses FEATURE and always ignores constant-data items - the HID_ENABLE_FEATURE_PROCESSING
* and HID_INCLUDE_CONSTANT_DATA_ITEMS compile time tokens now have no effect. * and HID_INCLUDE_CONSTANT_DATA_ITEMS compile time tokens now have no effect.
* - The USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token has been removed - there are now seperate USB_Descriptor_*
* and USB_StdDescriptor_* structures for both the LUFA and standardized element naming conventions so that both may be used in
* the one project. For existing projects using the standardized names, change all code to use the USB_StdDescriptor_* variants.
*
* <b>Device Mode</b>
* - The USE_NONSTANDARD_DESCRIPTOR_NAMES compile time token has been removed - there are now seperate USB_Descriptor_*
* and USB_StdDescriptor_* structures for both the LUFA and standardized element naming conventions so that both may be used in
* the one project. For existing projects using the standardized names, change all code to use the USB_StdDescriptor_* variants.
* *
* \section Sec_Migration090810 Migrating from 090605 to 090810 * \section Sec_Migration090810 Migrating from 090605 to 090810
* *

@ -116,8 +116,7 @@ LUFA_PATH = ../../
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=16 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=16
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D NO_STREAM_CALLBACKS LUFA_OPTS += -D NO_STREAM_CALLBACKS

@ -116,8 +116,7 @@ LUFA_PATH = ../../
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS

@ -116,8 +116,7 @@ LUFA_PATH = ../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USE_NONSTANDARD_DESCRIPTOR_NAMES LUFA_OPTS = -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D USB_HOST_ONLY LUFA_OPTS += -D USB_HOST_ONLY
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

Loading…
Cancel
Save