1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** USBX Component                                                        */
17 /**                                                                       */
18 /**   Host Data Pump Class                                                */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  COMPONENT DEFINITION                                   RELEASE        */
27 /*                                                                        */
28 /*    ux_host_class_dpump.h                               PORTABLE C      */
29 /*                                                           6.1.10       */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Chaoqiong Xiao, Microsoft Corporation                               */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file contains all the header and extern functions used by the  */
37 /*    USBX demo data pump class.                                          */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  05-19-2020     Chaoqiong Xiao           Initial Version 6.0           */
44 /*  09-30-2020     Chaoqiong Xiao           Modified comment(s),          */
45 /*                                            resulting in version 6.1    */
46 /*  08-02-2021     Wen Wang                 Modified comment(s),          */
47 /*                                            added extern "C" keyword    */
48 /*                                            for compatibility with C++, */
49 /*                                            resulting in version 6.1.8  */
50 /*  01-31-2022     Chaoqiong Xiao           Modified comment(s),          */
51 /*                                            added standalone support,   */
52 /*                                            resulting in version 6.1.10 */
53 /*                                                                        */
54 /**************************************************************************/
55 
56 #ifndef UX_HOST_CLASS_DPUMP_H
57 #define UX_HOST_CLASS_DPUMP_H
58 
59 /* Determine if a C++ compiler is being used.  If so, ensure that standard
60    C is used to process the API information.  */
61 
62 #ifdef   __cplusplus
63 
64 /* Yes, C++ compiler is present.  Use standard C.  */
65 extern   "C" {
66 
67 #endif
68 
69 
70 /* Define Data Pump Class constants.  */
71 
72 #define UX_HOST_CLASS_DPUMP_CLASS_TRANSFER_TIMEOUT            300000
73 #define UX_HOST_CLASS_DPUMP_CLASS                             0x99
74 #define UX_HOST_CLASS_DPUMP_SUBCLASS                          0x99
75 #define UX_HOST_CLASS_DPUMP_PROTOCOL                          0x99
76 
77 /* Define Data Pump Class packet equivalences.  */
78 #define UX_HOST_CLASS_DPUMP_PACKET_SIZE                       128
79 
80 /* Define Data Pump Class Ioctl functions.  */
81 #define UX_HOST_CLASS_DPUMP_SELECT_ALTERNATE_SETTING          1
82 
83 /* Define Data Pump Class string constants.  */
84 
85 #define UX_HOST_CLASS_DPUMP_GENERIC_NAME                      "USB DPUMP"
86 
87 /* Define R/W lock bits for standalone mode.  */
88 
89 #define UX_HOST_CLASS_DPUMP_READ_LOCK                         (1u<<0)
90 #define UX_HOST_CLASS_DPUMP_WRITE_LOCK                        (1u<<1)
91 
92 /* Define Printer Class function prototypes.  */
93 
94 UINT    _ux_host_class_dpump_activate(UX_HOST_CLASS_COMMAND *command);
95 UINT    _ux_host_class_dpump_configure(UX_HOST_CLASS_DPUMP *dpump);
96 UINT    _ux_host_class_dpump_deactivate(UX_HOST_CLASS_COMMAND *command);
97 UINT    _ux_host_class_dpump_endpoints_get(UX_HOST_CLASS_DPUMP *dpump);
98 UINT    _ux_host_class_dpump_entry(UX_HOST_CLASS_COMMAND *command);
99 UINT    _ux_host_class_dpump_read (UX_HOST_CLASS_DPUMP *dpump, UCHAR *data_pointer,
100                                     ULONG requested_length, ULONG *actual_length);
101 UINT    _ux_host_class_dpump_write(UX_HOST_CLASS_DPUMP *dpump, UCHAR * data_pointer,
102                                     ULONG requested_length, ULONG *actual_length);
103 UINT    _ux_host_class_dpump_ioctl(UX_HOST_CLASS_DPUMP *dpump, ULONG ioctl_function,
104                                     VOID *parameter);
105 
106 
107 #define ux_host_class_dpump_entry                               _ux_host_class_dpump_entry
108 #define ux_host_class_dpump_read                                _ux_host_class_dpump_read
109 #define ux_host_class_dpump_write                               _ux_host_class_dpump_write
110 #define ux_host_class_dpump_ioctl                               _ux_host_class_dpump_ioctl
111 
112 /* Determine if a C++ compiler is being used.  If so, complete the standard
113    C conditional started above.  */
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif
119