1 // Originally Generated from MCHCK Toolkit
2 /* Copyright (c) Jacob Alexander 2014 <haata@kiibohd.com>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // ----- Local Includes -----
24 // ----- Generated Includes -----
26 #include <buildvars.h>
30 // ----- Structs -----
32 static const struct usb_config_1 usb_config_1 = {
34 .bLength = sizeof(struct usb_desc_config_t),
35 .bDescriptorType = USB_DESC_CONFIG,
36 .wTotalLength = sizeof(struct usb_config_1),
38 .bConfigurationValue = 1,
45 .bLength = sizeof(struct usb_desc_iface_t),
46 .bDescriptorType = USB_DESC_IFACE,
47 .bInterfaceNumber = 0,
48 .bAlternateSetting = 0,
50 .bInterfaceClass = USB_DEV_CLASS_APP,
51 .bInterfaceSubClass = USB_DEV_SUBCLASS_APP_DFU,
52 .bInterfaceProtocol = USB_DEV_PROTO_DFU_DFU,
57 .bLength = sizeof(struct dfu_desc_functional),
60 .type_type = USB_DESC_TYPE_CLASS
63 .manifestation_tolerant = 0,
67 .wTransferSize = USB_DFU_TRANSFER_SIZE,
68 .bcdDFUVersion = { .maj = 1, .min = 1 }
74 static const struct usbd_config usbd_config_1 = {
75 .init = init_usb_bootloader,
78 .desc = &usb_config_1.config,
79 .function = {&dfu_function},
82 static const struct usb_desc_dev_t dfu_device_dev_desc = {
83 .bLength = sizeof(struct usb_desc_dev_t),
84 .bDescriptorType = USB_DESC_DEV,
85 .bcdUSB = { .maj = 2 },
86 .bDeviceClass = USB_DEV_CLASS_SEE_IFACE,
87 .bDeviceSubClass = USB_DEV_SUBCLASS_SEE_IFACE,
88 .bDeviceProtocol = USB_DEV_PROTO_SEE_IFACE,
89 .bMaxPacketSize0 = EP0_BUFSIZE,
90 .idVendor = VENDOR_ID,
91 .idProduct = PRODUCT_ID,
92 .bcdDevice = { .raw = 0 },
96 .bNumConfigurations = 1,
99 static const struct usb_desc_string_t * const dfu_device_str_desc[] = {
100 USB_DESC_STRING_LANG_ENUS,
101 USB_DESC_STRING(STR_MANUFACTURER),
102 USB_DESC_STRING(STR_PRODUCT),
103 USB_DESC_STRING(STR_SERIAL),
104 USB_DESC_STRING(STR_ALTNAME),
108 const struct usbd_device dfu_device = {
109 .dev_desc = &dfu_device_dev_desc,
110 .string_descs = dfu_device_str_desc,