--
You received this message because you are subscribed to the "FPGALink Users" mailgroup (see https://github.com/makestuff/libfpgalink/wiki/FPGALink).
To post to this group, send email to fpgalin...@googlegroups.com
To unsubscribe from this group, send email to
fpgalink-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
typedef enum {
GET_STATUS,
CLEAR_FEATURE,
// 0x02 is reserved
SET_FEATURE=0x03,
// 0x04 is reserved
SET_ADDRESS=0x05, // this is handled by EZ-USB core unless RENUM=0
GET_DESCRIPTOR,
SET_DESCRIPTOR,
GET_CONFIGURATION,
SET_CONFIGURATION,
GET_INTERFACE,
SET_INTERFACE,
SYNC_FRAME,
WCID_VENDOR=0x88
} SETUP_DATA;
extern __code WORD WCIDFeature;
extern __code WORD WCIDstring;
...
case DSCR_STRING_TYPE:
//printf ( "Get String Descriptor idx: %d\n", SETUPDAT[2] );
{
BYTE idx = SETUPDAT[2];
if (idx == 0xEE) {
// special string descriptor for WCID
STRING_DSCR* pStr = (STRING_DSCR*)&WCIDstring;
SUDPTRH = MSB((WORD)pStr);
SUDPTRL = LSB((WORD)pStr);
} else {
STRING_DSCR* pStr = (STRING_DSCR*)&dev_strings;
// pStr points to string 0
BYTE cur=0; // current check
do {
if (idx==cur++) break;
//printf ( "Length of pStr: %d\n", pStr->dsc_len );
//printf ( "pstr: %04x to ", pStr );
pStr = (STRING_DSCR*)((BYTE*)pStr + pStr->dsc_len);
//printf ( "%04x\n" , pStr );
if (pStr->dsc_type != DSCR_STRING_TYPE) pStr=NULL;
} while ( pStr && cur<=idx);
if (pStr) {
/* BYTE i;
//printf ( "found str: '");
for (i=0;i<pStr->dsc_len-2;++i) {
printf ( i%2==0?"%c":"%02x", *((BYTE*)(&pStr->pstr)+i));
} printf ( "\n"); */
SUDPTRH = MSB((WORD)pStr);
SUDPTRL = LSB((WORD)pStr);
//SUDPTRH = MSB((WORD)&dev_strings);
//SUDPTRL = LSB((WORD)&dev_strings);
} else {STALLEP0();}
}
}
break;
...
d:
...
case WCID_VENDOR:
if (SETUPDAT[4] == 0x04 && SETUPDAT[5] == 0x00) {
SUDPTRH = MSB((WORD)&WCIDFeature);
SUDPTRL = LSB((WORD)&WCIDFeature);
} else if (!handle_vendorcommand(SETUPDAT[1])) {
printf ( "Unhandled Vendor Command: %02x\n" , SETUPDAT[1] );
STALLEP0();
}
break;
...
...
string2end:
_WCIDstring:
.db 0x12
.db DSCR_STRING_TYPE
.db 0x4d, 0x00, 0x53, 0x00, 0x46, 0x00, 0x54, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00
.db 0x88
.db 0x00
WCIDstringend:
_WCIDFeature:
.db 0x28, 0x00, 0x00, 0x00
.db 0x00, 0x01
.db 0x04, 0x00
.db 0x01
.db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.db 0x00
.db 0x01
.db 0x57, 0x49, 0x4E, 0x55, 0x53, 0x42, 0x00, 0x00
.db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
WCIDFeatureend:
_dev_strings_end:
.dw 0x0000 ; in case you wanted to look at memory between _dev_strings and _dev_strings_end
--
--