Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHi again,
i'm now reading chapter 9 of usb 2 manual to understand what i'm doing... here are the arrays you need to put after a setup ptd to get descriptors --- Quote Start --- unsigned int get_control(unsigned int *rptr,unsigned int addr,char control_type,unsigned int extra,int port) { unsigned int cbuf[128]; unsigned int rbuf[128]; unsigned int cnt=0,lcnt=0; unsigned int toggle_cnt=0; unsigned int word_size; unsigned int DesSize,MaxSize; unsigned int dev_req[4]={0x0680,0x0100 ,0x0000,0x8}; unsigned int cfg_req[4]={0x0680,0x0200 ,0x0000,0x8}; unsigned int str_req[4]={0x0680,0x0300 ,0x0000,0x8}; unsigned int int_req[4]={0x0680,0x0400 ,0x0000,0x8}; unsigned int end_req[4]={0x0680,0x0500 ,0x0000,0x8}; unsigned int hid_req[4]={0x0681,0x2100 ,0x0000,0x8}; --- Quote End --- As you can see, it's a bit confusing cause offsets here are not the same as it's shown in the manual. It's irritating :/ 0x06 = bRequest field => type of request (get_descriptor here) 0x08 = bmRequestType 0x0100 = descriptorType = device etc.. i'm just wondering why you put 0x12 bytes in get device descriptor after setting the address and 0x9 for get config descriptor. arrrgh this thing makes me mad.. Pci express was almost easier for me... or i'm not normal