예제 #1
0
파일: usbkbd.c 프로젝트: mtarek/BeRTOS
	0x95, 0x06, // Report Count (6)
	0x75, 0x08, // Report Size (8)
	0x15, 0x00, // Logical Minimum (0)
	0x25, 0x65, // Logical Maximum(101)
	0x05, 0x07, // Usage Page (Key Codes)
	0x19, 0x00, // Usage Minimum (0)
	0x29, 0x65, // Usage Maximum (101)
	0x81, 0x00, // Input (Data, Array)
	0xC0, // End Collection
};

static const usb_HidDesc usb_hid_descriptor =
{
	.bLength = sizeof(usb_hid_descriptor),
	.bDescriptorType = HID_DT_HID,
	.bcdHID = usb_cpu_to_le16((uint16_t)0x0110),
	.bCountryCode = 0,
	.bNumDescriptors = 1,
	.bDescriptorHidType = HID_DT_REPORT,
	.wDescriptorLength =
		usb_cpu_to_le16((uint16_t)sizeof(hid_report_descriptor)),
};

static const UsbEndpointDesc usb_hid_ep_descriptor =
{
	.bLength = sizeof(usb_hid_ep_descriptor),
	.bDescriptorType = USB_DT_ENDPOINT,
	.bEndpointAddress = USB_HID_REPORT_EP,
	.bmAttributes = USB_ENDPOINT_XFER_INT,
	.wMaxPacketSize = usb_cpu_to_le16((uint16_t)4),
	.bInterval = 10, /* resolution in ms */
예제 #2
0
    .bInterfaceNumber = 0,
    .bAlternateSetting = 0,
    .bNumEndpoints = USB_SERIAL_ENDPOINTS,
    .bInterfaceClass = 0xff,
    .bInterfaceSubClass = 0,
    .bInterfaceProtocol = 0,
    .iInterface = 0,
};

static const UsbEndpointDesc usb_serial_ep_report_descriptor =
{
    .bLength = sizeof(usb_serial_ep_report_descriptor),
    .bDescriptorType = USB_DT_ENDPOINT,
    .bEndpointAddress = USB_DIR_IN | USB_SERIAL_EP_REPORT,
    .bmAttributes = USB_ENDPOINT_XFER_INT,
    .wMaxPacketSize = usb_cpu_to_le16((uint16_t)8),
    .bInterval = 1,
};

static const UsbEndpointDesc usb_serial_ep_in_descriptor =
{
    .bLength = sizeof(usb_serial_ep_in_descriptor),
    .bDescriptorType = USB_DT_ENDPOINT,
    .bEndpointAddress = USB_DIR_IN | USB_SERIAL_EP_IN,
    .bmAttributes = USB_ENDPOINT_XFER_BULK,
    .wMaxPacketSize = usb_cpu_to_le16((uint16_t)64),
    .bInterval = 0,
};

static const UsbEndpointDesc usb_serial_ep_out_descriptor =
{