Statistics
| Branch: | Tag: | Revision:

root / LUFA / Drivers / USB / Core / PipeStream.h @ 978b99e5

History | View | Annotate | Download (3.65 KB)

1
/*
2
             LUFA Library
3
     Copyright (C) Dean Camera, 2011.
4
              
5
  dean [at] fourwalledcubicle [dot] com
6
           www.lufa-lib.org
7
*/
8

    
9
/*
10
  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
11

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.
20

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
28
  this software.
29
*/
30
 
31
/** \file
32
 *  \brief Pipe data stream transmission and reception management.
33
 *  \copydetails Group_PipeStreamRW
34
 *
35
 *  \note This file should not be included directly. It is automatically included as needed by the USB driver
36
 *        dispatch header located in LUFA/Drivers/USB/USB.h.
37
 */
38

    
39
/** \ingroup Group_PipeRW  
40
 *  \defgroup Group_PipeStreamRW Read/Write of Multi-Byte Streams
41
 *  \brief Pipe data stream transmission and reception management.
42
 *
43
 *  Functions, macros, variables, enums and types related to data reading and writing of data streams from
44
 *  and to pipes.
45
 *
46
 *  @{
47
 */
48

    
49
#ifndef __PIPE_STREAM_H__
50
#define __PIPE_STREAM_H__
51

    
52
        /* Includes: */
53
                #include "../../../Common/Common.h"
54
                #include "USBMode.h"
55
                
56
        /* Enable C linkage for C++ Compilers: */
57
                #if defined(__cplusplus)
58
                        extern "C" {
59
                #endif
60

    
61
        /* Preprocessor Checks: */
62
                #if !defined(__INCLUDE_FROM_USB_DRIVER)
63
                        #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
64
                #endif
65
                
66
        /* Public Interface - May be used in end-application: */
67
                /* Enums: */
68
                        /** Enum for the possible error return codes of the Pipe_*_Stream_* functions. */
69
                        enum Pipe_Stream_RW_ErrorCodes_t
70
                        {
71
                                PIPE_RWSTREAM_NoError            = 0, /**< Command completed successfully, no error. */
72
                                PIPE_RWSTREAM_PipeStalled        = 1, /**< The device stalled the pipe during the transfer. */                
73
                                PIPE_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
74
                                                                   *   the transfer.
75
                                                                   */                
76
                                PIPE_RWSTREAM_Timeout            = 3, /**< The device failed to accept or send the next packet
77
                                                                       *   within the software timeout period set by the
78
                                                                       *   \ref USB_STREAM_TIMEOUT_MS macro.
79
                                                                       */
80
                                PIPE_RWSTREAM_IncompleteTransfer = 4, /**< Indicates that the pipe bank became full/empty before the
81
                                                                       *   complete contents of the stream could be transferred.
82
                                                                       */
83
                        };
84

    
85
        /* Architecture Includes: */
86
                #if (ARCH == ARCH_AVR8)
87
                        #include "AVR8/PipeStream_AVR8.h"
88
                #elif (ARCH == ARCH_UC3)
89
                        #include "UC3/PipeStream_UC3.h"
90
                #endif
91

    
92
        /* Disable C linkage for C++ Compilers: */
93
                #if defined(__cplusplus)
94
                        }
95
                #endif
96
        
97
#endif
98

    
99
/** @} */
100