Сб окт 06, 2018 09:38:01
__ALIGN_BEGIN uint8_t device_descriptor[USB_LEN_DEV_DESC] __ALIGN_END =
{
//bLength
0x12,
//bDescriptorType
USB_DESC_TYPE_DEVICE,
//bcdUSB
0x00, 0x02,
//bDeviceClass
0x00,
//bDeviceSubClass
0x00,
//bDeviceProtocol
0x00,
//bMaxPacketSize
USB_MAX_EP0_SIZE,
//idVendor
LOBYTE(USBD_VID), HIBYTE(USBD_VID),
//idProduct
LOBYTE(USBD_PID), HIBYTE(USBD_PID),
//bcdDevice rel. 2.00
0x00, 0x02,
//Index of manufacturer string
USBD_IDX_MFC_STR,
//Index of product string
USBD_IDX_PRODUCT_STR,
//Index of serial number string
USBD_IDX_SERIAL_STR,
//bNumConfigurations
USBD_MAX_NUM_CONFIGURATION
};
//******************************************* Configuration descriptor ********************************************
#define USB_CUSTOM_HID_CONFIG_DESC_SIZE 59
__ALIGN_BEGIN static uint8_t configuration_descriptor[USB_CUSTOM_HID_CONFIG_DESC_SIZE] __ALIGN_END =
{
// bLength: Configuration Descriptor size
0x09,
// bDescriptorType: Configuration
USB_DESC_TYPE_CONFIGURATION,
// wTotalLength: Bytes returned
USB_CUSTOM_HID_CONFIG_DESC_SIZE, 0x00,
//bNumInterfaces: USBD_MAX_NUM_INTERFACES interfaces
USBD_MAX_NUM_INTERFACES,
//bConfigurationValue: Configuration value
0x01,
//iConfiguration: Index of string descriptor describing the configuration
0x00,
//bmAttributes: bus powered //DKOS check need
0xC0,
//MaxPower 100 mA
0x32,
//*********************** Iface 1 *************************
//************** Descriptor of interface ****************
//Offset 0x09(9)
//bLength: Interface Descriptor size
0x09,
//bDescriptorType: Interface descriptor type
USB_DESC_TYPE_INTERFACE,
//bInterfaceNumber: Number of Interface
0x00,
//bAlternateSetting: Alternate setting
0x00,
//bNumEndpoints
0x01,
//bInterfaceClass: HID
0x03,
//bInterfaceSubClass : 1=BOOT, 0=no boot
0x00,
//nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse
0x00,
//iInterface: Index of string descriptor
0,
//******************** Descriptor of hid ********************
//Offset 0x12(18)
//bLength: HID Descriptor size
0x09,
//bDescriptorType: HID
HID_DESCRIPTOR_TYPE,
//bcdHID: HID Class Spec release number //DKOS check need
0x00,
//bCountryCode: Hardware target country
0x01, 0x00,
//bNumDescriptors: Number of HID class descriptors to follow
0x01,
//bDescriptorType
0x22,
//wItemLength: Total length of Report descriptor
GAMEPAD_REPORT_DESC_SIZE, 0x00,
//******************* Descriptor of endpoints ***********
//Offset 0x1b(27)
//bLength: Endpoint Descriptor size
0x07,
//bDescriptorType:
USB_DESC_TYPE_ENDPOINT,
//bEndpointAddress: Endpoint Address (IN)
GAMEPAD1_EP_IN_ADDR,
//bmAttributes: Interrupt endpoint
0x03,
//wMaxPacketSize: 4 Byte max/
GAMEPAD_EPIN_SIZE,
//bInterval: Polling Interval (10 ms)
0x00, 10,
//*********************** Iface 2 *************************
//************** Descriptor of interface ****************
//Offset 0x22(34)
//bLength: Interface Descriptor size
0x09,
//bDescriptorType: Interface descriptor type
USB_DESC_TYPE_INTERFACE,
//bInterfaceNumber: Number of Interface
0x01,
//bAlternateSetting: Alternate setting
0x00,
//bNumEndpoints
0x01,
//bInterfaceClass: HID
0x03,
//bInterfaceSubClass : 1=BOOT, 0=no boot
0x00,
//nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse
0x00,
//iInterface: Index of string descriptor
0,
//******************** Descriptor of hid ********************
//Offset 0x2b(43)
//bLength: HID Descriptor size
0x09,
//bDescriptorType: HID
HID_DESCRIPTOR_TYPE,
//bcdHID: HID Class Spec release number //DKOS check need
0x00,
//bCountryCode: Hardware target country
0x01, 0x00,
//bNumDescriptors: Number of HID class descriptors to follow
0x01,
//bDescriptorType
0x22,
//wItemLength: Total length of Report descriptor
GAMEPAD_REPORT_DESC_SIZE, 0x00,
//******************* Descriptor of endpoints ***********
//Offset 0x34(52)
//bLength: Endpoint Descriptor size
0x07,
//bDescriptorType:
USB_DESC_TYPE_ENDPOINT,
//bEndpointAddress: Endpoint Address (IN)
GAMEPAD2_EP_IN_ADDR,
//bmAttributes: Interrupt endpoint
0x03,
//wMaxPacketSize: 4 Byte max/
GAMEPAD_EPIN_SIZE,
//bInterval: Polling Interval (10 ms)
0x00, 10,
//Offset 0x3b(59)
};
Сб окт 06, 2018 12:23:48
Сб окт 06, 2018 21:43:43
Сб окт 06, 2018 23:01:42
Вс окт 07, 2018 15:59:29
Вс окт 07, 2018 19:01:38
Тогда куб, извиняюсь за выражение - новое гамно.fsmoke писал(а):stdperif и всё, что к ней относится типа старое гамно