1
10
13
14
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
106
111
112
117
120
121
122
129
130
131
132
...
...
...
#define UX_SOURCE_CODE
#define UX_HCD_STM32_SOURCE_CODE
#include "ux_api.h"
#include "ux_hcd_stm32.h"
#include "ux_host_stack.h"
...
...
UINT _ux_hcd_stm32_request_transfer(UX_HCD_STM32 *hcd_stm32, UX_TRANSFER *transfer_request)
{
UX_ENDPOINT *endpoint;
UINT status;
if (hcd_stm32 -> ux_hcd_stm32_controller_flag & UX_HCD_STM32_CONTROLLER_FLAG_DEVICE_ATTACHED)
{
endpoint = (UX_ENDPOINT *) transfer_request -> ux_transfer_request_endpoint;
transfer_request -> ux_transfer_request_actual_length = 0;
switch ((endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE)
{
case UX_CONTROL_ENDPOINT:
status = _ux_hcd_stm32_request_control_transfer(hcd_stm32, transfer_request);
break;
case UX_CONTROL_ENDPOINT:
case UX_BULK_ENDPOINT:
status = _ux_hcd_stm32_request_bulk_transfer(hcd_stm32, transfer_request);
break;
case UX_BULK_ENDPOINT:
case UX_INTERRUPT_ENDPOINT:
case UX_ISOCHRONOUS_ENDPOINT:
status = _ux_hcd_stm32_request_periodic_transfer(hcd_stm32, transfer_request);
break;
case UX_ISOCHRONOUS_ENDPOINT:
default:
status = UX_ERROR;default
}switch ((endpoint -> ux_endpoint_descriptor.bmAttributes) & UX_MASK_ENDPOINT_TYPE) { ... }
}if (hcd_stm32 -> ux_hcd_stm32_controller_flag & UX_HCD_STM32_CONTROLLER_FLAG_DEVICE_ATTACHED) { ... }
else
{
status = UX_NO_DEVICE_CONNECTED;
}else { ... }
return(status);
}{ ... }