Add FatFS library to the Webserver project, extend the HTTP server so that it now...
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Device.h
index e162a59..110adad 100644 (file)
@@ -1,21 +1,21 @@
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
@@ -83,7 +83,8 @@
                                 *  \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
+                                *        the \ref USB_RemoteWakeupEnabled flag is set). When the NO_DEVICE_REMOTE_WAKEUP compile\r
+                                *        time option is used, this macro is unavailable.\r
                                 *\r
                                 *  \see \ref Group_Descriptors for more information on the RMWAKEUP feature and device descriptors.\r
                                 */\r
@@ -96,7 +97,8 @@
                                 *  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
+                                *        supports the Remote Wakeup feature in the device descriptors. When the NO_DEVICE_REMOTE_WAKEUP\r
+                                *        compile time option is used, this macro is unavailable.\r
                                 *\r
                                 *  \see \ref Group_Descriptors for more information on the RMWAKEUP feature and device descriptors.\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
+                               \r
+                               /** Enables the device mode Start Of Frame events. When enabled, this causes the\r
+                                *  \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,\r
+                                *  at the start of each USB frame when enumerated in device mode.\r
+                                */\r
+                               static inline bool USB_Device_EnableSOFEvents(void);\r
+                               \r
+                               /** Disables the device mode Start Of Frame events. When disabled, this stop the firing of the\r
+                                *  \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.\r
+                                */\r
+                               static inline bool USB_Device_DisableSOFEvents(void);\r
                        #else\r
-                               #define USB_Device_SendRemoteWakeup()   MACROS{ UDCON |= (1 << RMWKUP); }MACROE\r
-\r
-                               #define USB_Device_IsRemoteWakeupSent()       ((UDCON &  (1 << RMWKUP)) ? false : true)\r
+                               #if !defined(NO_DEVICE_REMOTE_WAKEUP)\r
+                                       #define USB_Device_SendRemoteWakeup()   MACROS{ UDCON |= (1 << RMWKUP); }MACROE\r
 \r
+                                       #define USB_Device_IsRemoteWakeupSent()       ((UDCON &  (1 << RMWKUP)) ? false : true)\r
+                               #endif\r
+                               \r
                                #define USB_Device_IsUSBSuspended()           ((UDINT &  (1 << SUSPI)) ? true : false)\r
+                               \r
+                               #define USB_Device_EnableSOFEvents()    MACROS{ USB_INT_Enable(USB_INT_SOFI); }MACROE\r
+\r
+                               #define USB_Device_DisableSOFEvents()   MACROS{ USB_INT_Disable(USB_INT_SOFI); }MACROE\r
                        #endif\r
                        \r
                /* Type Defines: */\r
        #if !defined(__DOXYGEN__)\r
                /* Macros: */           \r
                        #define USB_Device_SetLowSpeed()        MACROS{ UDCON |=  (1 << LSM);   }MACROE\r
-                       #define USB_Device_SetHighSpeed()       MACROS{ UDCON &= ~(1 << LSM);   }MACROE\r
+                       #define USB_Device_SetFullSpeed()       MACROS{ UDCON &= ~(1 << LSM);   }MACROE\r
        #endif\r
 \r
 #endif\r