3      Copyright (C) Dean Camera, 2010. 
   5   dean [at] fourwalledcubicle [dot] com 
   6       www.fourwalledcubicle.com 
  10   Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, distribute, and sell this  
  13   software and its documentation for any purpose is hereby granted 
  14   without fee, provided that the above copyright notice appear in  
  15   all copies and that both that the copyright notice and this 
  16   permission notice and warranty disclaimer appear in supporting  
  17   documentation, and that the name of the author not be used in  
  18   advertising or publicity pertaining to distribution of the  
  19   software without specific, written prior permission. 
  21   The author disclaim all warranties with regard to this 
  22   software, including all implied warranties of merchantability 
  23   and fitness.  In no event shall the author be liable for any 
  24   special, indirect or consequential damages or any damages 
  25   whatsoever resulting from loss of use, data or profits, whether 
  26   in an action of contract, negligence or other tortious action, 
  27   arising out of or in connection with the use or performance of 
  32  *  \brief USB endpoint/pipe stream callback management. 
  34  *  This file contains definitions for the creation of optional callback routines which can be passed to the 
  35  *  endpoint and/or pipe stream APIs, to abort the transfer currently in progress when a condition is met. 
  37  *  \note This file should not be included directly. It is automatically included as needed by the USB driver 
  38  *        dispatch header located in LUFA/Drivers/USB/USB.h. 
  41 /** \ingroup Group_USB 
  42  *  @defgroup Group_StreamCallbacks Endpoint and Pipe Stream Callbacks 
  44  *  Macros and enums for the stream callback routines. This module contains the code required to easily set up 
  45  *  stream callback functions which can be used to force early abort of a stream read/write process. Each callback 
  46  *  should take no arguments, and return a value from the \ref StreamCallback_Return_ErrorCodes_t enum. 
  51 #ifndef __STREAMCALLBACK_H__ 
  52 #define __STREAMCALLBACK_H__ 
  54         /* Preprocessor Checks: */ 
  55                 #if !defined(__INCLUDE_FROM_USB_DRIVER) 
  56                         #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. 
  59         /* Public Interface - May be used in end-application: */ 
  61                         /** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream 
  62                          *  call has no callback function to be called between USB packets. 
  64                         #define NO_STREAM_CALLBACK    NULL 
  67                         /** Enum for the possible error return codes of a stream callback function. */ 
  68                         enum StreamCallback_Return_ErrorCodes_t
 
  70                                 STREAMCALLBACK_Continue            
= 0, /**< Continue sending or receiving the stream. */ 
  71                                 STREAMCALLBACK_Abort               
= 1, /**< Abort the stream send or receiving process. */ 
  75                         /** Type define for a Stream Callback function (function taking no arguments and retuning a 
  76                          *  uint8_t value). Stream callback functions should have an identical function signature if they 
  77                          *  are to be used as the callback parameter of the stream functions. 
  79                         typedef uint8_t (* const StreamCallbackPtr_t
)(void);