Fix CDC blocking streams in Host mode locking up when the device is removed.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / MIDI.h
index 35671f9..31b7991 100644 (file)
@@ -1,21 +1,21 @@
 /*\r
              LUFA Library\r
 /*\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
               \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
 \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
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
                                const struct\r
                                {\r
                                        uint8_t  DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe */\r
                                const struct\r
                                {\r
                                        uint8_t  DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe */\r
+                                       bool     DataINPipeDoubleBank; /** Indicates if the MIDI interface's IN data pipe should use double banking */\r
+                                       \r
                                        uint8_t  DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe */\r
                                        uint8_t  DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe */\r
+                                       bool     DataOUTPipeDoubleBank; /** Indicates if the MIDI interface's OUT data pipe should use double banking */\r
                                } Config; /**< Config data for the USB class interface within the device. All elements in this section\r
                                           *   <b>must</b> be set or the interface will fail to enumerate and operate correctly.\r
                                           */\r
                                } Config; /**< Config data for the USB class interface within the device. All elements in this section\r
                                           *   <b>must</b> be set or the interface will fail to enumerate and operate correctly.\r
                                           */\r
                         *  \return A value from the \ref MIDIHost_EnumerationFailure_ErrorCodes_t enum\r
                         */\r
                        uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,\r
                         *  \return A value from the \ref MIDIHost_EnumerationFailure_ErrorCodes_t enum\r
                         */\r
                        uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,\r
-                                                        uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3);\r
+                                                        void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);\r
 \r
                        /** Sends a MIDI event packet to the device. If no device is connected, the event packet is discarded.\r
                         *\r
 \r
                        /** Sends a MIDI event packet to the device. If no device is connected, the event packet is discarded.\r
                         *\r
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum                       \r
                         */\r
                        uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,\r
                         *  \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum                       \r
                         */\r
                        uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,\r
-                                                         MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(12);\r
+                                                         MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
 \r
                        /** Receives a MIDI event packet from the device.\r
                         *\r
 \r
                        /** Receives a MIDI event packet from the device.\r
                         *\r
                         *  \return Boolean true if a MIDI event packet was received, false otherwise\r
                         */\r
                        bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,\r
                         *  \return Boolean true if a MIDI event packet was received, false otherwise\r
                         */\r
                        bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,\r
-                                                         MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(12);\r
+                                                         MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
                                                                                                \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
                                                                                                \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r