реклама на сайте
подробности

 
 
> Комозитное устройство - не работает. Помогите.
Kitsok
сообщение Feb 3 2007, 21:41
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 211
Регистрация: 9-11-06
Пользователь №: 22 136



Привет всем!

Пытаюсь сделать композитное устройство на SAM7, два джойстика.

Дескрипторы устройства и конфигурации(+интерфейсов +конечных точек +HID) выглядят следующим образом (согласно http://msdn2.microsoft.com/en-us/library/aa476434.aspx):

Код
const S_usb_device_descriptor pxDeviceDescriptor = {
         sizeof(S_usb_device_descriptor),                   // Size of this descriptor
         USB_DEVICE_DESCRIPTOR,                             // DEVICE descriptor type
         USB2_00,                                           // USB 2.0 specification
//         USB_CLASS_VENDOR_SPECIFIC,                         // Class is specified in the interface descriptor.
         0xef,                                  // Class is specified in the interface descriptor.
         0x02,                                              // No device subclass code
         0x01,                                              // No device protocol code
         0x08,                                              // Maximum packet size for endpoint 0
         0xffff,                                            // Vendor ID
         0x200C,                                            // Product ID = 0x0001
         0x0003,                                            // Device release number 0.01
         usbMANUFACTURER_STRING,                            // Index of manufacturer description
         usbPRODUCT_STRING,                                 // Index of product description
         0x00,                                              // Index of serial number description
         0x01                                               // One possible configuration
};  

const char pxConfigDescriptorNew[] = {

      /* Configuration 1 descriptor */
        sizeof(S_usb_configuration_descriptor),             // Size of this descriptor
        USB_CONFIGURATION_DESCRIPTOR,                       // CONFIGURATION descriptor type
        //0x29,0x00,                                          // Total length of data
        0x42,0x00,                                          // Total length of data
        0x02,                                               // Two interfaces are used by this configuration
        0x01,                                               // Value 0x01 is used to select this configuration
        usbCONFIGURATION_STRING,                            // No string is used to describe this configuration
        USB_CONFIG_BUS_NOWAKEUP,                            // Device is bus-powered, no remote wakeup
        USB_POWER_MA(100),                                  // maximum power consumption (0x32 = 50 = 100mA)

    /* Interface Descriptor Requirement */
        sizeof(S_usb_interface_descriptor),                 // Size of this descriptor
        USB_INTERFACE_DESCRIPTOR,                           // INTERFACE Descriptor Type
        0x00,                                               // Interface 0
        0x00,                                               // No alternate settings
        0x02,                                               // 2 endpoints used
        USB_CLASS_HID,                                      // HID class code
        HID_NO_SUBCLASS,                                    // The Boot protocol is not supported
        HID_PROTOCOL_CODE_NONE,                             // No protocol
        usbINTERFACE_STRING,                                // No associated string descriptor

    /* HID Descriptor */
        sizeof(S_hid_descriptor),                           // Size of this descriptor in bytes (9)
        HID_DESCRIPTOR,                                     // HID descriptor type
        HID_1_11,                                           // HID Class Specification 1.11
        0x00,                                               // No country code
        0x01,                                               // 1 HID class descriptor
        HID_REPORT_DESCRIPTOR,                              // First HID-specific descriptor type
        sizeof(pxReportDescriptor),0x00,                    // Total length of first descriptor

        /* Endpoint 1 descriptor */
        sizeof(S_usb_endpoint_descriptor),                  // Size of this descriptor
        USB_ENDPOINT_DESCRIPTOR,                            // ENDPOINT descriptor type
        0x01 | USB_ENDPOINT_IN,                             // Endpoint number, direction IN
        ENDPOINT_TYPE_INTERRUPT,                            // Endpoint type interrupt
        0x40,0x00,                                          // Endpoint maximum packet size (reverse order)
        0x0A,                                               // Interval for polling: 10ms

        /* Endpoint 2 descriptor */
        sizeof(S_usb_endpoint_descriptor),                  // Size of this descriptor
        USB_ENDPOINT_DESCRIPTOR,                            // ENDPOINT descriptor type
        0x02 | USB_ENDPOINT_OUT,                            // Endpoint number, direction IN
        ENDPOINT_TYPE_INTERRUPT,                            // Endpoint type interrupt
        0x40,0x00,                                          // Endpoint maximum packet size (reverse order)
        0xC8,                                               // Interval for polling: 100ms
        //0x0A                                               // Interval for polling: 100ms
        
        
        //0x29
        /* Interface Descriptor Requirement */
        sizeof(S_usb_interface_descriptor),                 // Size of this descriptor
        USB_INTERFACE_DESCRIPTOR,                           // INTERFACE Descriptor Type
        0x01,                                               // Interface 1
        0x00,                                               // No alternate settings
        0x01,                                               // 1 endpoints used
        USB_CLASS_HID,                                      // HID class code
        HID_NO_SUBCLASS,                                    // The Boot protocol is not supported
        HID_PROTOCOL_CODE_NONE,                             // No protocol
        //usbINTERFACE_STRING,                                // No associated string descriptor
        0x00,                                // No associated string descriptor

    /* HID Descriptor */
        sizeof(S_hid_descriptor),                           // Size of this descriptor in bytes (9)
        HID_DESCRIPTOR,                                     // HID descriptor type
        HID_1_11,                                           // HID Class Specification 1.11
        0x00,                                               // No country code
        0x01,                                               // 1 HID class descriptor
        HID_REPORT_DESCRIPTOR,                              // First HID-specific descriptor type
        sizeof(pxReportDescriptor),0x00,                    // Total length of first descriptor

        /* Endpoint 3 descriptor */
        sizeof(S_usb_endpoint_descriptor),                  // Size of this descriptor
        USB_ENDPOINT_DESCRIPTOR,                            // ENDPOINT descriptor type
        0x03 | USB_ENDPOINT_IN,                             // Endpoint number, direction IN
        ENDPOINT_TYPE_INTERRUPT,                            // Endpoint type interrupt
        0x08,0x00,                                          // Endpoint maximum packet size (reverse order)
        0x0A,                                               // Interval for polling: 10ms

};


Однако энумерация не проходит.

После получения конфиг-дескриптора винда (2000) отключает девайс.

Подскажите, пожалуйста, где что не так.

Заранее спасибо!
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 18th July 2025 - 11:11
Рейтинг@Mail.ru


Страница сгенерированна за 0.01383 секунд с 7
ELECTRONIX ©2004-2016