1# Kconfig file for package CherryUSB 2menuconfig PKG_USING_CHERRYUSB 3 depends on RT_VER_NUM < 0x50200 4 bool "CherryUSB: tiny and portable USB host/device stack for embedded system with USB IP" 5 default n 6 7if PKG_USING_CHERRYUSB 8 9 menuconfig PKG_CHERRYUSB_DEVICE 10 bool "Enable usb device mode" 11 default n 12 13 if PKG_CHERRYUSB_DEVICE 14 choice 15 prompt "Select usb device speed" 16 default PKG_CHERRYUSB_DEVICE_SPEED_FS 17 config PKG_CHERRYUSB_DEVICE_SPEED_FS 18 bool "FS" 19 config PKG_CHERRYUSB_DEVICE_SPEED_HS 20 bool "HS" 21 config PKG_CHERRYUSB_DEVICE_SPEED_AUTO 22 bool "AUTO" 23 endchoice 24 25 choice 26 prompt "Select usb device ip, and some ip need config in usb_config.h, please check" 27 default PKG_CHERRYUSB_DEVICE_CUSTOM 28 config PKG_CHERRYUSB_DEVICE_CUSTOM 29 bool "CUSTOM (Implement it yourself)" 30 config PKG_CHERRYUSB_DEVICE_FSDEV_ST 31 bool "fsdev_st" 32 config PKG_CHERRYUSB_DEVICE_FSDEV_CUSTOM 33 bool "fsdev_custom" 34 config PKG_CHERRYUSB_DEVICE_DWC2_ST 35 bool "dwc2_st" 36 config PKG_CHERRYUSB_DEVICE_DWC2_ESP 37 bool "dwc2_esp" 38 config PKG_CHERRYUSB_DEVICE_DWC2_KENDRYTE 39 bool "dwc2_kendryte" 40 config PKG_CHERRYUSB_DEVICE_DWC2_AT 41 bool "dwc2_at" 42 config PKG_CHERRYUSB_DEVICE_DWC2_HC 43 bool "dwc2_hc" 44 config PKG_CHERRYUSB_DEVICE_DWC2_NATION 45 bool "dwc2_nation" 46 config PKG_CHERRYUSB_DEVICE_DWC2_GD 47 bool "dwc2_gd" 48 config PKG_CHERRYUSB_DEVICE_DWC2_CUSTOM 49 bool "dwc2_custom" 50 config PKG_CHERRYUSB_DEVICE_MUSB_ES 51 bool "musb_es" 52 config PKG_CHERRYUSB_DEVICE_MUSB_SUNXI 53 bool "musb_sunxi" 54 config PKG_CHERRYUSB_DEVICE_MUSB_BK 55 bool "musb_bk" 56 config PKG_CHERRYUSB_DEVICE_MUSB_SIFLI 57 bool "musb_sifli" 58 config PKG_CHERRYUSB_DEVICE_MUSB_CUSTOM 59 bool "musb_custom" 60 config PKG_CHERRYUSB_DEVICE_CHIPIDEA_MCX 61 bool "chipidea_mcx" 62 config PKG_CHERRYUSB_DEVICE_CHIPIDEA_CUSTOM 63 bool "chipidea_custom" 64 config PKG_CHERRYUSB_DEVICE_KINETIS_MCX 65 bool "kinetis_mcx" 66 config PKG_CHERRYUSB_DEVICE_KINETIS_MM32 67 bool "kinetis_mm32" 68 config PKG_CHERRYUSB_DEVICE_KINETIS_CUSTOM 69 bool "kinetis_custom" 70 config PKG_CHERRYUSB_DEVICE_BL 71 bool "bouffalo" 72 config PKG_CHERRYUSB_DEVICE_HPM 73 bool "hpm" 74 config PKG_CHERRYUSB_DEVICE_AIC 75 bool "aic" 76 config PKG_CHERRYUSB_DEVICE_RP2040 77 bool "rp2040" 78 config PKG_CHERRYUSB_DEVICE_CH32 79 bool "ch32" 80 config PKG_CHERRYUSB_DEVICE_PUSB2 81 bool "pusb2" 82 endchoice 83 84 config PKG_CHERRYUSB_DEVICE_CDC_ACM 85 bool 86 prompt "Enable usb cdc acm device" 87 default n 88 89 config PKG_CHERRYUSB_DEVICE_HID 90 bool 91 prompt "Enable usb hid device" 92 default n 93 94 config PKG_CHERRYUSB_DEVICE_MSC 95 bool 96 prompt "Enable usb msc device" 97 default n 98 99 config PKG_CHERRYUSB_DEVICE_AUDIO 100 bool 101 prompt "Enable usb audio device" 102 default n 103 104 config PKG_CHERRYUSB_DEVICE_VIDEO 105 bool 106 prompt "Enable usb video device" 107 default n 108 109 config PKG_CHERRYUSB_DEVICE_CDC_RNDIS 110 bool 111 prompt "Enable usb cdc rndis device" 112 default n 113 114 config PKG_CHERRYUSB_DEVICE_CDC_ECM 115 bool 116 prompt "Enable usb cdc ecm device" 117 default n 118 119 config PKG_CHERRYUSB_DEVICE_CDC_NCM 120 bool 121 prompt "Enable usb cdc ncm device" 122 default n 123 124 config PKG_CHERRYUSB_DEVICE_MTP 125 bool 126 prompt "Enable usb mtp device, it is commercial charge" 127 default n 128 129 config PKG_CHERRYUSB_DEVICE_ADB 130 bool 131 prompt "Enable usb adb device" 132 default n 133 134 config PKG_CHERRYUSB_DEVICE_DFU 135 bool 136 prompt "Enable usb dfu device" 137 default n 138 139 config PKG_CHERRYUSB_DEVICE_CDC_ACM_CHARDEV 140 bool 141 prompt "Enable chardev for cdc acm device" 142 default n 143 144 config CONFIG_USBDEV_REQUEST_BUFFER_LEN 145 int 146 prompt "Set device control transfer max buffer size" 147 default 512 148 149 config CONFIG_USBDEV_MSC_MAX_BUFSIZE 150 int 151 prompt "Set usb msc device max buffer size" 152 default 512 153 help 154 Set the maximum buffer size for usb msc device, it is used to transfer data. 155 you can change it to a larger value if you need larger speed but must be a power of blocksize. 156 157 config CONFIG_USBDEV_RNDIS_USING_LWIP 158 bool 159 prompt "Enable usb rndis device with lwip for lan" 160 default n 161 162 config CONFIG_USBDEV_CDC_ECM_USING_LWIP 163 bool 164 prompt "Enable usb cdc ecm device with lwip for lan" 165 default n 166 167 choice 168 prompt "Select usb device template, please select class driver first" 169 default PKG_CHERRYUSB_DEVICE_TEMPLATE_NONE 170 config PKG_CHERRYUSB_DEVICE_TEMPLATE_NONE 171 bool 172 prompt "none (Implement it yourself)" 173 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM 174 bool 175 prompt "cdc_acm" 176 depends on PKG_CHERRYUSB_DEVICE_CDC_ACM 177 config PKG_CHERRYUSB_DEVICE_TEMPLATE_MSC 178 bool 179 prompt "msc_ram" 180 depends on PKG_CHERRYUSB_DEVICE_MSC 181 config PKG_CHERRYUSB_DEVICE_TEMPLATE_MSC_BLKDEV 182 bool 183 prompt "msc_blkdev" 184 depends on PKG_CHERRYUSB_DEVICE_MSC 185 config PKG_CHERRYUSB_DEVICE_TEMPLATE_HID_KEYBOARD 186 bool 187 prompt "hid_keyboard" 188 depends on PKG_CHERRYUSB_DEVICE_HID 189 config PKG_CHERRYUSB_DEVICE_TEMPLATE_HID_MOUSE 190 bool 191 prompt "hid_mouse" 192 depends on PKG_CHERRYUSB_DEVICE_HID 193 config PKG_CHERRYUSB_DEVICE_TEMPLATE_HID_CUSTOM 194 bool 195 prompt "hid_custom" 196 depends on PKG_CHERRYUSB_DEVICE_HID 197 config PKG_CHERRYUSB_DEVICE_TEMPLATE_VIDEO 198 bool 199 prompt "video" 200 depends on PKG_CHERRYUSB_DEVICE_VIDEO 201 config PKG_CHERRYUSB_DEVICE_TEMPLATE_AUDIO_V1_MIC_SPEAKER 202 bool 203 prompt "audio_v1_mic_speaker_multichan" 204 depends on PKG_CHERRYUSB_DEVICE_AUDIO 205 config PKG_CHERRYUSB_DEVICE_TEMPLATE_AUDIO_V2_MIC_SPEAKER 206 bool 207 prompt "audio_v2_mic_speaker_multichan" 208 depends on PKG_CHERRYUSB_DEVICE_AUDIO 209 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_RNDIS 210 bool 211 prompt "cdc_rndis" 212 depends on PKG_CHERRYUSB_DEVICE_CDC_RNDIS 213 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_ECM 214 bool 215 prompt "cdc_ecm" 216 depends on PKG_CHERRYUSB_DEVICE_CDC_ECM 217 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_NCM 218 bool 219 prompt "cdc_ncm" 220 depends on PKG_CHERRYUSB_DEVICE_CDC_NCM 221 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_MSC 222 bool 223 prompt "cdc_acm_msc" 224 depends on PKG_CHERRYUSB_DEVICE_CDC_ACM && PKG_CHERRYUSB_DEVICE_MSC 225 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_MSC_HID 226 bool 227 prompt "cdc_acm_msc_hid" 228 depends on PKG_CHERRYUSB_DEVICE_CDC_ACM && PKG_CHERRYUSB_DEVICE_MSC && PKG_CHERRYUSB_DEVICE_HID 229 config PKG_CHERRYUSB_DEVICE_TEMPLATE_WINUSBV1 230 bool 231 prompt "winusbv1" 232 config PKG_CHERRYUSB_DEVICE_TEMPLATE_WINUSBV2_CDC 233 bool 234 prompt "winusbv2_cdc" 235 depends on PKG_CHERRYUSB_DEVICE_CDC_ACM 236 config PKG_CHERRYUSB_DEVICE_TEMPLATE_WINUSBV2_HID 237 bool 238 prompt "winusbv2_hid" 239 depends on PKG_CHERRYUSB_DEVICE_HID 240 config PKG_CHERRYUSB_DEVICE_TEMPLATE_ADB 241 bool 242 prompt "adb" 243 depends on PKG_CHERRYUSB_DEVICE_ADB 244 config PKG_CHERRYUSB_DEVICE_TEMPLATE_CDC_ACM_CHARDEV 245 bool 246 prompt "cdc_acm_chardev" 247 depends on PKG_CHERRYUSB_DEVICE_CDC_ACM_CHARDEV 248 endchoice 249 250 config CONFIG_USBDEV_MSC_BLOCK_DEV_NAME 251 string "usb device msc block device name" 252 depends on PKG_CHERRYUSB_DEVICE_TEMPLATE_MSC_BLKDEV 253 default "sd0" 254 255 endif 256 257 menuconfig PKG_CHERRYUSB_HOST 258 bool "Enable usb host mode" 259 default n 260 261 if PKG_CHERRYUSB_HOST 262 choice 263 prompt "Select usb host ip, and some ip need config in usb_config.h, please check" 264 default PKG_CHERRYUSB_HOST_CUSTOM 265 config PKG_CHERRYUSB_HOST_CUSTOM 266 bool "CUSTOM (Implement it yourself)" 267 config PKG_CHERRYUSB_HOST_EHCI_BL 268 bool "ehci_bouffalo" 269 config PKG_CHERRYUSB_HOST_EHCI_HPM 270 bool "ehci_hpm" 271 config PKG_CHERRYUSB_HOST_EHCI_AIC 272 bool "ehci_aic" 273 config PKG_CHERRYUSB_HOST_EHCI_MCX 274 bool "ehci_mcx" 275 config PKG_CHERRYUSB_HOST_EHCI_NUC980 276 bool "ehci_nuc980" 277 config PKG_CHERRYUSB_HOST_EHCI_MA35D0 278 bool "ehci_ma35d0" 279 config PKG_CHERRYUSB_HOST_EHCI_CUSTOM 280 bool "ehci_custom" 281 config PKG_CHERRYUSB_HOST_DWC2_ST 282 bool "dwc2_st" 283 config PKG_CHERRYUSB_HOST_DWC2_ESP 284 bool "dwc2_esp" 285 config PKG_CHERRYUSB_HOST_DWC2_KENDRYTE 286 bool "dwc2_kendryte" 287 config PKG_CHERRYUSB_HOST_DWC2_HC 288 bool "dwc2_hc" 289 config PKG_CHERRYUSB_HOST_DWC2_NATION 290 bool "dwc2_nation" 291 config PKG_CHERRYUSB_HOST_DWC2_CUSTOM 292 bool "dwc2_custom" 293 config PKG_CHERRYUSB_HOST_MUSB_ES 294 bool "musb_es" 295 config PKG_CHERRYUSB_HOST_MUSB_SUNXI 296 bool "musb_sunxi" 297 config PKG_CHERRYUSB_HOST_MUSB_BK 298 bool "musb_bk" 299 config PKG_CHERRYUSB_HOST_MUSB_SIFLI 300 bool "musb_sifli" 301 config PKG_CHERRYUSB_HOST_MUSB_CUSTOM 302 bool "musb_custom" 303 config PKG_CHERRYUSB_HOST_PUSB2 304 bool "pusb2" 305 config PKG_CHERRYUSB_HOST_XHCI 306 bool "xhci" 307 config PKG_CHERRYUSB_HOST_RP2040 308 bool "rp2040" 309 endchoice 310 311 config PKG_CHERRYUSB_HOST_CDC_ACM 312 bool 313 prompt "Enable usb cdc acm driver" 314 default n 315 316 config PKG_CHERRYUSB_HOST_HID 317 bool 318 prompt "Enable usb hid driver" 319 default n 320 321 config PKG_CHERRYUSB_HOST_MSC 322 bool 323 prompt "Enable usb msc driver" 324 default n 325 select RT_USING_DFS 326 select RT_USING_DFS_ELMFAT 327 328 config PKG_CHERRYUSB_HOST_CDC_ECM 329 bool 330 prompt "Enable usb cdc ecm driver" 331 select RT_USING_LWIP 332 select CONFIG_USBHOST_PLATFORM_CDC_ECM 333 default n 334 335 config PKG_CHERRYUSB_HOST_CDC_RNDIS 336 bool 337 prompt "Enable usb rndis driver" 338 select RT_USING_LWIP 339 select CONFIG_USBHOST_PLATFORM_CDC_RNDIS 340 default n 341 342 config PKG_CHERRYUSB_HOST_CDC_NCM 343 bool 344 prompt "Enable usb cdc ncm driver" 345 select RT_USING_LWIP 346 select CONFIG_USBHOST_PLATFORM_CDC_NCM 347 default n 348 349 config PKG_CHERRYUSB_HOST_VIDEO 350 bool 351 prompt "Enable usb video driver, it is commercial charge" 352 default n 353 354 config PKG_CHERRYUSB_HOST_AUDIO 355 bool 356 prompt "Enable usb audio driver, it is commercial charge" 357 default n 358 359 config PKG_CHERRYUSB_HOST_BLUETOOTH 360 bool 361 prompt "Enable usb bluetooth driver" 362 default n 363 364 config PKG_CHERRYUSB_HOST_ASIX 365 bool 366 prompt "Enable usb asix driver" 367 select RT_USING_LWIP 368 select CONFIG_USBHOST_PLATFORM_ASIX 369 default n 370 371 config PKG_CHERRYUSB_HOST_RTL8152 372 bool 373 prompt "Enable usb rtl8152 driver" 374 select RT_USING_LWIP 375 select CONFIG_USBHOST_PLATFORM_RTL8152 376 default n 377 378 config PKG_CHERRYUSB_HOST_FTDI 379 bool 380 prompt "Enable usb ftdi driver" 381 default n 382 383 config PKG_CHERRYUSB_HOST_CH34X 384 bool 385 prompt "Enable usb ch34x driver" 386 default n 387 388 config PKG_CHERRYUSB_HOST_CP210X 389 bool 390 prompt "Enable usb cp210x driver" 391 default n 392 393 config PKG_CHERRYUSB_HOST_PL2303 394 bool 395 prompt "Enable usb pl2303 driver" 396 default n 397 398 config CONFIG_USBHOST_PLATFORM_CDC_ECM 399 bool 400 401 config CONFIG_USBHOST_PLATFORM_CDC_RNDIS 402 bool 403 404 config CONFIG_USBHOST_PLATFORM_CDC_NCM 405 bool 406 407 config CONFIG_USBHOST_PLATFORM_ASIX 408 bool 409 410 config CONFIG_USBHOST_PLATFORM_RTL8152 411 bool 412 413 config CONFIG_USBHOST_PSC_PRIO 414 int 415 prompt "Set hubport change thread priority, 0 is the max priority" 416 default 0 417 418 config CONFIG_USBHOST_PSC_STACKSIZE 419 int 420 prompt "Set hubport change thread stacksize" 421 default 4096 422 423 config CONFIG_USBHOST_REQUEST_BUFFER_LEN 424 int 425 prompt "Set host control transfer max buffer size" 426 default 512 427 428 config CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 429 int 430 prompt "Set host control transfer timeout, unit is ms" 431 default 500 432 433 config RT_LWIP_PBUF_POOL_BUFSIZE 434 int "The size of each pbuf in the pbuf pool" 435 range 1500 2000 436 default 1600 437 438 config CONFIG_USB_DFS_MOUNT_POINT 439 string "usb host dfs mount point" 440 depends on RT_CHERRYUSB_HOST_MSC 441 default "/" 442 443 menu "Select USB host template, please select class driver first" 444 config CONFIG_TEST_USBH_CDC_ACM 445 int 446 prompt "demo for test cdc acm, cannot enable this demo, we have used serial framework instead" 447 default 0 448 depends on PKG_CHERRYUSB_HOST_CDC_ACM 449 config CONFIG_TEST_USBH_HID 450 int 451 prompt "demo for test hid" 452 default 0 453 depends on PKG_CHERRYUSB_HOST_HID 454 config CONFIG_TEST_USBH_MSC 455 int 456 prompt "demo for test msc, cannot enable this demo, we have used dfs instead" 457 default 0 458 depends on PKG_CHERRYUSB_HOST_MSC 459 endmenu 460 endif 461 462 config PKG_CHERRYUSB_PATH 463 string 464 default "/packages/system/CherryUSB" 465 466 choice 467 prompt "Version" 468 default PKG_USING_CHERRYUSB_V010502 469 help 470 Select the package version 471 472 config PKG_USING_CHERRYUSB_LATEST_VERSION 473 bool "latest" 474 config PKG_USING_CHERRYUSB_V010502 475 bool "v1.5.2" 476 config PKG_USING_CHERRYUSB_V010501 477 bool "v1.5.1" 478 config PKG_USING_CHERRYUSB_V010500 479 bool "v1.5.0" 480 config PKG_USING_CHERRYUSB_V010403 481 bool "v1.4.3" 482 config PKG_USING_CHERRYUSB_V010301 483 bool "v1.3.1" 484 config PKG_USING_CHERRYUSB_V010200 485 bool "v1.2.0" 486 config PKG_USING_CHERRYUSB_V001002 487 bool "v0.10.2" 488 endchoice 489 490 config PKG_CHERRYUSB_VER 491 string 492 default "latest" if PKG_USING_CHERRYUSB_LATEST_VERSION 493 default "v1.5.2" if PKG_USING_CHERRYUSB_V010502 494 default "v1.5.1" if PKG_USING_CHERRYUSB_V010501 495 default "v1.5.0" if PKG_USING_CHERRYUSB_V010500 496 default "v1.4.3" if PKG_USING_CHERRYUSB_V010403 497 default "v1.3.1" if PKG_USING_CHERRYUSB_V010301 498 default "v1.2.0" if PKG_USING_CHERRYUSB_V010200 499 default "v0.10.2" if PKG_USING_CHERRYUSB_V001002 500endif 501