| Electronic Components Datasheet Search |
|
UM0463 Datasheet(PDF) 18 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0463 Datasheet(HTML) 18 Page - STMicroelectronics |
|
18 / 30 page ![]() The USB state machine of the control endpoint UM0463 18/30 For the Set Interface request, the user code in the USER_USB_Set_Interface() should take the variable sUSB_vSetup.USBwIndex0 as the interface index and the variable sUSB_vSetup.USBwValue0 as the alternative setting value. The user code validates these two variables and configures the specified interface accordingly. The function USER_USB_Set_Interface() returns REQ_ERROR if there is any error, otherwise returns REQ_SUCCESS. For the Get Interface request, the user code in the function USER_USB_Get_Interface() should take the variable sUSB_vSetup.USBwIndex0 as the interface index and returns the alternative setting value of the specified interface if there is no error. The user code calls RequestError() if there is any error. 3.5.8 Status stage of the standard requests As specified in Section 3.4.3, the callback functions USER_USB_Status_In() and USER_USB_Status_Out() will be called respectively at the end of all the standard requests except Set Address request. In these two callback functions, the user code is able to know what request is processed in the library. 3.6 The execution of the state machine The state machine is in the state Wait_Setup when it is in idle. Once a SETUP packet is received, the request is copied to the sUSB_vSetup structure and the field sUSB_vSetup.flag is evaluated. Then the state machine is started. Figure 2 illustrates the execution of the state machine. The state machine returns to the idle state (Wait_Setup) after USER_USB_Status_In() or USER_USB_Status_Out() returns.As stated in Section 2.1, the state machine of the control endpoint has two execution models: the polling model and the interrupt model. Since all callback functions specified in this chapter are part of the state machine, they can be part of the interrupt process routine if the state machine is working in the interrupt model. The application developers have to be aware that there are some limitations concerning writing code of the interrupt routines. This topic is not the scope of this document; please refer to other documents for this issue. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |