Select one of the symbols to view example projects that use it.
 
Outline
...
...
...
...
#define UX_SOURCE_CODE
#define UX_HCD_STM32_SOURCE_CODE
#include "ux_api.h"
#include "ux_hcd_stm32.h"
#include "ux_host_stack.h"
...
...
_ux_hcd_stm32_periodic_schedule(UX_HCD_STM32 *)
Files
loading...
CodeScopeSTM32 Libraries and Samplesusbxcommon/usbx_stm32_host_controllers/ux_hcd_stm32_periodic_schedule.c
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**************************************************************************/ /* */ /* 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 */ /** */ /** STM32 Controller Driver */ /** */... /**************************************************************************/ /**************************************************************************/ /* Include necessary system files. */ #define UX_SOURCE_CODE #define UX_HCD_STM32_SOURCE_CODE #include "ux_api.h" #include "ux_hcd_stm32.h" #include "ux_host_stack.h" ... /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_stm32_periodic_schedule PORTABLE C */ /* 6.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function schedules new transfers from the periodic interrupt */ /* list. */ /* */ /* INPUT */ /* */ /* hcd_stm32 Pointer to STM32 controller */ /* */ /* OUTPUT */ /* */ /* TRUE or FALSE */ /* */ /* CALLS */ /* */ /* HAL_HCD_GetCurrentFrame Get frame number */ /* */ /* CALLED BY */ /* */ /* STM32 Controller Driver */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* */... /**************************************************************************/ UINT _ux_hcd_stm32_periodic_schedule(UX_HCD_STM32 *hcd_stm32) { UX_HCD_STM32_ED *ed; ULONG frame_number; ULONG ep_bmAttributes; UX_TRANSFER *transfer_request; /* Get the current frame number. */ frame_number = HAL_HCD_GetCurrentFrame(hcd_stm32 -> hcd_handle); /* Get the first ED in the periodic list. */ ed = hcd_stm32 -> ux_hcd_stm32_periodic_ed_head; /* Search for an entry in the periodic tree. */ while (ed != UX_NULL) { /* Check if the periodic transfer should be scheduled in this frame. */ if ((frame_number & ed -> ux_stm32_ed_interval_mask) == ed -> ux_stm32_ed_interval_position) { /* Get the transfer request. */ transfer_request = ed -> ux_stm32_ed_transfer_request; /* Check if there is transfer pending. */ if (transfer_request) { /* Get Endpoint bmAttributes */ ep_bmAttributes = ed -> ux_stm32_ed_endpoint -> ux_endpoint_descriptor.bmAttributes; /* Call HAL driver to submit the transfer request. */ HAL_HCD_HC_SubmitRequest(hcd_stm32 -> hcd_handle, ed -> ux_stm32_ed_channel, (transfer_request -> ux_transfer_request_type & UX_REQUEST_DIRECTION) == UX_REQUEST_IN ? 1 : 0, (ep_bmAttributes & UX_MASK_ENDPOINT_TYPE) == UX_INTERRUPT_ENDPOINT ? EP_TYPE_INTR : EP_TYPE_ISOC, USBH_PID_DATA, transfer_request -> ux_transfer_request_data_pointer, transfer_request -> ux_transfer_request_requested_length, 0); }if (transfer_request) { ... } }if ((frame_number & ed -> ux_stm32_ed_interval_mask) == ed -> ux_stm32_ed_interval_position) { ... } /* Point to the next ED in the list. */ ed = ed -> ux_stm32_ed_next_ed; }while (ed != UX_NULL) { ... } /* Return to caller. */ return(UX_FALSE); }{ ... }