Select one of the symbols to view example projects that use it.
 
Outline
...
...
...
...
...
...
#define UX_PORT_H
#include "ux_user.h"
#include <stdio.h>
#include <string.h>
#include "tx_api.h"
#include <stdint.h>
#define ALIGN_TYPE
SLONG
#define UX_PERIODIC_RATE
#define UX_MAX_CLASS_DRIVER
#define UX_MAX_SLAVE_CLASS_DRIVER
#define UX_MAX_HCD
#define UX_MAX_DEVICES
#define UX_MAX_ED
#define UX_MAX_TD
#define UX_MAX_ISO_TD
#define UX_HOST_ENUM_THREAD_STACK_SIZE
#define UX_THREAD_STACK_SIZE
#define UX_THREAD_PRIORITY_ENUM
#define UX_THREAD_PRIORITY_CLASS
#define UX_THREAD_PRIORITY_KEYBOARD
#define UX_THREAD_PRIORITY_HCD
#define UX_THREAD_PRIORITY_DCD
#define UX_NO_TIME_SLICE
#define UX_MAX_SLAVE_LUN
#define UX_MAX_HOST_LUN
#define UX_HOST_CLASS_STORAGE_MAX_MEDIA
#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH
#define inpb
#define inpw
#define inpl
#define outpb
#define outpw
#define outpl
#define UX_BSP_SPECIFIC_DELAY_FUNCTION
#define UX_INT_SAVE_AREA
#define UX_DISABLE_INTS
#define UX_RESTORE_INTS
_ux_version_id
Files
loading...
CodeScopeSTM32 Libraries and Samplesusbxports/generic/inc/ux_port.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**************************************************************************/ /* */ /* Copyright (c) Microsoft Corporation. All rights reserved. */ /* */ /* This software is licensed under the Microsoft Software License */ /* Terms for Microsoft Azure RTOS. Full text of the license can be */ /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ /* and in the root directory of this software. */ /* */... /**************************************************************************/ ... /**************************************************************************/ /**************************************************************************/ /** */ /** USBX Component */ /** */ /** Port Specific */ /** */... /**************************************************************************/ /**************************************************************************/ ... /**************************************************************************/ /* */ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Generic */ /* 6.1.10 */ /* */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This file contains data type definitions that make USBX function */ /* identically on a variety of different processor architectures. */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 12-31-2020 Chaoqiong Xiao Initial Version 6.1.3 */ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ /* */... /**************************************************************************/ #ifndef UX_PORT_H #define UX_PORT_H /* Determine if the optional USBX user define file should be used. */ #ifdef UX_INCLUDE_USER_DEFINE_FILE /* Yes, include the user defines in ux_user.h. The defines in this file may alternately be defined on the command line. *//* ... */ #include "ux_user.h" /* ... */#endif /* Include library header files. */ #include <stdio.h> #include <string.h> #if !defined(UX_STANDALONE) #include "tx_api.h" #else /* VAR types used in UX, if TX still used, expects tx_api.h included before include this. *//* ... */ #if !defined(TX_API_H) && !defined(TX_PORT_H) #include <stdint.h> typedef void VOID; typedef char CHAR; typedef unsigned char UCHAR; typedef int INT; typedef unsigned int UINT; typedef long LONG; typedef unsigned long ULONG; typedef short SHORT; typedef unsigned short USHORT; typedef uint64_t ULONG64; #ifndef ALIGN_TYPE_DEFINED #define ALIGN_TYPE ULONG #endif /* ... */ #endif/* ... */ #endif /* CPU definition for X86 systems without preemptive timer function. This will make USBX uses the controller for the timer. *//* ... */ #undef THREADX_X86_NO_PTIMER /* For X86 systems, the define #define UX_USE_IO_INSTRUCTIONS should be used. */ /* Define additional generic USBX types. */ typedef long SLONG; /* Generic USBX Project constants follow. */ #ifndef UX_PERIODIC_RATE #define UX_PERIODIC_RATE 100 #endif #ifndef UX_MAX_CLASS_DRIVER #define UX_MAX_CLASS_DRIVER 2 #endif #ifndef UX_MAX_SLAVE_CLASS_DRIVER #define UX_MAX_SLAVE_CLASS_DRIVER 2 #endif #ifndef UX_MAX_HCD #define UX_MAX_HCD 1 #endif #ifndef UX_MAX_DEVICES #define UX_MAX_DEVICES 2 #endif #ifndef UX_MAX_ED #define UX_MAX_ED 80 #endif #ifndef UX_MAX_TD #define UX_MAX_TD 32 #endif #ifndef UX_MAX_ISO_TD #define UX_MAX_ISO_TD 2 #endif #ifndef UX_HOST_ENUM_THREAD_STACK_SIZE #define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024) #endif #ifndef UX_THREAD_STACK_SIZE #define UX_THREAD_STACK_SIZE (1*1024) #endif #ifndef UX_THREAD_PRIORITY_ENUM #define UX_THREAD_PRIORITY_ENUM 20 #endif #ifndef UX_THREAD_PRIORITY_CLASS #define UX_THREAD_PRIORITY_CLASS 20 #endif #ifndef UX_THREAD_PRIORITY_KEYBOARD #define UX_THREAD_PRIORITY_KEYBOARD 20 #endif #ifndef UX_THREAD_PRIORITY_HCD #define UX_THREAD_PRIORITY_HCD 2 #endif #ifndef UX_THREAD_PRIORITY_DCD #define UX_THREAD_PRIORITY_DCD 2 #endif #ifndef UX_NO_TIME_SLICE #define UX_NO_TIME_SLICE 0 #endif #ifndef UX_MAX_SLAVE_LUN #define UX_MAX_SLAVE_LUN 1 #endif #ifndef UX_MAX_HOST_LUN #define UX_MAX_HOST_LUN 1 #endif #ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA #define UX_HOST_CLASS_STORAGE_MAX_MEDIA 1 #endif #ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH #define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256 #endif #ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH #define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 2048 #endif #ifndef UX_USE_IO_INSTRUCTIONS /* Don't use IO instructions if this define is not set. Default to memory mapped. */ #define inpb(a) *((UCHAR *) (a)) #define inpw(a) *((USHORT *) (a)) #define inpl(a) *((ULONG *) (a)) #define outpb(a, b) *((UCHAR *) (a)) = ((UCHAR) (b)) #define outpw(a, b) *((USHORT *) (a)) = ((USHORT) (b)) #define outpl(a, b) *((ULONG *) (a)) = ((ULONG) (b)) 6 defines#else/* ... */ /* Define simple prototypes for non-memory mapped hardware access. */ UCHAR inpb(ULONG); USHORT inpw(ULONG); ULONG inpl(ULONG); VOID outpb(ULONG,UCHAR); VOID outpw(ULONG,USHORT); VOID outpl(ULONG,ULONG); /* ... */ #endif /* Define local delay function for board specific bsps. */ #ifdef TI_AM335 #define UX_BSP_SPECIFIC_DELAY_FUNCTION #endif /* Define interrupt lockout constructs to protect the memory allocation/release which could happen under ISR in the device stack. *//* ... */ #define UX_INT_SAVE_AREA unsigned int old_interrupt_posture; #define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE); #define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture); /* Define the version ID of USBX. This may be utilized by the application. */ #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Generic Version 6.1.10 *";/* ... */ #else extern CHAR _ux_version_id[]; #endif /* ... */ #endif...