* 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
* 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 0b10000000\r
+ #define USB_CONFIG_ATTR_BUSPOWERED 0x80\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 0b11000000\r
+ #define USB_CONFIG_ATTR_SELFPOWERED 0xC0\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 0b10100000\r
+ #define USB_CONFIG_ATTR_REMOTEWAKEUP 0xA0\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 (0b00 << 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
- #define ENDPOINT_ATTR_ASYNC (0b01 << 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
- #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
- #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
- #define ENDPOINT_USAGE_DATA (0b00 << 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
- #define ENDPOINT_USAGE_FEEDBACK (0b01 << 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
- #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
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
#if defined(__cplusplus)\r
}\r
#endif\r
- \r
+ \r
#endif\r
+\r
+/** @} */\r