* 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
+/** \ingroup Group_USB\r
+ * @defgroup Group_Device Device Management\r
+ *\r
+ * Functions, macros, variables, enums and types related to the management of a USB device when in Device mode.\r
+ *\r
+ * @{\r
+ */\r
\r
#ifndef __USBDEVICE_H__\r
#define __USBDEVICE_H__\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
+ /* Psuedo-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 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
+ 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 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
+ * \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. 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
+ * \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
#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