diff options
Diffstat (limited to 'lib/lufa/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h')
| -rw-r--r-- | lib/lufa/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h b/lib/lufa/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h new file mode 100644 index 000000000..2db830e04 --- /dev/null +++ b/lib/lufa/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | /* | ||
| 2 | LUFA Library | ||
| 3 | Copyright (C) Dean Camera, 2017. | ||
| 4 | |||
| 5 | dean [at] fourwalledcubicle [dot] com | ||
| 6 | www.lufa-lib.org | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* | ||
| 10 | Copyright 2017 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 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 | ||
| 28 | this software. | ||
| 29 | */ | ||
| 30 | |||
| 31 | /** \file | ||
| 32 | * \brief Common definitions and declarations for the library USB Printer Class driver. | ||
| 33 | * | ||
| 34 | * Common definitions and declarations for the library USB Printer Class driver. | ||
| 35 | * | ||
| 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. | ||
| 38 | */ | ||
| 39 | |||
| 40 | /** \ingroup Group_USBClassPrinter | ||
| 41 | * \defgroup Group_USBClassPrinterCommon Common Class Definitions | ||
| 42 | * | ||
| 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 | ||
| 45 | * Printer Class. | ||
| 46 | * | ||
| 47 | * @{ | ||
| 48 | */ | ||
| 49 | |||
| 50 | #ifndef _PRINTER_CLASS_COMMON_H_ | ||
| 51 | #define _PRINTER_CLASS_COMMON_H_ | ||
| 52 | |||
| 53 | /* Includes: */ | ||
| 54 | #include "../../Core/StdDescriptors.h" | ||
| 55 | |||
| 56 | /* Enable C linkage for C++ Compilers: */ | ||
| 57 | #if defined(__cplusplus) | ||
| 58 | extern "C" { | ||
| 59 | #endif | ||
| 60 | |||
| 61 | /* Preprocessor Checks: */ | ||
| 62 | #if !defined(__INCLUDE_FROM_PRINTER_DRIVER) | ||
| 63 | #error Do not include this file directly. Include LUFA/Drivers/USB.h instead. | ||
| 64 | #endif | ||
| 65 | |||
| 66 | /* Macros: */ | ||
| 67 | /** \name Virtual Printer Status Line Masks */ | ||
| 68 | //@{ | ||
| 69 | /** Port status mask for a printer device, indicating that an error has *not* occurred. */ | ||
| 70 | #define PRNT_PORTSTATUS_NOTERROR (1 << 3) | ||
| 71 | |||
| 72 | /** Port status mask for a printer device, indicating that the device is currently selected. */ | ||
| 73 | #define PRNT_PORTSTATUS_SELECT (1 << 4) | ||
| 74 | |||
| 75 | /** Port status mask for a printer device, indicating that the device is currently out of paper. */ | ||
| 76 | #define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5) | ||
| 77 | //@} | ||
| 78 | |||
| 79 | /* Enums: */ | ||
| 80 | /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer | ||
| 81 | * device class. | ||
| 82 | */ | ||
| 83 | enum PRNT_Descriptor_ClassSubclassProtocol_t | ||
| 84 | { | ||
| 85 | PRNT_CSCP_PrinterClass = 0x07, /**< Descriptor Class value indicating that the device or interface | ||
| 86 | * belongs to the Printer class. | ||
| 87 | */ | ||
| 88 | PRNT_CSCP_PrinterSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface | ||
| 89 | * belongs to the Printer subclass. | ||
| 90 | */ | ||
| 91 | PRNT_CSCP_BidirectionalProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface | ||
| 92 | * belongs to the Bidirectional protocol of the Printer class. | ||
| 93 | */ | ||
| 94 | }; | ||
| 95 | |||
| 96 | /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */ | ||
| 97 | enum PRNT_ClassRequests_t | ||
| 98 | { | ||
| 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. | ||
| 102 | */ | ||
| 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. | ||
| 105 | */ | ||
| 106 | PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new | ||
| 107 | * printer commands. | ||
| 108 | */ | ||
| 109 | }; | ||
| 110 | |||
| 111 | /* Disable C linkage for C++ Compilers: */ | ||
| 112 | #if defined(__cplusplus) | ||
| 113 | } | ||
| 114 | #endif | ||
| 115 | |||
| 116 | #endif | ||
| 117 | |||
| 118 | /** @} */ | ||
| 119 | |||
