X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/99d8a3936384d1e9286dfecfb6f7896294cd6c11..bea72a8412f99b294c00341fa16a8308bcc66f15:/LUFA/Drivers/USB/HighLevel/Events.h diff --git a/LUFA/Drivers/USB/HighLevel/Events.h b/LUFA/Drivers/USB/HighLevel/Events.h index ab63c7bfe..f1d6f0316 100644 --- a/LUFA/Drivers/USB/HighLevel/Events.h +++ b/LUFA/Drivers/USB/HighLevel/Events.h @@ -87,15 +87,6 @@ /* Public Interface - May be used in end-application: */ /* Pseudo-Functions for Doxygen: */ #if !defined(__INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__) - /** Event for USB stack initialization failure. This event fires when the USB interface fails to - * initialize correctly due to a hardware or software fault. - * - * \note This event only exists on USB AVR models which support dual role modes. - * - * \param[in] ErrorCode Error code indicating the failure reason, a value in \ref USB_InitErrorCodes_t. - */ - void EVENT_USB_InitFailure(const uint8_t ErrorCode); - /** Event for USB mode pin level change. This event fires when the USB interface is set to dual role * mode, and the UID pin level has changed to indicate a new mode (device or host). This event fires * before the mode is switched to the newly indicated mode but after the \ref EVENT_USB_Device_Disconnect @@ -167,7 +158,8 @@ * \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see * \ref Group_USBManagement documentation). */ - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); /** Event for USB device enumeration completion. This event fires when a the USB interface is * in host mode and an attached USB device has been completely enumerated and is ready to be @@ -179,6 +171,23 @@ */ void EVENT_USB_Host_DeviceEnumerationComplete(void); + /** Event for USB Start Of Frame detection, when enabled. This event fires at the start of each USB + * frame, once per millisecond, and is synchronized to the USB bus. This can be used as an accurate + * millisecond timer source when the USB bus is not suspended while in host mode. + * + * This event is time-critical; it is run once per millisecond and thus long handlers will significantly + * degrade device performance. This event should only be enabled when needed to reduce device wake-ups. + * + * \note This event is not normally active - it must be manually enabled and disabled via the + * \ref USB_Host_EnableSOFEvents() and \ref USB_Host_DisableSOFEvents() commands after enumeration of + * a USB device. + * \n\n + * + * \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see + * \ref Group_USBManagement documentation). + */ + void EVENT_USB_Host_StartOfFrame(void); + /** Event for USB device connection. This event fires when the AVR in device mode and the device is connected * to a host, beginning the enumeration process, measured by a rising level on the AVR's VBUS pin. * @@ -188,7 +197,7 @@ * \note For the smaller series 2 USB AVRs with limited USB controllers, VBUS is not available to the USB controller. * this means that the current connection state is derived from the bus suspension and wake up events by default, * which is not always accurate (host may suspend the bus while still connected). If the actual connection state - * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behavior turned off by + * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection * and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually. * \n\n @@ -206,7 +215,7 @@ * \note For the smaller series 2 USB AVRs with limited USB controllers, VBUS is not available to the USB controller. * this means that the current connection state is derived from the bus suspension and wake up events by default, * which is not always accurate (host may suspend the bus while still connected). If the actual connection state - * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behavior turned off by + * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection * and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually. * \n\n @@ -326,7 +335,6 @@ void USB_Event_Stub(void) ATTR_CONST; #if defined(USB_CAN_BE_BOTH) - void EVENT_USB_InitFailure(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); #endif @@ -335,8 +343,10 @@ void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) - ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) + ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); + void EVENT_USB_Host_StartOfFrame(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); #endif #if defined(USB_CAN_BE_DEVICE)