3 Copyright (C) Dean Camera, 2014.
5 dean [at] fourwalledcubicle [dot] com
10 Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
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.
21 The author disclaims 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
32 * \brief Common definitions and declarations for the library USB Printer Class driver.
34 * Common definitions and declarations for the library USB Printer Class driver.
36 * \note This file should not be included directly. It is automatically included as needed by the USB module driver
37 * dispatch header located in LUFA/Drivers/USB.h.
40 /** \ingroup Group_USBClassPrinter
41 * \defgroup Group_USBClassPrinterCommon Common Class Definitions
43 * \section Sec_USBClassPrinterCommon_ModDescription Module Description
44 * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
50 #ifndef _PRINTER_CLASS_COMMON_H_
51 #define _PRINTER_CLASS_COMMON_H_
54 #include "../../Core/StdDescriptors.h"
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
67 /** \name Virtual Printer Status Line Masks */
69 /** Port status mask for a printer device, indicating that an error has *not* occurred. */
70 #define PRNT_PORTSTATUS_NOTERROR (1 << 3)
72 /** Port status mask for a printer device, indicating that the device is currently selected. */
73 #define PRNT_PORTSTATUS_SELECT (1 << 4)
75 /** Port status mask for a printer device, indicating that the device is currently out of paper. */
76 #define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5)
80 /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer
83 enum PRNT_Descriptor_ClassSubclassProtocol_t
85 PRNT_CSCP_PrinterClass = 0x07, /**< Descriptor Class value indicating that the device or interface
86 * belongs to the Printer class.
88 PRNT_CSCP_PrinterSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface
89 * belongs to the Printer subclass.
91 PRNT_CSCP_BidirectionalProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface
92 * belongs to the Bidirectional protocol of the Printer class.
96 /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */
97 enum PRNT_ClassRequests_t
99 PRNT_REQ_GetDeviceID = 0x00, /**< Printer class-specific request to retrieve the Unicode ID
100 * string of the device, containing the device's name, manufacturer
101 * and supported printer languages.
103 PRNT_REQ_GetPortStatus = 0x01, /**< Printer class-specific request to get the current status of the
104 * virtual printer port, for device selection and ready states.
106 PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new
111 /* Disable C linkage for C++ Compilers: */
112 #if defined(__cplusplus)