* Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program\r
* execution aborted.\r
*/\r
-EVENT_HANDLER(USB_PowerOnFail)\r
+EVENT_HANDLER(USB_InitFailure)\r
{\r
char* ModeStrPtr;\r
\r
/** Indicates that this module will catch the USB_UIDChange event when thrown by the library. */\r
HANDLES_EVENT(USB_UIDChange);\r
\r
- /** Indicates that this module will catch the USB_PowerOnFail event when thrown by the library. */\r
- HANDLES_EVENT(USB_PowerOnFail);\r
+ /** Indicates that this module will catch the USB_InitFailure event when thrown by the library. */\r
+ HANDLES_EVENT(USB_InitFailure);\r
\r
/** Indicates that this module will catch the USB_HostError event when thrown by the library. */\r
HANDLES_EVENT(USB_HostError);\r
* - Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman)\r
* - Capitalised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and\r
* DSearch_Comp_Return_ErrorCodes_t enums\r
+ * - Removed "ERROR" from the enum names in the endpoint and pipe stream error code enums\r
+ * - Renamed the USB_PowerOnErrorCodes_t enum to USB_InitErrorCodes_t, renamed the POWERON_ERROR_NoUSBModeSpecified enum value to\r
+ * USB_INITERROR_NoUSBModeSpecified\r
+ * - Renamed USB_PowerOnFail event to USB_InitFailure\r
* - Changed over all deprecated GCC structure tag initializers to the standardized C99 format (thanks to Mike Alexander)\r
* - USB_HostRequest renamed to USB_ControlRequest, entire control request header is now read into USB_ControlRequest in Device mode\r
* rather than having the library pass only partially read header data to the application\r
*/\r
void USB_Disconnect(void);\r
\r
- /** Event for USB device power on failure. This event fires when the USB interface fails to\r
+ /** Event for USB initialization failure. This event fires when the USB interface fails to\r
* initialize correctly due to a hardware or software fault.\r
*\r
- * \param ErrorCode Error code indicating the failure reason, a value in \ref USB_PowerOnErrorCodes_t\r
+ * \note This event only exists on USB AVR models which support dual role modes.\r
+ *\r
+ * \param ErrorCode Error code indicating the failure reason, a value in \ref USB_InitErrorCodes_t\r
* located in LowLevel.h.\r
*/\r
- void USB_PowerOnFail(const uint8_t ErrorCode);\r
+ void USB_InitFailure(const uint8_t ErrorCode);\r
\r
/** Event for USB mode pin level change. This event fires when the USB interface is set to dual role\r
* mode, and the UID pin level has changed to indicate a new mode (device or host). This event fires\r
#define USB_DeviceEnumerationComplete_P (void)\r
\r
#if defined(USB_CAN_BE_BOTH)\r
- #define USB_PowerOnFail_P (const uint8_t ErrorCode)\r
+ #define USB_InitFailure_P (const uint8_t ErrorCode)\r
#define USB_UIDChange_P (void)\r
#endif\r
\r
ALIAS_STUB(USB_DeviceEnumerationComplete);\r
\r
#if defined(USB_CAN_BE_BOTH)\r
- ALIAS_STUB(USB_PowerOnFail);\r
+ ALIAS_STUB(USB_InitFailure);\r
ALIAS_STUB(USB_UIDChange);\r
#endif\r
\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
}\r
}\r
\r
- return ENDPOINT_RWSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
}\r
}\r
\r
- return ENDPOINT_RWSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
}\r
}\r
\r
- return ENDPOINT_RWSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
}\r
}\r
\r
- return ENDPOINT_RWSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return ENDPOINT_RWSTREAM_ERROR_CallbackAborted;\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
}\r
}\r
\r
- return ENDPOINT_RWSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWSTREAM_NoError;\r
}\r
#endif\r
\r
}\r
\r
if (Endpoint_IsOUTReceived())\r
- return ENDPOINT_RWCSTREAM_ERROR_HostAborted;\r
+ return ENDPOINT_RWCSTREAM_HostAborted;\r
\r
if (LastPacketFull)\r
{\r
\r
while (!(Endpoint_IsOUTReceived()));\r
\r
- return ENDPOINT_RWCSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWCSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Write_Control_Stream_BE(const void* Buffer, uint16_t Length)\r
}\r
\r
if (Endpoint_IsOUTReceived())\r
- return ENDPOINT_RWCSTREAM_ERROR_HostAborted;\r
+ return ENDPOINT_RWCSTREAM_HostAborted;\r
\r
if (LastPacketFull)\r
{\r
\r
while (!(Endpoint_IsOUTReceived()));\r
\r
- return ENDPOINT_RWCSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWCSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)\r
\r
while (!(Endpoint_IsINReady()));\r
\r
- return ENDPOINT_RWCSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWCSTREAM_NoError;\r
}\r
\r
uint8_t Endpoint_Read_Control_Stream_BE(void* Buffer, uint16_t Length)\r
\r
while (!(Endpoint_IsINReady()));\r
\r
- return ENDPOINT_RWCSTREAM_ERROR_NoError;\r
+ return ENDPOINT_RWCSTREAM_NoError;\r
}\r
\r
#endif\r
*/\r
enum Endpoint_Stream_RW_ErrorCodes_t\r
{\r
- ENDPOINT_RWSTREAM_ERROR_NoError = 0, /**< Command completed successfully, no error. */\r
- ENDPOINT_RWSTREAM_ERROR_EndpointStalled = 1, /**< The endpoint was stalled during the stream\r
- * transfer by the host or device.\r
- */\r
- ENDPOINT_RWSTREAM_ERROR_DeviceDisconnected = 1, /**< Device was disconnected from the host during\r
- * the transfer.\r
- */\r
- ENDPOINT_RWSTREAM_ERROR_Timeout = 2, /**< The host failed to accept or send the next packet\r
- * within the software timeout period set by the\r
- * \ref USB_STREAM_TIMEOUT_MS macro.\r
- */\r
- ENDPOINT_RWSTREAM_ERROR_CallbackAborted = 3, /**< Indicates that the stream's callback function\r
- * aborted the transfer early.\r
- */\r
+ ENDPOINT_RWSTREAM_NoError = 0, /**< Command completed successfully, no error. */\r
+ ENDPOINT_RWSTREAM_EndpointStalled = 1, /**< The endpoint was stalled during the stream\r
+ * transfer by the host or device.\r
+ */\r
+ ENDPOINT_RWSTREAM_DeviceDisconnected = 1, /**< Device was disconnected from the host during\r
+ * the transfer.\r
+ */\r
+ ENDPOINT_RWSTREAM_Timeout = 2, /**< The host failed to accept or send the next packet\r
+ * within the software timeout period set by the\r
+ * \ref USB_STREAM_TIMEOUT_MS macro.\r
+ */\r
+ ENDPOINT_RWSTREAM_CallbackAborted = 3, /**< Indicates that the stream's callback function\r
+ * aborted the transfer early.\r
+ */\r
};\r
\r
/** Enum for the possible error return codes of the Endpoint_*_Control_Stream_* functions..\r
*/\r
enum Endpoint_ControlStream_RW_ErrorCodes_t\r
{\r
- ENDPOINT_RWCSTREAM_ERROR_NoError = 0, /**< Command completed successfully, no error. */\r
- ENDPOINT_RWCSTREAM_ERROR_HostAborted = 1, /**< The aborted the transfer prematurely. */\r
+ ENDPOINT_RWCSTREAM_NoError = 0, /**< Command completed successfully, no error. */\r
+ ENDPOINT_RWCSTREAM_HostAborted = 1, /**< The aborted the transfer prematurely. */\r
};\r
\r
/* Inline Functions: */\r
}\r
else\r
{\r
- RAISE_EVENT(USB_PowerOnFail, POWERON_ERROR_NoUSBModeSpecified);\r
+ RAISE_EVENT(USB_InitFailure, USB_INITERROR_NoUSBModeSpecified);\r
return;\r
}\r
#endif\r
/** Enum for error codes relating to the powering on of the USB interface. These error codes are\r
* used in the ErrorCode parameter value of the \ref USB_PowerOnFail event.\r
*/\r
- enum USB_PowerOnErrorCodes_t\r
+ enum USB_InitErrorCodes_t\r
{\r
- POWERON_ERROR_NoUSBModeSpecified = 0, /**< Indicates that \ref USB_Init() was called with an\r
+ USB_INITERROR_NoUSBModeSpecified = 0, /**< Indicates that \ref USB_Init() was called with an\r
* invalid or missing Mode parameter.\r
*/\r
};\r
*\r
* \see Events.h for more information on this event.\r
*/\r
- RAISES_EVENT(USB_PowerOnFail);\r
+ RAISES_EVENT(USB_InitFailure);\r
#endif\r
\r
/* Private Interface - For use in library only: */\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return PIPE_RWSTREAM_ERROR_CallbackAborted;\r
+ return PIPE_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))\r
}\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return PIPE_RWSTREAM_ERROR_CallbackAborted;\r
+ return PIPE_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))\r
}\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t Pipe_Discard_Stream(uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return PIPE_RWSTREAM_ERROR_CallbackAborted;\r
+ return PIPE_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))\r
}\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return PIPE_RWSTREAM_ERROR_CallbackAborted;\r
+ return PIPE_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))\r
}\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length\r
\r
#if !defined(NO_STREAM_CALLBACKS)\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
- return PIPE_RWSTREAM_ERROR_CallbackAborted;\r
+ return PIPE_RWSTREAM_CallbackAborted;\r
#endif\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))\r
}\r
}\r
\r
- return PIPE_RWSTREAM_ERROR_NoError;\r
+ return PIPE_RWSTREAM_NoError;\r
}\r
\r
#endif\r
*/\r
enum Pipe_Stream_RW_ErrorCodes_t\r
{\r
- PIPE_RWSTREAM_ERROR_NoError = 0, /**< Command completed successfully, no error. */\r
- PIPE_RWSTREAM_ERROR_PipeStalled = 1, /**< The device stalled the pipe during the transfer. */ \r
- PIPE_RWSTREAM_ERROR_DeviceDisconnected = 2, /**< Device was disconnected from the host during\r
- * the transfer.\r
- */ \r
- PIPE_RWSTREAM_ERROR_Timeout = 3, /**< The device failed to accept or send the next packet\r
- * within the software timeout period set by the\r
- * \ref USB_STREAM_TIMEOUT_MS macro.\r
- */\r
- PIPE_RWSTREAM_ERROR_CallbackAborted = 4, /**< Indicates that the stream's callback function aborted\r
- * the transfer early.\r
- */\r
+ PIPE_RWSTREAM_NoError = 0, /**< Command completed successfully, no error. */\r
+ PIPE_RWSTREAM_PipeStalled = 1, /**< The device stalled the pipe during the transfer. */ \r
+ PIPE_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during\r
+ * the transfer.\r
+ */ \r
+ PIPE_RWSTREAM_Timeout = 3, /**< The device failed to accept or send the next packet\r
+ * within the software timeout period set by the\r
+ * \ref USB_STREAM_TIMEOUT_MS macro.\r
+ */\r
+ PIPE_RWSTREAM_CallbackAborted = 4, /**< Indicates that the stream's callback function aborted\r
+ * the transfer early.\r
+ */\r
};\r
\r
/* Inline Functions: */\r
* - The Drivers/AT90USBXXX directory has been renamed to Drivers/Peripheral.\r
* - The Serial_Stream driver has been renamed to SerialStream to remain consistent with the rest of the library naming scheme.\r
*\r
+ * <b>Dual Role Mode</b>\r
+ * - The USB_PowerOnFail even has been renamed to USB_InitFailure.\r
+ *\r
* <b>Library Demos</b>\r
* - Most demos, bootloaders and applications have had significant changes from previous versions. Applications built off of any\r
* library demos should update to the latest versions.\r
* USB_ControlRequest structure.\r
* - The FEATURELESS_CONTROL_ONLY_DEVICE token has been renamed to CONTROL_ONLY_DEVICE.\r
* - The STATIC_ENDPOINT_CONFIGURATION is no longer applicable as the library will apply this optimization when appropriate automatically.\r
+ * - The values of the Endpoint_Stream_RW_ErrorCodes_t and Endpoint_ControlStream_RW_ErrorCodes_t enums have had the "ERROR_" portion\r
+ * of their names removed.\r
*\r
* <b>Host Mode</b>\r
* - The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0) to allow it to be used on\r
* and "Descriptor_Search_Comp" prefixes changed to all caps.\r
* - The USB_HostRequest global has been renamed to USB_ControlRequest, and is used in Device mode also. The USB_Host_Request_Header_t\r
* structure type has been renamed to USB_Request_Header_t.\r
+ * - The values of the Pipe_Stream_RW_ErrorCodes_t enum have had the "ERROR_" portion of their names removed.\r
+ *\r
*\r
* \section Sec_Migration090401 Migrating from 090209 to 090401\r
*\r