1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/* USB Interface descriptor in Runtime mode */
struct usb_interface_descriptor desc_if_rt = {
.bLength = USB_DT_INTERFACE_SIZE,
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0x01,
.bAlternateSetting = 0x00,
.bNumEndpoints = 0x00,
.bInterfaceClass = 0xfe,
.bInterfaceSubClass = 0x01,
.bInterfaceProtocol = 0x01,
.iInterface = FIXME,
};
/* USB DFU Device descriptor in DFU mode */
struct usb_device_descriptor desc_dev_dfu = {
.bLength = USB_DT_DEVICE_SIZE,
.bDescriptorType = USB_DT_DEVICE,
.bcdUSB = 0x0100,
.bDeviceClass = 0x00,
.bDeviceSubClass = 0x00,
.bDeviceProtocol = 0x00,
.bMaxPacketSize0 = 8,
.idVendor = USB_VENDOR,
.idProtuct = USB_PRODUCT,
.bcdDevice = 0x0000,
.iManufacturer = FIXME,
.iProduct = FIXME,
.iSerialNumber = FIXME,
.bNumConfigurations = 0x01,
};
/* USB DFU Interface descriptor in DFU mode */
struct usb_interface_descriptor desc_if_dfu = {
.bLength = USB_DT_INTERFACE_SIZE,
.bDescriptorType = USB_DT_INTERFACE,
.bInterfaceNumber = 0x00,
.bAlternateSetting = 0x00,
.bNumEndpoints = 0x00,
.bInterfaceClass = 0xfe,
.bInterfaceSubClass = 0x01,
.bInterfaceProtocol = 0x02,
.iInterface = FIXME,
};
{
switch () {
case USB_REQ_DFU_DETACH:
break;
case USB_REQ_DFU_DNLOAD:
break;
case USB_REQ_DFU_GETSTATUS:
break;
case USB_REQ_DFU_CLRSTATUS:
break;
case USB_REQ_DFU_ABORT:
break;
case USB_REQ_GETSTATE:
break;
case USB_REQ_DFU_UPLOAD:
break;
}
}
|