Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PipeStream.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2014.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaims all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. * \brief Pipe data stream transmission and reception management.
  28. * \copydetails Group_PipeStreamRW
  29. *
  30. * \note This file should not be included directly. It is automatically included as needed by the USB driver
  31. * dispatch header located in LUFA/Drivers/USB/USB.h.
  32. */
  33. /** \ingroup Group_PipeRW
  34. * \defgroup Group_PipeStreamRW Read/Write of Multi-Byte Streams
  35. * \brief Pipe data stream transmission and reception management.
  36. *
  37. * Functions, macros, variables, enums and types related to data reading and writing of data streams from
  38. * and to pipes.
  39. *
  40. * @{
  41. */
  42. #ifndef __PIPE_STREAM_H__
  43. #define __PIPE_STREAM_H__
  44. /* Includes: */
  45. #include "../../../Common/Common.h"
  46. #include "USBMode.h"
  47. /* Enable C linkage for C++ Compilers: */
  48. #if defined(__cplusplus)
  49. extern "C" {
  50. #endif
  51. /* Preprocessor Checks: */
  52. #if !defined(__INCLUDE_FROM_USB_DRIVER)
  53. #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
  54. #endif
  55. /* Public Interface - May be used in end-application: */
  56. /* Enums: */
  57. /** Enum for the possible error return codes of the Pipe_*_Stream_* functions. */
  58. enum Pipe_Stream_RW_ErrorCodes_t
  59. {
  60. PIPE_RWSTREAM_NoError = 0, /**< Command completed successfully, no error. */
  61. PIPE_RWSTREAM_PipeStalled = 1, /**< The device stalled the pipe during the transfer. */
  62. PIPE_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
  63. * the transfer.
  64. */
  65. PIPE_RWSTREAM_Timeout = 3, /**< The device failed to accept or send the next packet
  66. * within the software timeout period set by the
  67. * \ref USB_STREAM_TIMEOUT_MS macro.
  68. */
  69. PIPE_RWSTREAM_IncompleteTransfer = 4, /**< Indicates that the pipe bank became full/empty before the
  70. * complete contents of the stream could be transferred.
  71. */
  72. };
  73. /* Architecture Includes: */
  74. #if (ARCH == ARCH_AVR8)
  75. #include "AVR8/PipeStream_AVR8.h"
  76. #elif (ARCH == ARCH_UC3)
  77. #include "UC3/PipeStream_UC3.h"
  78. #endif
  79. /* Disable C linkage for C++ Compilers: */
  80. #if defined(__cplusplus)
  81. }
  82. #endif
  83. #endif
  84. /** @} */