projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renamed Serial_Stream driver to SerialStream to remain consistent with the rest of...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
USB
/
HighLevel
/
StdDescriptors.h
diff --git
a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
index
d9075cc
..
a1a0518
100644
(file)
--- a/
LUFA/Drivers/USB/HighLevel/StdDescriptors.h
+++ b/
LUFA/Drivers/USB/HighLevel/StdDescriptors.h
@@
-31,7
+31,7
@@
/** \file
\r
*
\r
* Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains
\r
/** \file
\r
*
\r
* Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains
\r
- * struc
u
tures and macros for the easy creation of standard USB descriptors in USB device projects.
\r
+ * structures and macros for the easy creation of standard USB descriptors in USB device projects.
\r
*
\r
* All standard descriptors have their elements named in an identical manner to the official USB specification,
\r
* however slightly more verbose alternate (non-standard) names are also supplied if the macro
\r
*
\r
* All standard descriptors have their elements named in an identical manner to the official USB specification,
\r
* however slightly more verbose alternate (non-standard) names are also supplied if the macro
\r
@@
-44,6
+44,14
@@
* named counterparts, thus they can be correlated easily with the official USB specification.
\r
*/
\r
\r
* named counterparts, thus they can be correlated easily with the official USB specification.
\r
*/
\r
\r
+/** \ingroup Group_USB
\r
+ * @defgroup Group_Descriptors USB Descriptors
\r
+ *
\r
+ * Functions, macros, variables, enums and types related to standard USB descriptors.
\r
+ *
\r
+ * @{
\r
+ */
\r
+
\r
#ifndef __USBDESCRIPTORS_H__
\r
#define __USBDESCRIPTORS_H__
\r
\r
#ifndef __USBDESCRIPTORS_H__
\r
#define __USBDESCRIPTORS_H__
\r
\r
@@
-52,7
+60,7
@@
#include <stdbool.h>
\r
\r
#include "../../../Common/Common.h"
\r
#include <stdbool.h>
\r
\r
#include "../../../Common/Common.h"
\r
- #include "
../LowLevel/
USBMode.h"
\r
+ #include "USBMode.h"
\r
#include "Events.h"
\r
\r
#if defined(USB_CAN_BE_DEVICE)
\r
#include "Events.h"
\r
\r
#if defined(USB_CAN_BE_DEVICE)
\r
@@
-108,69
+116,69
@@
* descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
\r
* from the host's VBUS line.
\r
*/
\r
* descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
\r
* from the host's VBUS line.
\r
*/
\r
- #define USB_CONFIG_ATTR_BUSPOWERED 0
b1000000
0
\r
+ #define USB_CONFIG_ATTR_BUSPOWERED 0
x8
0
\r
\r
/** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
\r
* descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
\r
* from the device's own power source.
\r
*/
\r
\r
/** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
\r
* descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
\r
* from the device's own power source.
\r
*/
\r
- #define USB_CONFIG_ATTR_SELFPOWERED 0
b1100000
0
\r
+ #define USB_CONFIG_ATTR_SELFPOWERED 0
xC
0
\r
\r
/** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
\r
* descriptor's ConfigAttributes value to indicate that the specified configuration supports the
\r
* remote wakeup feature of the USB standard, allowing a suspended USB device to wake up the host upon
\r
* request.
\r
*/
\r
\r
/** Can be masked with other configuration descriptor attributes for a USB_Descriptor_Configuration_Header_t
\r
* descriptor's ConfigAttributes value to indicate that the specified configuration supports the
\r
* remote wakeup feature of the USB standard, allowing a suspended USB device to wake up the host upon
\r
* request.
\r
*/
\r
- #define USB_CONFIG_ATTR_REMOTEWAKEUP 0
b1010000
0
\r
+ #define USB_CONFIG_ATTR_REMOTEWAKEUP 0
xA
0
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is not synchronized.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is not synchronized.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
- #define ENDPOINT_ATTR_NO_SYNC (0
b00
<< 2)
\r
+ #define ENDPOINT_ATTR_NO_SYNC (0 << 2)
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is asynchronous.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is asynchronous.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
- #define ENDPOINT_ATTR_ASYNC (
0b0
1 << 2)
\r
+ #define ENDPOINT_ATTR_ASYNC (1 << 2)
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is adaptive.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is adaptive.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
- #define ENDPOINT_ATTR_ADAPTIVE (
0b10
<< 2)
\r
+ #define ENDPOINT_ATTR_ADAPTIVE (
2
<< 2)
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is synchronized.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is synchronized.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint attributes.
\r
*/
\r
- #define ENDPOINT_ATTR_SYNC (
0b11
<< 2)
\r
+ #define ENDPOINT_ATTR_SYNC (
3
<< 2)
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is used for data transfers.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint usage attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is used for data transfers.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint usage attributes.
\r
*/
\r
- #define ENDPOINT_USAGE_DATA (0
b00
<< 4)
\r
+ #define ENDPOINT_USAGE_DATA (0 << 4)
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is used for feedback.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint usage attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is used for feedback.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint usage attributes.
\r
*/
\r
- #define ENDPOINT_USAGE_FEEDBACK (
0b0
1 << 4)
\r
+ #define ENDPOINT_USAGE_FEEDBACK (1 << 4)
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is used for implicit feedback.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint usage attributes.
\r
*/
\r
\r
/** Can be masked with other endpoint descriptor attributes for a USB_Descriptor_Endpoint_t descriptor's
\r
* Attributes value to indicate that the specified endpoint is used for implicit feedback.
\r
*
\r
* \see The USB specification for more details on the possible Endpoint usage attributes.
\r
*/
\r
- #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (
0b10
<< 4)
\r
+ #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (
2
<< 4)
\r
\r
/** Gives a void pointer to the specified descriptor (of any type). */
\r
#define DESCRIPTOR_ADDRESS(Descriptor) ((void*)&Descriptor)
\r
\r
/** Gives a void pointer to the specified descriptor (of any type). */
\r
#define DESCRIPTOR_ADDRESS(Descriptor) ((void*)&Descriptor)
\r
@@
-245,7
+253,7
@@
uint16_t ReleaseNumber; /**< Product release (version) number. */
\r
\r
uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The
\r
uint16_t ReleaseNumber; /**< Product release (version) number. */
\r
\r
uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The
\r
- * host will request this string via a sep
e
rate
\r
+ * host will request this string via a sep
a
rate
\r
* control request for the string descriptor.
\r
*
\r
* \note If no string supplied, use NO_DESCRIPTOR.
\r
* control request for the string descriptor.
\r
*
\r
* \note If no string supplied, use NO_DESCRIPTOR.
\r
@@
-255,7
+263,7
@@
* \see ManufacturerStrIndex structure entry.
\r
*/
\r
uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal
\r
* \see ManufacturerStrIndex structure entry.
\r
*/
\r
uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal
\r
- * serial number, in uppercase Unicode
d
ASCII.
\r
+ * serial number, in uppercase Unicode ASCII.
\r
*
\r
* \see ManufacturerStrIndex structure entry.
\r
*/
\r
*
\r
* \see ManufacturerStrIndex structure entry.
\r
*/
\r
@@
-363,7
+371,7
@@
\r
/** Type define for a standard interface association descriptor.
\r
*
\r
\r
/** Type define for a standard interface association descriptor.
\r
*
\r
- * This descriptor has been added as a suppl
i
ment to the USB2.0 standard, in the ECN located at
\r
+ * This descriptor has been added as a suppl
e
ment to the USB2.0 standard, in the ECN located at
\r
* <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
\r
* devices with multiple interfaces related to the same function to have the multiple interfaces bound
\r
* together at the point of enumeration, loading one generic driver for all the interfaces in the single
\r
* <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
\r
* devices with multiple interfaces related to the same function to have the multiple interfaces bound
\r
* together at the point of enumeration, loading one generic driver for all the interfaces in the single
\r
@@
-425,7
+433,7
@@
* maximum packet size that the endpoint can receive at a time.
\r
*/
\r
\r
* maximum packet size that the endpoint can receive at a time.
\r
*/
\r
\r
- uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpont
\r
+ uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpo
i
nt
\r
* if it is an INTERRUPT or ISOCHRONOUS type.
\r
*/
\r
#else
\r
* if it is an INTERRUPT or ISOCHRONOUS type.
\r
*/
\r
#else
\r
@@
-472,12
+480,6
@@
int16_t bString[];
\r
#endif
\r
} USB_Descriptor_String_t;
\r
int16_t bString[];
\r
#endif
\r
} USB_Descriptor_String_t;
\r
-
\r
- typedef struct
\r
- {
\r
- uint16_t Size;
\r
- void* Address;
\r
- } USB_Descriptor_Details_t;
\r
\r
/* Function Prototypes: */
\r
/** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,
\r
\r
/* Function Prototypes: */
\r
/** Function to retrieve a given descriptor's size and memory location from the given descriptor type value,
\r
@@
-497,7
+499,7
@@
*
\r
* \note By default, the library expects all descriptors to be located in flash memory via the PROGMEM attribute.
\r
* If descriptors should be located in RAM or EEPROM instead (to speed up access in the case of RAM, or to
\r
*
\r
* \note By default, the library expects all descriptors to be located in flash memory via the PROGMEM attribute.
\r
* If descriptors should be located in RAM or EEPROM instead (to speed up access in the case of RAM, or to
\r
- * allow the descriptors to be changed dynamically at runtime) either the USE_
S
RAM_DESCRIPTORS or the
\r
+ * allow the descriptors to be changed dynamically at runtime) either the USE_RAM_DESCRIPTORS or the
\r
* USE_EEPROM_DESCRIPTORS tokens may be defined in the project makefile and passed to the compiler by the -D
\r
* switch.
\r
*
\r
* USE_EEPROM_DESCRIPTORS tokens may be defined in the project makefile and passed to the compiler by the -D
\r
* switch.
\r
*
\r
@@
-519,5
+521,7
@@
#if defined(__cplusplus)
\r
}
\r
#endif
\r
#if defined(__cplusplus)
\r
}
\r
#endif
\r
-
\r
+
\r
#endif
\r
#endif
\r
+
\r
+/** @} */
\r