]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/LPCOpen/LPCUSBLib/Drivers/USB/Class/Common/PrinterClassCommon.h
Update LPC18xx FreeRTOS+UDP demo to use LPCOpen USB and Ethernet drivers.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / LPCOpen / LPCUSBLib / Drivers / USB / Class / Common / PrinterClassCommon.h
1 /*\r
2  * @brief Common definitions and declarations for the library USB Printer Class driver\r
3  *\r
4  * @note\r
5  * Copyright(C) NXP Semiconductors, 2012\r
6  * Copyright(C) Dean Camera, 2011, 2012\r
7  * All rights reserved.\r
8  *\r
9  * @par\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
23  *\r
24  * @par\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
30  * this code.\r
31  */\r
32 \r
33 /** @ingroup Group_USBClassPrinter\r
34  *  @defgroup Group_USBClassPrinterCommon  Common Class Definitions\r
35  *\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
38  *  Printer Class.\r
39  *\r
40  *  @{\r
41  */\r
42 \r
43 #ifndef _PRINTER_CLASS_COMMON_H_\r
44 #define _PRINTER_CLASS_COMMON_H_\r
45 \r
46         /* Includes: */\r
47                 #include "../../Core/StdDescriptors.h"\r
48 \r
49         /* Enable C linkage for C++ Compilers: */\r
50                 #if defined(__cplusplus)\r
51                         extern "C" {\r
52                 #endif\r
53 \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
57                 #endif\r
58 \r
59         /* Macros: */\r
60                 /** @name Virtual Printer Status Line Masks */\r
61                 //@{\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
64 \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
67 \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
70                 //@}\r
71 \r
72         /* Enums: */\r
73                 /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer\r
74                  *  device class.\r
75                  */\r
76                 enum PRNT_Descriptor_ClassSubclassProtocol_t\r
77                 {\r
78                         PRNT_CSCP_PrinterClass          = 0x07, /**< Descriptor Class value indicating that the device or interface\r
79                                                                  *   belongs to the Printer class.\r
80                                                                  */\r
81                         PRNT_CSCP_PrinterSubclass       = 0x01, /**< Descriptor Subclass value indicating that the device or interface\r
82                                                                  *   belongs to the Printer subclass.\r
83                                                                  */\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
86                                                                  */\r
87                 };\r
88         \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
91                 {\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
95                                                                  */\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
98                                                                  */\r
99                         PRNT_REQ_SoftReset              = 0x02, /**< Printer class-specific request to reset the device, ready for new\r
100                                                                  *   printer commands.\r
101                                                                  */\r
102                 };              \r
103 \r
104         /* Disable C linkage for C++ Compilers: */\r
105                 #if defined(__cplusplus)\r
106                         }\r
107                 #endif\r
108 \r
109 #endif\r
110 \r
111 /** @} */\r
112 \r