aboutsummaryrefslogtreecommitdiffstats
path: root/config/usbd_config.h
blob: c20dfb2aeec7993bddb0d15279156c549399e751 (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/* Auto-generated config file usbd_config.h */
#ifndef USBD_CONFIG_H
#define USBD_CONFIG_H

// <<< Use Configuration Wizard in Context Menu >>>

// ---- USB Device Stack Core Options ----

// <q> High Speed Support
// <i> Enable high speed specific descriptors support, e.g., DeviceQualifierDescriptor and OtherSpeedConfiguration Descriptor.
// <i> High speed support require descriptors description array on start, for LS/FS and HS support in first and second place.
// <id> usbd_hs_sp
#ifndef CONF_USBD_HS_SP
#define CONF_USBD_HS_SP 0
#endif

// ---- USB Device Stack DFU Options ----

// <e> Enable String Descriptors
// <ID> USB_DFUD_STR_EN
#ifndef CONF_USB_DFUD_STR_EN
#define CONF_USB_DFUD_STR_EN 0
#endif
// <s> Language IDs
// <i> Language IDs in c format, split by comma (E.g., 0x0409 ...)
// <id> usb_dfud_langid
#ifndef CONF_USB_DFUD_LANGID
#define CONF_USB_DFUD_LANGID "0x0409"
#endif

#ifndef CONF_USB_DFUD_LANGID_DESC
#define CONF_USB_DFUD_LANGID_DESC 4, 0x03, 0x09, 0x04,
#endif
// </e>

// <h> DFU Device Descriptor

// <o> bcdUSB
// <0x0200=> USB 2.0 version
// <0x0210=> USB 2.1 version
// <id> usb_dfud_bcdusb
#ifndef CONF_USB_DFUD_BCDUSB
#define CONF_USB_DFUD_BCDUSB 0x200
#endif

// <o> bDeviceClass
// <0=> unused
// <id> usb_dfud_bdeviceclass
#ifndef CONF_USB_DFUD_BDEVICECLASS
#define CONF_USB_DFUD_BDEVICECLASS 0
#endif

// <o> bDeviceSubClass
// <0=> unused
// <id> usb_dfud_bdevicesubclass
#ifndef CONF_USB_DFUD_BDEVICESUBCLASS
#define CONF_USB_DFUD_BDEVICESUBCLASS 0
#endif

// <o> bDeviceProtocol
// <0=> unused
// <id> usb_dfud_bdeviceprotocol
#ifndef CONF_USB_DFUD_BDEVICEPROTOCOL
#define CONF_USB_DFUD_BDEVICEPROTOCOL 0
#endif

// <o> bMaxPackeSize0
// <0x0008=> 8 bytes
// <0x0010=> 16 bytes
// <0x0020=> 32 bytes
// <0x0040=> 64 bytes
// <id> usb_dfud_bmaxpksz0
#ifndef CONF_USB_DFUD_BMAXPKSZ0
#define CONF_USB_DFUD_BMAXPKSZ0 0x40
#endif

// <o> idVendor <0x0000-0xFFFF>
// <0x1d50=> OpenMoko
// <id> usb_dfud_idvendor
#ifndef CONF_USB_OPENMOKO_IDVENDOR
#define CONF_USB_OPENMOKO_IDVENDOR 0x1d50
#endif

// <o> idProduct <0x0000-0xFFFF>
// <0x6140=> osmo-ASF4-DFU
// <id> usb_dfud_idproduct
#ifndef CONF_USB_OSMOASF4DFU_IDPRODUCT
#define CONF_USB_OSMOASF4DFU_IDPRODUCT 0x6140
#endif

// <o> bcdDevice <0x0000-0xFFFF>
// <id> usb_dfud_bcddevice
#ifndef CONF_USB_DFUD_BCDDEVICE
#define CONF_USB_DFUD_BCDDEVICE 0x000
#endif

// <e> Enable string descriptor of iManufact
// <id> usb_dfud_imanufact_en
#ifndef CONF_USB_DFUD_IMANUFACT_EN
#define CONF_USB_DFUD_IMANUFACT_EN 1
#endif

#ifndef CONF_USB_DFUD_IMANUFACT
#define CONF_USB_DFUD_IMANUFACT (CONF_USB_DFUD_IMANUFACT_EN * (CONF_USB_DFUD_IMANUFACT_EN))
#endif

// <s> Unicode string of iManufact
// <id> usb_dfud_imanufact_str
#ifndef CONF_USB_DFUD_IMANUFACT_STR
#define CONF_USB_DFUD_IMANUFACT_STR "osmocom"
#endif

#ifndef CONF_USB_DFUD_IMANUFACT_STR_DESC
#define CONF_USB_DFUD_IMANUFACT_STR_DESC 16, 0x03, 'o', 0x00, 's', 0x00, 'm', 0x00, 'o', 0x00, 'c', 0x00, 'o', 0x00, 'm', 0x00,
#endif

// </e>

// <e> Enable string descriptor of iProduct
// <id> usb_dfud_iproduct_en
#ifndef CONF_USB_DFUD_IPRODUCT_EN
#define CONF_USB_DFUD_IPRODUCT_EN 1
#endif

#ifndef CONF_USB_DFUD_IPRODUCT
#define CONF_USB_DFUD_IPRODUCT                                                                                     \
	(CONF_USB_DFUD_IPRODUCT_EN * (CONF_USB_DFUD_IMANUFACT_EN + CONF_USB_DFUD_IPRODUCT_EN))
#endif

// <s> Unicode string of iProduct
// <id> usb_dfud_iproduct_str
#ifndef CONF_USB_DFUD_IPRODUCT_STR
#define CONF_USB_DFUD_IPRODUCT_STR "osmo-ASF4-DFU"
#endif

#ifndef CONF_USB_DFUD_IPRODUCT_STR_DESC
#define CONF_USB_DFUD_IPRODUCT_STR_DESC 28, 0x03, 'o', 0x00, 's', 0x00, 'm', 0x00, 'o', 0x00, '-', 0x00, 'A', 0x00, 'S', 0x00, 'F', 0x00, '4', 0x00, '-', 0x00, 'D', 0x00, 'F', 0x00, 'U', 0x00,
#endif

// </e>

// <e> Enable string descriptor of iSerialNum
// <id> usb_dfud_iserialnum_en
#ifndef CONF_USB_DFUD_ISERIALNUM_EN
#define CONF_USB_DFUD_ISERIALNUM_EN 0
#endif

#ifndef CONF_USB_DFUD_ISERIALNUM
#define CONF_USB_DFUD_ISERIALNUM                                                                                   \
	(CONF_USB_DFUD_ISERIALNUM_EN                                                                                   \
	 * (CONF_USB_DFUD_IMANUFACT_EN + CONF_USB_DFUD_IPRODUCT_EN + CONF_USB_DFUD_ISERIALNUM_EN))
#endif

// <s> Unicode string of iSerialNum
// <id> usb_dfud_iserialnum_str
#ifndef CONF_USB_DFUD_ISERIALNUM_STR
#define CONF_USB_DFUD_ISERIALNUM_STR "123456789ABCDEF"
#endif

#ifndef CONF_USB_DFUD_ISERIALNUM_STR_DESC
#define CONF_USB_DFUD_ISERIALNUM_STR_DESC 
#endif

// </e>

// <o> bNumConfigurations <0x01-0xFF>
// <id> usb_dfud_bnumconfig
#ifndef CONF_USB_DFUD_BNUMCONFIG
#define CONF_USB_DFUD_BNUMCONFIG 0x1
#endif

// </h>

// <h> DFU Configuration Descriptor

// <o> wTotalLength <0x01-0xFF>
// <id> usb_dfud_wtotallength
#ifndef CONF_USB_DFUD_WTOTALLENGTH
#define CONF_USB_DFUD_WTOTALLENGTH 27
#endif

// <o> bNumInterfaces <0x01-0xFF>
// <id> usb_dfud_bnuminterfaces
#ifndef CONF_USB_DFUD_BNUMINTERFACES
#define CONF_USB_DFUD_BNUMINTERFACES 1
#endif

// <o> bConfigurationValue <0x01-0xFF>
// <id> usb_dfud_bconfigval
#ifndef CONF_USB_DFUD_BCONFIGVAL
#define CONF_USB_DFUD_BCONFIGVAL 0x1
#endif

// <e> Enable string descriptor of iConfig
// <id> usb_dfud_iconfig_en
#ifndef CONF_USB_DFUD_ICONFIG_EN
#define CONF_USB_DFUD_ICONFIG_EN 0
#endif

#ifndef CONF_USB_DFUD_ICONFIG
#define CONF_USB_DFUD_ICONFIG                                                                                      \
	(CONF_USB_DFUD_ICONFIG_EN                                                                                      \
	 * (CONF_USB_DFUD_IMANUFACT_EN + CONF_USB_DFUD_IPRODUCT_EN + CONF_USB_DFUD_ISERIALNUM_EN               \
	    + CONF_USB_DFUD_ICONFIG_EN))
#endif

// <s> Unicode string of iConfig
// <id> usb_dfud_iconfig_str
#ifndef CONF_USB_DFUD_ICONFIG_STR
#define CONF_USB_DFUD_ICONFIG_STR ""
#endif

#ifndef CONF_USB_DFUD_ICONFIG_STR_DESC
#define CONF_USB_DFUD_ICONFIG_STR_DESC
#endif

// </e>

// <o> bmAttributes
// <0x80=> Bus power supply, not support for remote wakeup
// <0xA0=> Bus power supply, support for remote wakeup
// <0xC0=> Self powered, not support for remote wakeup
// <0xE0=> Self powered, support for remote wakeup
// <id> usb_dfud_bmattri
#ifndef CONF_USB_DFUD_BMATTRI
#define CONF_USB_DFUD_BMATTRI 0x80
#endif

// <o> bMaxPower <0x00-0xFF>
// <id> usb_dfud_bmaxpower
#ifndef CONF_USB_DFUD_BMAXPOWER
#define CONF_USB_DFUD_BMAXPOWER 0x32
#endif
// </h>

// <h> DFU Interface Descriptor

// <o> bInterfaceNumber <0x00-0xFF>
// <id> usb_dfud_bifcnum
#ifndef CONF_USB_DFUD_BIFCNUM
#define CONF_USB_DFUD_BIFCNUM 0x0
#endif

// <o> bAlternateSetting <0x00-0xFF>
// <id> usb_dfud_baltset
#ifndef CONF_USB_DFUD_BALTSET
#define CONF_USB_DFUD_BALTSET 0x0
#endif

// <o> bNumEndpoints <0x00-0xFF>
// <id> usb_dfud_bnumep
#ifndef CONF_USB_DFUD_BNUMEP
#define CONF_USB_DFUD_BNUMEP 0x0
#endif

// <e> Enable string descriptor of iInterface
// <id> usb_dfud_iinterface_en
#ifndef CONF_USB_DFUD_IINTERFACE_EN
#define CONF_USB_DFUD_IINTERFACE_EN 1
#endif

#ifndef CONF_USB_DFUD_IINTERFACE
#define CONF_USB_DFUD_IINTERFACE                                                                                      \
	(CONF_USB_DFUD_IINTERFACE_EN                                                                                      \
	 * (CONF_USB_DFUD_IMANUFACT_EN + CONF_USB_DFUD_IPRODUCT_EN + CONF_USB_DFUD_ISERIALNUM_EN               \
	    + CONF_USB_DFUD_ICONFIG_EN + CONF_USB_DFUD_IINTERFACE_EN))
#endif

// <s> Unicode string of iInterface
// <id> usb_dfud_iinterface_str
#ifndef CONF_USB_DFUD_IINTERFAGE_STR
#define CONF_USB_DFUD_IINTERFACE_STR "SAM D5x/E5x DFU bootloader (DFU mode)"
#endif

#ifndef CONF_USB_DFUD_IINTERFACE_STR_DESC
#define CONF_USB_DFUD_IINTERFACE_STR_DESC 76, 0x03, 'S', 0x00, 'A', 0x00, 'M', 0x00, ' ', 0x00, 'D', 0x00, '5', 0x00, 'x', 0x00, '/', 0x00, 'E', 0x00, '5',  0x00, 'x', 0x00, ' ', 0x00, 'D', 0x00, 'F', 0x00, 'U', 0x00, ' ', 0x00, 'b', 0x00, 'o', 0x00, 'o', 0x00, 't', 0x00, 'l', 0x00, 'o', 0x00, 'a', 0x00, 'd', 0x00, 'e', 0x00, 'r', 0x00, ' ', 0x00, '(', 0x00, 'D', 0x00, 'F', 0x00, 'U', 0x00, ' ', 0x00, 'm', 0x00, 'o', 0x00, 'd', 0x00, 'e', 0x00, ')', 0x00,
#endif

// </e>
// </h>

// <<< end of configuration section >>>

#endif // USBD_CONFIG_H