Ejemplo n.º 1
0
	.bDeviceClass = USB_DEV_CLASS_SEE_IFACE,
	.bDeviceSubClass = USB_DEV_SUBCLASS_SEE_IFACE,
	.bDeviceProtocol = USB_DEV_PROTO_SEE_IFACE,
	.bMaxPacketSize0 = EP0_BUFSIZE,
	.idVendor = VENDOR_ID,
	.idProduct = PRODUCT_ID,
	.bcdDevice = { .maj = MSB( BCD_VERSION ), .min = LSB( BCD_VERSION ) },
	.iManufacturer = 1,
	.iProduct = 2,
	.iSerialNumber = 3,
	.bNumConfigurations = 1,
};

struct usb_desc_string_t * const dfu_device_str_desc[] = {
	USB_DESC_STRING_LANG_ENUS,
	USB_DESC_STRING(STR_MANUFACTURER),
	USB_DESC_STRING(STR_PRODUCT),
	USB_DESC_STRING(STR_SERIAL),
	USB_DESC_STRING(STR_ALTNAME),
	USB_DESC_STRING(STR_CONFIG_NAME),
	NULL
};

const struct usbd_device dfu_device = {
	.dev_desc = &dfu_device_dev_desc,
	.string_descs = dfu_device_str_desc,
	.configs = {
		&usbd_config_1,
		NULL
	}
};
Ejemplo n.º 2
0
    .bDeviceClass = USB_DEV_CLASS_SEE_IFACE,
    .bDeviceSubClass = USB_DEV_SUBCLASS_SEE_IFACE,
    .bDeviceProtocol = USB_DEV_PROTO_SEE_IFACE,
    .bMaxPacketSize0 = EP0_BUFSIZE,
    .idVendor = 0x2323,
    .idProduct = 4,
    .bcdDevice = { .raw = 0 },
    .iManufacturer = 1,
    .iProduct = 2,
    .iSerialNumber = 3,
    .bNumConfigurations = 1,
};

const struct usb_desc_string_t * const cdc_string_descs[] = {
    USB_DESC_STRING_LANG_ENUS,
    USB_DESC_STRING(u"mchck.org"),
    USB_DESC_STRING(u"MC HCK SWD adapter"),
    USB_DESC_STRING_SERIALNO,
    NULL
};

const struct {
    struct usb_desc_config_t config;
    USB_FUNCTION_DESC_CDC_DECL cdc;
} cdc_desc_config = {
    .config = {
        .bLength = sizeof(struct usb_desc_config_t),
        .bDescriptorType = USB_DESC_CONFIG,
        .wTotalLength = sizeof(cdc_desc_config),
        .bNumInterfaces = (0 + USB_FUNCTION_CDC_IFACE_COUNT),
        .bConfigurationValue = 1,
Ejemplo n.º 3
0
Archivo: desc.c Proyecto: dwhacks/mchck
        .bDeviceClass = USB_DEV_CLASS_SEE_IFACE,
        .bDeviceSubClass = USB_DEV_SUBCLASS_SEE_IFACE,
        .bDeviceProtocol = USB_DEV_PROTO_SEE_IFACE,
        .bMaxPacketSize0 = EP0_BUFSIZE,
        .idVendor = 0x2323,
        .idProduct = 1,
        .bcdDevice = { .raw = 0 },
        .iManufacturer = 1,
        .iProduct = 2,
        .iSerialNumber = 0,
        .bNumConfigurations = 1,
};

const struct usb_desc_string_t * const dfu_string_descs[] = {
        USB_DESC_STRING_LANG_ENUS,
        USB_DESC_STRING(u"mchck.org"),
        USB_DESC_STRING(u"MC HCK bootloader"),
        NULL
};

const struct {
        struct usb_desc_config_t config;
        USB_FUNCTION_DESC_DFU_DECL dfu;
} dfu_desc_config = {
        .config = {
                .bLength = sizeof(struct usb_desc_config_t),
                .bDescriptorType = USB_DESC_CONFIG,
                .wTotalLength = sizeof(dfu_desc_config),
                .bNumInterfaces = (0 + USB_FUNCTION_DFU_IFACE_COUNT),
                .bConfigurationValue = 1,
                .iConfiguration = 0,