Hi anybody I declare the folowing stuctures:
typedef struct { ubyte bLength; ubyte bDescriptorType; ubyte bInterfaceNumber; ubyte bAlternateSetting; ubyte bNumEndpoints; ubyte bInterfaceClass; ubyte bInterfaceSubClass; ubyte bInterfaceProtocol; ubyte iInterface; } USB_interface_desc_t; typedef struct { ubyte bLength; ubyte bDescriptorType; uword wTotalLength; ubyte bNumInterfaces; ubyte bConfigurationValue; ubyte iConfiguration; ubyte bmAttributes; ubyte MaxPower; } USB_config_desc_t; typedef struct { ubyte bLength; ubyte bDescriptorType; struct { ubyte address:4; ubyte reserved:3; ubyte direction:1; } bEndpointAddress; ubyte bmAttributes; uword wMaxPacketSize; ubyte bInterval; } USB_endpoint_desc_t; typedef struct { USB_config_desc_t usb_dev_config_desc; USB_interface_desc_t usb_interface_0_alt_0_desc; USB_endpoint_desc_t usb_dev_endpoint_alt_0_desc[2]; } USB_long_config_desc_t;
" I am trying to establish communication with PC (Windows 98)" Welcome to the world of cross-platform interworking! If you're going to try to use 'C' structures to map language types onto the communications frame/packet format, you are going to have to study the manuals for both platforms very carefully - playing particular attention to data sizes, endianness, packing, alignments, and all the other implementation-specific details. Don't forget that Win98 runs on 32-bit Intel x86 architecture, and there is no guarantee that the data representation will match Keil's implementation on the 16-bit(?) C16x/ST10 - in fact, it's more likely that they won't match! :-(
Rather than try to force your system(s) to work with mis-aligned data - which could well be grossly inefficient - it might be better to have your driver(s) parse the communication packets into sutiable target-friendly structures?