Electronic Components Datasheet Search
  English  ▼

X  

UM0290 Datasheet(PDF) 21 Page - STMicroelectronics

Part # UM0290
Description  This document presents a description
PDF  76 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0290 Datasheet(HTML) 21 Page - STMicroelectronics

Back Button UM0290 Datasheet HTML 17Page - STMicroelectronics UM0290 Datasheet HTML 18Page - STMicroelectronics UM0290 Datasheet HTML 19Page - STMicroelectronics UM0290 Datasheet HTML 20Page - STMicroelectronics UM0290 Datasheet HTML 21Page - STMicroelectronics UM0290 Datasheet HTML 22Page - STMicroelectronics UM0290 Datasheet HTML 23Page - STMicroelectronics UM0290 Datasheet HTML 24Page - STMicroelectronics UM0290 Datasheet HTML 25Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 21 / 76 page
background image
UM0290
STR7/STR9 USB firmware library
21/76
1.4
Implementing a USB application using the STR7/9 USB
library
1.4.1
Implementing a no data class specific request
All class-specific requests without a data transfer phase implement the field
RESULT (*Class_NoData_Setup)(BYTE RequestNo)
of the structure device property.
The USBbRequest of the request is available in the parameter RequestNo and all other
request fields are stored in the device info structure.
The user has to implement the test of all request fields. If the request is compliant with the
class to implement the function must return the USB_SUCCESS result. However if there is
any problem in the request the function returns the status UNSUPPORT result and the
library responds with a STALL handshake.
1.4.2
How to implement a data class specific request
In the event of class requests requiring a data transfer phase, the user implementation
reports to the USB library the length of the data to transfer and the data location in the
internal memory (RAM in case of receiving the data from the host and RAM or Flash in case
of sending data to the host). This type of request is managed in the function
RESULT
(*Class_NoData_Setup)(BYTE
RequestNo)
. The user has to create for
each class data request a specific function with the format:
u8* My_First_Data_Request (u16 Length)
If this function is called with the parameter Length equal to zero, it sets the
pInformation->Ctrl_Info.Usb_wLength
field with the length of data to transfer and
return a NULL pointer. In other cases it returns the address of the data to transfer. The
following C code shows a simple example:
u8* My_First_Data_Request (u16 Length)
{
if (Length == 0)
{
pInformation->Ctrl_Info.Usb_wLength
= My_Data_Length;
return NULL;
}
else
return (&My_Data_Buffer);
}
The function RESULT (*Class_NoData_Setup)(BYTE RequestNo) manages all data
requests as described in the following C code:
RESULT Class_Data_Setup(u8 RequestNo)
{
u8 *(*CopyRoutine)(u16);
CopyRoutine = NULL;
if (My_First_Condition)// test the filds of the first request
CopyRoutine = My_First_Data_Request;
else if(My_Second_Condition) // test the filds of the second request
CopyRoutine = My_Second_Data_Request;
/*
...
same implementation for each class data requests
...
*/
if (CopyRoutine == NULL) return USB_UNSUPPORT;



Html Pages

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


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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