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.

PrinterClassCommon.h 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 Common definitions and declarations for the library USB Printer Class driver.
  28. *
  29. * Common definitions and declarations for the library USB Printer Class driver.
  30. *
  31. * \note This file should not be included directly. It is automatically included as needed by the USB module driver
  32. * dispatch header located in LUFA/Drivers/USB.h.
  33. */
  34. /** \ingroup Group_USBClassPrinter
  35. * \defgroup Group_USBClassPrinterCommon Common Class Definitions
  36. *
  37. * \section Sec_USBClassPrinterCommon_ModDescription Module Description
  38. * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
  39. * Printer Class.
  40. *
  41. * @{
  42. */
  43. #ifndef _PRINTER_CLASS_COMMON_H_
  44. #define _PRINTER_CLASS_COMMON_H_
  45. /* Includes: */
  46. #include "../../Core/StdDescriptors.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_PRINTER_DRIVER)
  53. #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
  54. #endif
  55. /* Macros: */
  56. /** \name Virtual Printer Status Line Masks */
  57. //@{
  58. /** Port status mask for a printer device, indicating that an error has *not* occurred. */
  59. #define PRNT_PORTSTATUS_NOTERROR (1 << 3)
  60. /** Port status mask for a printer device, indicating that the device is currently selected. */
  61. #define PRNT_PORTSTATUS_SELECT (1 << 4)
  62. /** Port status mask for a printer device, indicating that the device is currently out of paper. */
  63. #define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5)
  64. //@}
  65. /* Enums: */
  66. /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer
  67. * device class.
  68. */
  69. enum PRNT_Descriptor_ClassSubclassProtocol_t
  70. {
  71. PRNT_CSCP_PrinterClass = 0x07, /**< Descriptor Class value indicating that the device or interface
  72. * belongs to the Printer class.
  73. */
  74. PRNT_CSCP_PrinterSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface
  75. * belongs to the Printer subclass.
  76. */
  77. PRNT_CSCP_BidirectionalProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface
  78. * belongs to the Bidirectional protocol of the Printer class.
  79. */
  80. };
  81. /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */
  82. enum PRNT_ClassRequests_t
  83. {
  84. PRNT_REQ_GetDeviceID = 0x00, /**< Printer class-specific request to retrieve the Unicode ID
  85. * string of the device, containing the device's name, manufacturer
  86. * and supported printer languages.
  87. */
  88. PRNT_REQ_GetPortStatus = 0x01, /**< Printer class-specific request to get the current status of the
  89. * virtual printer port, for device selection and ready states.
  90. */
  91. PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new
  92. * printer commands.
  93. */
  94. };
  95. /* Disable C linkage for C++ Compilers: */
  96. #if defined(__cplusplus)
  97. }
  98. #endif
  99. #endif
  100. /** @} */