| 数据搜索系统,热门电子元器件搜索 |
|
UM0463 数据表(PDF) 13 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0463 数据表(HTML) 13 Page - STMicroelectronics |
|
13 / 30 page ![]() UM0463 The USB state machine of the control endpoint 13/30 Note: Letters in the column “State”: D=Default state; A=Address state; C=Configured state; All=All EP states. EP value: D0-D3=endpoint address; D4-D6=reserved as zero; D7= 0: OUT endpoint, 1: IN endpoint. All the nonstandard requests are passed to the user application code by means of a callback function. Every project that uses this library has to implement a callback function to receive nonstandard requests and return with success or with error. Section 3.4 discusses the callback function. 3.4 Nonstandard requests 3.4.1 SETUP stage The library passes all nonstandard requests to the user code with the callback USER_USB_Setup (). The nonstandard requests include the user-interpreted requests and the invalid requests. User-interpreted requests are class specific requests, vendor specific requests or the requests that the library considers as an invalid request but the application wants to interpret them as valid requests (for example, the library does not support the Halt feature on endpoint 0 but the user application may need this feature.) Invalid requests are the requests that are not standard requests and are not user-interpreted requests. Since USER_USB_Setup () is called after the SETUP stage and before the data stage (Section 3.1), the user code is responsible, in the USER_USB_Setup (), to parse the content of the SETUP packet (sUSB_vSetup). If a request is invalid request, the user code has to call RequestError () and return to the caller of USER_USB_Setup (). For a user-interpreted request, the user code prepares the data buffer for the following data stage if the request has a data stage, otherwise the user code executes the request and returns to the caller of USER_USB_Setup (). 3.4.2 Data stage The process of the data stage has three categories: data IN stage with continued data buffer, data IN stage with noncontinued data buffer and data OUT stage. Data IN stage with continued data buffer The user code should perform the operation given in this section if a request needs a data IN stage and all data bytes that are going to be sent to the host are saved in a single and continued data buffer. Examples of requests in this category are: GET_REPORT & GET_DESCRIPTOR request of HID class . In the USER_USB_Setup (), once the request is identified and all the data bytes are ready in the buffer, the user code assigns the buffer pointer to the variable vUSB_DataToCopy and assigns the number of bytes to be sent to the variable vUSB_length. The library will send the data from the buffer without the user code intervention again. Data IN stage with noncontinued data buffer It is easy and convenient to save all data bytes in one single buffer, but in some applications, because of the limitation of the buffer RAM size or that required by the application, all data bytes cannot be saved in one single buffer. For example, if the application wants to send a |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 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 |