2 * @brief Common definitions and declarations for the library USB Printer Class driver
\r
5 * Copyright(C) NXP Semiconductors, 2012
\r
6 * Copyright(C) Dean Camera, 2011, 2012
\r
7 * All rights reserved.
\r
10 * Software that is described herein is for illustrative purposes only
\r
11 * which provides customers with programming information regarding the
\r
12 * LPC products. This software is supplied "AS IS" without any warranties of
\r
13 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
14 * all warranties, express or implied, including all implied warranties of
\r
15 * merchantability, fitness for a particular purpose and non-infringement of
\r
16 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
17 * or liability for the use of the software, conveys no license or rights under any
\r
18 * patent, copyright, mask work right, or any other intellectual property rights in
\r
19 * or to any products. NXP Semiconductors reserves the right to make changes
\r
20 * in the software without notification. NXP Semiconductors also makes no
\r
21 * representation or warranty that such application will be suitable for the
\r
22 * specified use without further testing or modification.
\r
25 * Permission to use, copy, modify, and distribute this software and its
\r
26 * documentation is hereby granted, under NXP Semiconductors' and its
\r
27 * licensor's relevant copyrights in the software, without fee, provided that it
\r
28 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
29 * copyright, permission, and disclaimer notice must appear in all copies of
\r
33 /** @ingroup Group_USBClassPrinter
\r
34 * @defgroup Group_USBClassPrinterCommon Common Class Definitions
\r
36 * @section Sec_ModDescription Module Description
\r
37 * Constants, Types and Enum definitions that are common to both Device and Host modes for the USB
\r
43 #ifndef _PRINTER_CLASS_COMMON_H_
\r
44 #define _PRINTER_CLASS_COMMON_H_
\r
47 #include "../../Core/StdDescriptors.h"
\r
49 /* Enable C linkage for C++ Compilers: */
\r
50 #if defined(__cplusplus)
\r
54 /* Preprocessor Checks: */
\r
55 #if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
\r
56 #error Do not include this file directly. Include LPCUSBlib/Drivers/USB.h instead.
\r
60 /** @name Virtual Printer Status Line Masks */
\r
62 /** Port status mask for a printer device, indicating that an error has *not* occurred. */
\r
63 #define PRNT_PORTSTATUS_NOTERROR (1 << 3)
\r
65 /** Port status mask for a printer device, indicating that the device is currently selected. */
\r
66 #define PRNT_PORTSTATUS_SELECT (1 << 4)
\r
68 /** Port status mask for a printer device, indicating that the device is currently out of paper. */
\r
69 #define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5)
\r
73 /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer
\r
76 enum PRNT_Descriptor_ClassSubclassProtocol_t
\r
78 PRNT_CSCP_PrinterClass = 0x07, /**< Descriptor Class value indicating that the device or interface
\r
79 * belongs to the Printer class.
\r
81 PRNT_CSCP_PrinterSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface
\r
82 * belongs to the Printer subclass.
\r
84 PRNT_CSCP_BidirectionalProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface
\r
85 * belongs to the Bidirectional protocol of the Printer class.
\r
89 /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */
\r
90 enum PRNT_ClassRequests_t
\r
92 PRNT_REQ_GetDeviceID = 0x00, /**< Printer class-specific request to retrieve the Unicode ID
\r
93 * string of the device, containing the device's name, manufacturer
\r
94 * and supported printer languages.
\r
96 PRNT_REQ_GetPortStatus = 0x01, /**< Printer class-specific request to get the current status of the
\r
97 * virtual printer port, for device selection and ready states.
\r
99 PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new
\r
100 * printer commands.
\r
104 /* Disable C linkage for C++ Compilers: */
\r
105 #if defined(__cplusplus)
\r