Copy out the EndpointStream and PipeStream functions to each architecture, so that...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / EndpointStream.h
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 Endpoint data stream transmission and reception management.
33 * \copydetails Group_EndpointStreamRW
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_EndpointRW
40 * \defgroup Group_EndpointStreamRW Read/Write of Multi-Byte Streams
41 * \brief Endpoint 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 endpoints.
45 *
46 * @{
47 */
48
49 #ifndef __ENDPOINT_STREAM_H__
50 #define __ENDPOINT_STREAM_H__
51
52 /* Includes: */
53 #include "../../../Common/Common.h"
54 #include "USBMode.h"
55
56 /* Preprocessor Checks: */
57 #if !defined(__INCLUDE_FROM_USB_DRIVER)
58 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
59 #endif
60
61 /* Public Interface - May be used in end-application: */
62 /* Enums: */
63 /** Enum for the possible error return codes of the \c Endpoint_*_Stream_* functions. */
64 enum Endpoint_Stream_RW_ErrorCodes_t
65 {
66 ENDPOINT_RWSTREAM_NoError = 0, /**< Command completed successfully, no error. */
67 ENDPOINT_RWSTREAM_EndpointStalled = 1, /**< The endpoint was stalled during the stream
68 * transfer by the host or device.
69 */
70 ENDPOINT_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
71 * the transfer.
72 */
73 ENDPOINT_RWSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and
74 * no USB endpoint traffic can occur until the bus
75 * has resumed.
76 */
77 ENDPOINT_RWSTREAM_Timeout = 4, /**< The host failed to accept or send the next packet
78 * within the software timeout period set by the
79 * \ref USB_STREAM_TIMEOUT_MS macro.
80 */
81 ENDPOINT_RWSTREAM_IncompleteTransfer = 5, /**< Indicates that the endpoint bank became full or empty before
82 * the complete contents of the current stream could be
83 * transferred. The endpoint stream function should be called
84 * again to process the next chunk of data in the transfer.
85 */
86 };
87
88 /** Enum for the possible error return codes of the \c Endpoint_*_Control_Stream_* functions. */
89 enum Endpoint_ControlStream_RW_ErrorCodes_t
90 {
91 ENDPOINT_RWCSTREAM_NoError = 0, /**< Command completed successfully, no error. */
92 ENDPOINT_RWCSTREAM_HostAborted = 1, /**< The aborted the transfer prematurely. */
93 ENDPOINT_RWCSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
94 * the transfer.
95 */
96 ENDPOINT_RWCSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and
97 * no USB endpoint traffic can occur until the bus
98 * has resumed.
99 */
100 };
101
102 /* Architecture Includes: */
103 #if (ARCH == ARCH_AVR8)
104 #include "AVR8/EndpointStream_AVR8.h"
105 #elif (ARCH == ARCH_UC3)
106 #include "UC3/EndpointStream_UC3.h"
107 #endif
108
109 #endif
110
111 /** @} */
112