Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (4.62 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 Common USB Pipe definitions for all architectures.
33
 *  \copydetails Group_PipeManagement
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_PipeManagement
40
 *  \defgroup Group_PipeRW Pipe Data Reading and Writing
41
 *  \brief Pipe data read/write definitions.
42
 *
43
 *  Functions, macros, variables, enums and types related to data reading and writing from and to pipes.
44
 */
45

    
46
/** \ingroup Group_PipeRW
47
 *  \defgroup Group_PipePrimitiveRW Read/Write of Primitive Data Types
48
 *  \brief Pipe data primitive read/write definitions.
49
 *
50
 *  Functions, macros, variables, enums and types related to data reading and writing of primitive data types
51
 *  from and to pipes.
52
 */
53

    
54
/** \ingroup Group_PipeManagement
55
 *  \defgroup Group_PipePacketManagement Pipe Packet Management
56
 *  \brief Pipe packet management definitions.
57
 *
58
 *  Functions, macros, variables, enums and types related to packet management of pipes.
59
 */
60

    
61
/** \ingroup Group_PipeManagement
62
 *  \defgroup Group_PipeControlReq Pipe Control Request Management
63
 *  \brief Pipe control request definitions.
64
 *
65
 *  Module for host mode request processing. This module allows for the transmission of standard, class and
66
 *  vendor control requests to the default control endpoint of an attached device while in host mode.
67
 *
68
 *  \see Chapter 9 of the USB 2.0 specification.
69
 */
70

    
71
/** \ingroup Group_USB
72
 *  \defgroup Group_PipeManagement Pipe Management
73
 *  \brief Pipe management definitions.
74
 *
75
 *  This module contains functions, macros and enums related to pipe management when in USB Host mode. This
76
 *  module contains the pipe management macros, as well as pipe interrupt and data send/receive functions
77
 *  for various data types.
78
 *
79
 *  @{
80
 */
81

    
82
#ifndef __PIPE_H__
83
#define __PIPE_H__
84

    
85
        /* Includes: */
86
                #include "../../../Common/Common.h"
87
                #include "USBMode.h"
88

    
89
        /* Enable C linkage for C++ Compilers: */
90
                #if defined(__cplusplus)
91
                        extern "C" {
92
                #endif
93

    
94
        /* Preprocessor Checks: */
95
                #if !defined(__INCLUDE_FROM_USB_DRIVER)
96
                        #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
97
                #endif
98

    
99
        /* Public Interface - May be used in end-application: */
100
                /* Macros: */
101
                        /** Pipe address for the default control pipe, which always resides in address 0. This is
102
                         *  defined for convenience to give more readable code when used with the pipe macros.
103
                         */
104
                        #define PIPE_CONTROLPIPE                0
105

    
106
                        /** Pipe number mask, for masking against pipe addresses to retrieve the pipe's numerical address
107
                         *  in the device.
108
                         */
109
                        #define PIPE_PIPENUM_MASK               0x07
110

    
111
                        /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's
112
                         *  numerical address in the attached device.
113
                         */
114
                        #define PIPE_EPNUM_MASK                 0x0F
115

    
116
                        /** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's
117
                         *  direction for comparing with the \c ENDPOINT_DESCRIPTOR_DIR_* masks.
118
                         */
119
                        #define PIPE_EPDIR_MASK                 0x80
120

    
121
        /* Architecture Includes: */
122
                #if (ARCH == ARCH_AVR8)
123
                        #include "AVR8/Pipe_AVR8.h"
124
                #elif (ARCH == ARCH_UC3)
125
                        #include "UC3/Pipe_UC3.h"
126
                #endif
127

    
128
        /* Disable C linkage for C++ Compilers: */
129
                #if defined(__cplusplus)
130
                        }
131
                #endif
132

    
133
#endif
134

    
135
/** @} */
136