Renamed the the TotalHIDReports element of the HID descriptor structure in the HID...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Device.h
index c6e5f7f..411ece0 100644 (file)
   arising out of or in connection with the use or performance of\r
   this software.\r
 */\r
-\r
-/** \file\r
\r
+/** \ingroup Group_USB\r
+ *  @defgroup Group_Device Device Management\r
  *\r
  *  USB Device mode related macros and enums. This module contains macros and enums which are used when\r
  *  the USB controller is initialized in device mode.\r
+ *\r
+ *  @{\r
  */\r
 \r
 #ifndef __USBDEVICE_H__\r
@@ -48,7 +51,7 @@
        /* Public Interface - May be used in end-application: */\r
                /* Macros: */\r
                        #if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER) || defined(__DOXYGEN__)\r
-                               /** Mask for the Options parameter of the USB_Init() function. This indicates that the\r
+                               /** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the\r
                                 *  USB interface should be initialized in low speed (1.5Mb/s) mode.\r
                                 *\r
                                 *  \note Low Speed mode is not available on all USB AVR models.\r
                         */\r
                        #define USB_DEVICE_OPT_FULLSPEED               (0 << 0)\r
                        \r
-                       /** Sends a Remote Wakeup request to the host. This signals to the host that the device should\r
-                        *  be taken out of suspended mode, and communications should resume.\r
-                        *\r
-                        *  Typically, this is implemented so that HID devices (mice, keyboards, etc.) can wake up the\r
-                        *  host computer when the host has suspended all USB devices to enter a low power state.\r
-                        *\r
-                        *  \note This macro should only be used if the device has indicated to the host that it\r
-                        *        supports the Remote Wakeup feature in the device descriptors, and should only be\r
-                        *        issued if the host is currently allowing remote wakeup events from the device (i.e.,\r
-                        *        the USB_RemoteWakeupEnabled flag is set, see DevChapter9.h documentation).\r
-                        *\r
-                        *  \see StdDescriptors.h for more information on the RMWAKEUP feature and device descriptors.\r
-                        */\r
-                       #define USB_Device_SendRemoteWakeup()   MACROS{ UDCON |= (1 << RMWKUP); }MACROE\r
+               /* Pseudo-Function Macros: */\r
+                       #if defined(__DOXYGEN__)\r
+                               /** Sends a Remote Wakeup request to the host. This signals to the host that the device should\r
+                                *  be taken out of suspended mode, and communications should resume.\r
+                                *\r
+                                *  Typically, this is implemented so that HID devices (mice, keyboards, etc.) can wake up the\r
+                                *  host computer when the host has suspended all USB devices to enter a low power state.\r
+                                *\r
+                                *  \note This macro should only be used if the device has indicated to the host that it\r
+                                *        supports the Remote Wakeup feature in the device descriptors, and should only be\r
+                                *        issued if the host is currently allowing remote wakeup events from the device (i.e.,\r
+                                *        the \ref USB_RemoteWakeupEnabled flag is set).\r
+                                *\r
+                                *  \see \ref Group_Descriptors for more information on the RMWAKEUP feature and device descriptors.\r
+                                */\r
+                               static inline void USB_Device_SendRemoteWakeup(void);\r
+                               \r
+                               /** Indicates if a Remote Wakeup request is being sent to the host. This returns true if a\r
+                                *  remote wakeup is currently being sent, false otherwise.\r
+                                *\r
+                                *  This can be used in conjunction with the \ref USB_Device_IsUSBSuspended() macro to determine if\r
+                                *  a sent RMWAKEUP request was accepted or rejected by the host.\r
+                                *\r
+                                *  \note This macro should only be used if the device has indicated to the host that it\r
+                                *        supports the Remote Wakeup feature in the device descriptors.\r
+                                *\r
+                                *  \see \ref Group_Descriptors for more information on the RMWAKEUP feature and device descriptors.\r
+                                *\r
+                                *  \return Boolean true if no Remote Wakeup request is currently being sent, false otherwise\r
+                                */\r
+                               static inline bool USB_Device_IsRemoteWakeupSent(void);\r
+                               \r
+                               /** Indicates if the device is currently suspended by the host. Whilst suspended, the device is\r
+                                *  to enter a low power state until resumed by the host. No USB traffic to or from the device\r
+                                *  can occur (except for Remote Wakeup requests) during suspension by the host.\r
+                                *\r
+                                *  \return Boolean true if the USB communications have been suspended by the host, false otherwise.\r
+                                */\r
+                               static inline bool USB_Device_IsUSBSuspended(void);\r
+                       #else\r
+                               #define USB_Device_SendRemoteWakeup()   MACROS{ UDCON |= (1 << RMWKUP); }MACROE\r
 \r
-                       /** Indicates if a Remote Wakeup request is being sent to the host. This returns true if a\r
-                        *  remote wakeup is currently being sent, false otherwise.\r
-                        *\r
-                        *  This can be used in conjunction with the USB_Device_IsUSBSuspended() macro to determine if\r
-                        *  a sent RMWAKEUP request was accepted or rejected by the host.\r
-                        *\r
-                        *  \note This macro should only be used if the device has indicated to the host that it\r
-                        *        supports the Remote Wakeup feature in the device descriptors.\r
-                        *\r
-                        *  \see StdDescriptors.h for more information on the RMWAKEUP feature and device descriptors.\r
-                        */\r
-                       #define USB_Device_IsRemoteWakeupSent()       ((UDCON &  (1 << RMWKUP)) ? false : true)\r
+                               #define USB_Device_IsRemoteWakeupSent()       ((UDCON &  (1 << RMWKUP)) ? false : true)\r
 \r
-                       /** Indicates if the device is currently suspended by the host. While suspended, the device is\r
-                        *  to enter a low power state until resumed by the host. While suspended no USB traffic to or\r
-                        *  from the device can occur (except for Remote Wakeup requests).\r
-                        *\r
-                        *  This macro returns true if the USB communications have been suspended by the host, false\r
-                        *  otherwise.\r
-                        */\r
-                       #define USB_Device_IsUSBSuspended()           ((UDINT &  (1 << SUSPI)) ? true : false)\r
+                               #define USB_Device_IsUSBSuspended()           ((UDINT &  (1 << SUSPI)) ? true : false)\r
+                       #endif\r
 \r
                /* Enums: */\r
-                       /** Enum for the ErrorCode parameter of the USB_DeviceError event.\r
+                       /** Enum for the ErrorCode parameter of the \ref USB_DeviceError event.\r
                         *\r
                         *  \see Events.h for more information on this event.\r
                         */\r
                        enum USB_Device_ErrorCodes_t\r
                        {\r
-                               DEVICE_ERROR_GetDescriptorNotHooked        = 0, /**< Indicates that the GetDescriptor() method\r
+                               DEVICE_ERROR_GetDescriptorNotHooked        = 0, /**< Indicates that the \ref USB_GetDescriptor() method\r
                                                                                 *   has not been hooked by the user application.\r
                                                                                 *\r
-                                                                                *   \see StdDescriptors.h for more information on\r
-                                                                                *        the GetDescriptor() method.\r
+                                                                                *   \see \ref Group_Descriptors for more information on\r
+                                                                                *        the \ref USB_GetDescriptor() method.\r
                                                                                 */\r
                        };\r
 \r
                        #define USB_Device_SetLowSpeed()        MACROS{ UDCON |=  (1 << LSM);   }MACROE\r
                        #define USB_Device_SetHighSpeed()       MACROS{ UDCON &= ~(1 << LSM);   }MACROE\r
        #endif\r
-       \r
+\r
 #endif\r
+\r
+/** @} */\r