| поискавой системы для электроныых деталей |
|
UM0463 датащи(PDF) 17 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0463 датащи(HTML) 17 Page - STMicroelectronics |
|
17 / 30 page ![]() UM0463 The USB state machine of the control endpoint 17/30 Nonconstant descriptors Some descriptors may not be constant and they can be generated by the user code or can be read from outside of the MCU (such as an E2PROM.) For these descriptors, the corresponding pointer variable defined in the above section should be set as value zero. If a pointer is NULL, the library passes the request to the user code through the callback function USER_USB_Setup(). In USER_USB_Setup(), the user code has to identify the request by checking the parameters in sUSB_vSetup and performs the actions described in Data IN stage with noncontinued data buffer. Standard request with constant descriptors For the request of device descriptor, the library replies with the data referred by the DeviceDescriptor. For the requests of the configuration descriptor, the library checks the index of configuration descriptor and then replies with the data from the corresponding index in the ConfigDescriptor[] array. For the requests of configuration descriptors, the library checks the configuration index that is smaller than Num_Configuration given by the user code. Then the library replies with the data referred by the array of ConfigDescriptor[] accordingly. For the requests of string descriptors, the library checks that the language ID is 0x0409 (US English) and that the string index is smaller than NUM_APP_STR_DESC given by the user code. Then the library replies with the data referred by the array of Appli_Desc_Tab[ ] accordingly. For the requests that are not one of the above discussed, the library calls callback function USER_USB_Setup() to pass the request to the user code. This gives the user code an opportunity to answer, for example, the HID descriptor of an HID device. 3.5.6 Set configuration and get configuration A variable, vUSB_Configuration, is defined in the library to keep track of the current configuration value. The content of this variable is returned to answer the Get Configuration request. In the process of Set Configuration request, the library checks the configuration value versus the user variable Num_Configuration to ensure a valid configuration value is set. Then the library calls a callback function USER_Set_Configuration() to let the user code configure the device. In the USER_Set_Configuration(), the user code has to check the value of vUSB_Configuration and configure the device to the specified configuration correspondingly. The user code returns REQ_ERROR if the configuration value is invalid or the device cannot be configured correctly, otherwise the user code returns a value of REQ_SUCCESS. Note: When the device is unconfigured (vUSB_Configuration is zero), the user code has to set the status register of all non-0 endpoints to DISABLE state. In any configured state, the user code has to keep the status register of all unused endpoints in DISABLE state. This requirement ensures that the Set Feature and the Clear Feature requests respond correctly. 3.5.7 Set interface and get interface The library checks the parameters of the request and calls one of the two callback functions USER_USB_Set_Interface() or USER_USB_Get_Interface(). |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |