Speed up bit-banged USART code in the AVRISP project.
[pub/USBasp.git] / LUFA / Drivers / USB / LowLevel / Device.h
index e162a59..acffd80 100644 (file)
                                 *  \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
                                 *  \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
 \r
                                #define USB_Device_IsUSBSuspended()           ((UDINT &  (1 << SUSPI)) ? true : false)\r
                        #else\r
                                #define USB_Device_SendRemoteWakeup()   MACROS{ UDCON |= (1 << RMWKUP); }MACROE\r
 \r
                                #define USB_Device_IsRemoteWakeupSent()       ((UDCON &  (1 << RMWKUP)) ? false : true)\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
                        #endif\r
                        \r
                /* Type Defines: */\r
        #if !defined(__DOXYGEN__)\r
                /* Macros: */           \r
                        #define USB_Device_SetLowSpeed()        MACROS{ UDCON |=  (1 << LSM);   }MACROE\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
        #endif\r
 \r
 #endif\r