Эх сурвалжийг харах

chore(kconfig): add more config

Signed-off-by: sakumisu <1203593632@qq.com>
sakumisu 6 сар өмнө
parent
commit
40a052ba7f
5 өөрчлөгдсөн 138 нэмэгдсэн , 34 устгасан
  1. 43 0
      Kconfig
  2. 45 20
      Kconfig.rtt
  3. 48 11
      Kconfig.rttpkg
  4. 1 2
      SConscript
  5. 1 1
      cherryusb.cmake

+ 43 - 0
Kconfig

@@ -133,6 +133,29 @@ if CHERRYUSB
             prompt "Enable usb dfu device"
             prompt "Enable usb dfu device"
             default n
             default n
 
 
+        config USBDEV_REQUEST_BUFFER_LEN
+            int
+            prompt "Set device control transfer max buffer size"
+            default 512
+
+        config USBDEV_MSC_MAX_BUFSIZE
+            int
+            prompt "Set usb msc device max buffer size"
+            default 512
+            help
+                Set the maximum buffer size for usb msc device, it is used to transfer data.
+                you can change it to a larger value if you need larger speed but must be a power of blocksize.
+
+        config USBDEV_RNDIS_USING_LWIP
+            bool
+            prompt "Enable usb rndis device with lwip for lan"
+            default n
+
+        config USBDEV_CDC_ECM_USING_LWIP
+            bool
+            prompt "Enable usb cdc ecm device with lwip for lan"
+            default n
+
         choice
         choice
             prompt "Select usb device template, please select class driver first"
             prompt "Select usb device template, please select class driver first"
             default CHERRYUSB_DEVICE_TEMPLATE_NONE
             default CHERRYUSB_DEVICE_TEMPLATE_NONE
@@ -365,6 +388,26 @@ if CHERRYUSB
         config USBHOST_PLATFORM_RTL8152
         config USBHOST_PLATFORM_RTL8152
             bool
             bool
 
 
+        config USBHOST_PSC_PRIO
+            int
+            prompt "Set hubport change thread priority, 0 is the max priority"
+            default 0
+
+        config USBHOST_PSC_STACKSIZE
+            int
+            prompt "Set hubport change thread stacksize"
+            default 4096
+
+        config USBHOST_REQUEST_BUFFER_LEN
+            int
+            prompt "Set host control transfer max buffer size"
+            default 512
+
+        config USBHOST_CONTROL_TRANSFER_TIMEOUT
+            int
+            prompt "Set host control transfer timeout, unit is ms"
+            default 500
+
         menu "Select USB host template, please select class driver first"
         menu "Select USB host template, please select class driver first"
             config TEST_USBH_CDC_ACM
             config TEST_USBH_CDC_ACM
                 int
                 int

+ 45 - 20
Kconfig.rtt

@@ -140,6 +140,29 @@ if RT_USING_CHERRYUSB
             prompt "Enable chardev for cdc acm device"
             prompt "Enable chardev for cdc acm device"
             default n
             default n
 
 
+        config CONFIG_USBDEV_REQUEST_BUFFER_LEN
+            int
+            prompt "Set device control transfer max buffer size"
+            default 512
+
+        config CONFIG_USBDEV_MSC_MAX_BUFSIZE
+            int
+            prompt "Set usb msc device max buffer size"
+            default 512
+            help
+                Set the maximum buffer size for usb msc device, it is used to transfer data.
+                you can change it to a larger value if you need larger speed but must be a power of blocksize.
+
+        config CONFIG_USBDEV_RNDIS_USING_LWIP
+            bool
+            prompt "Enable usb rndis device with lwip for lan"
+            default n
+
+        config CONFIG_USBDEV_CDC_ECM_USING_LWIP
+            bool
+            prompt "Enable usb cdc ecm device with lwip for lan"
+            default n
+
         choice
         choice
             prompt "Select usb device template, please select class driver first"
             prompt "Select usb device template, please select class driver first"
             default RT_CHERRYUSB_DEVICE_TEMPLATE_NONE
             default RT_CHERRYUSB_DEVICE_TEMPLATE_NONE
@@ -384,6 +407,26 @@ if RT_USING_CHERRYUSB
         config CONFIG_USBHOST_PLATFORM_RTL8152
         config CONFIG_USBHOST_PLATFORM_RTL8152
             bool
             bool
 
 
+        config CONFIG_USBHOST_PSC_PRIO
+            int
+            prompt "Set hubport change thread priority, 0 is the max priority"
+            default 0
+
+        config CONFIG_USBHOST_PSC_STACKSIZE
+            int
+            prompt "Set hubport change thread stacksize"
+            default 4096
+
+        config CONFIG_USBHOST_REQUEST_BUFFER_LEN
+            int
+            prompt "Set host control transfer max buffer size"
+            default 512
+
+        config CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
+            int
+            prompt "Set host control transfer timeout, unit is ms"
+            default 500
+
         config RT_LWIP_PBUF_POOL_BUFSIZE
         config RT_LWIP_PBUF_POOL_BUFSIZE
             int "The size of each pbuf in the pbuf pool"
             int "The size of each pbuf in the pbuf pool"
             range 1500 2000
             range 1500 2000
@@ -394,28 +437,10 @@ if RT_USING_CHERRYUSB
             depends on RT_CHERRYUSB_HOST_MSC
             depends on RT_CHERRYUSB_HOST_MSC
             default "/"
             default "/"
 
 
-        config RT_CHERRYUSB_HOST_TEMPLATE
-            bool
-            prompt "Use usb host template"
-            default n
-
-        if RT_CHERRYUSB_HOST_TEMPLATE
-            config TEST_USBH_CDC_ACM
-                int
-                prompt "demo for test cdc acm"
-                default 0
-                depends on CHERRYUSB_HOST_CDC_ACM
-            config TEST_USBH_HID
-                int
-                prompt "demo for test hid"
-                default 0
-                depends on CHERRYUSB_HOST_HID
-        endif
-
         menu "Select USB host template, please select class driver first"
         menu "Select USB host template, please select class driver first"
             config CONFIG_TEST_USBH_CDC_ACM
             config CONFIG_TEST_USBH_CDC_ACM
                 int
                 int
-                prompt "demo for test cdc acm"
+                prompt "demo for test cdc acm, cannot enable this demo, we have used serial framework instead"
                 default 0
                 default 0
                 depends on RT_CHERRYUSB_HOST_CDC_ACM
                 depends on RT_CHERRYUSB_HOST_CDC_ACM
             config CONFIG_TEST_USBH_HID
             config CONFIG_TEST_USBH_HID
@@ -425,7 +450,7 @@ if RT_USING_CHERRYUSB
                 depends on RT_CHERRYUSB_HOST_HID
                 depends on RT_CHERRYUSB_HOST_HID
             config CONFIG_TEST_USBH_MSC
             config CONFIG_TEST_USBH_MSC
                 int
                 int
-                prompt "demo for test msc"
+                prompt "demo for test msc, cannot enable this demo, we have used dfs instead"
                 default 0
                 default 0
                 depends on RT_CHERRYUSB_HOST_MSC
                 depends on RT_CHERRYUSB_HOST_MSC
         endmenu
         endmenu

+ 48 - 11
Kconfig.rttpkg

@@ -139,6 +139,29 @@ if PKG_USING_CHERRYUSB
             prompt "Enable chardev for cdc acm device"
             prompt "Enable chardev for cdc acm device"
             default n
             default n
 
 
+        config CONFIG_USBDEV_REQUEST_BUFFER_LEN
+            int
+            prompt "Set device control transfer max buffer size"
+            default 512
+
+        config CONFIG_USBDEV_MSC_MAX_BUFSIZE
+            int
+            prompt "Set usb msc device max buffer size"
+            default 512
+            help
+                Set the maximum buffer size for usb msc device, it is used to transfer data.
+                you can change it to a larger value if you need larger speed but must be a power of blocksize.
+
+        config CONFIG_USBDEV_RNDIS_USING_LWIP
+            bool
+            prompt "Enable usb rndis device with lwip for lan"
+            default n
+
+        config CONFIG_USBDEV_CDC_ECM_USING_LWIP
+            bool
+            prompt "Enable usb cdc ecm device with lwip for lan"
+            default n
+
         choice
         choice
             prompt "Select usb device template, please select class driver first"
             prompt "Select usb device template, please select class driver first"
             default PKG_CHERRYUSB_DEVICE_TEMPLATE_NONE
             default PKG_CHERRYUSB_DEVICE_TEMPLATE_NONE
@@ -383,6 +406,26 @@ if PKG_USING_CHERRYUSB
         config CONFIG_USBHOST_PLATFORM_RTL8152
         config CONFIG_USBHOST_PLATFORM_RTL8152
             bool
             bool
 
 
+        config CONFIG_USBHOST_PSC_PRIO
+            int
+            prompt "Set hubport change thread priority, 0 is the max priority"
+            default 0
+
+        config CONFIG_USBHOST_PSC_STACKSIZE
+            int
+            prompt "Set hubport change thread stacksize"
+            default 4096
+
+        config CONFIG_USBHOST_REQUEST_BUFFER_LEN
+            int
+            prompt "Set host control transfer max buffer size"
+            default 512
+
+        config CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT
+            int
+            prompt "Set host control transfer timeout, unit is ms"
+            default 500
+
         config RT_LWIP_PBUF_POOL_BUFSIZE
         config RT_LWIP_PBUF_POOL_BUFSIZE
             int "The size of each pbuf in the pbuf pool"
             int "The size of each pbuf in the pbuf pool"
             range 1500 2000
             range 1500 2000
@@ -396,7 +439,7 @@ if PKG_USING_CHERRYUSB
         menu "Select USB host template, please select class driver first"
         menu "Select USB host template, please select class driver first"
             config CONFIG_TEST_USBH_CDC_ACM
             config CONFIG_TEST_USBH_CDC_ACM
                 int
                 int
-                prompt "demo for test cdc acm"
+                prompt "demo for test cdc acm, cannot enable this demo, we have used serial framework instead"
                 default 0
                 default 0
                 depends on PKG_CHERRYUSB_HOST_CDC_ACM
                 depends on PKG_CHERRYUSB_HOST_CDC_ACM
             config CONFIG_TEST_USBH_HID
             config CONFIG_TEST_USBH_HID
@@ -406,7 +449,7 @@ if PKG_USING_CHERRYUSB
                 depends on PKG_CHERRYUSB_HOST_HID
                 depends on PKG_CHERRYUSB_HOST_HID
             config CONFIG_TEST_USBH_MSC
             config CONFIG_TEST_USBH_MSC
                 int
                 int
-                prompt "demo for test msc"
+                prompt "demo for test msc, cannot enable this demo, we have used dfs instead"
                 default 0
                 default 0
                 depends on PKG_CHERRYUSB_HOST_MSC
                 depends on PKG_CHERRYUSB_HOST_MSC
         endmenu
         endmenu
@@ -424,18 +467,14 @@ if PKG_USING_CHERRYUSB
 
 
         config PKG_USING_CHERRYUSB_LATEST_VERSION
         config PKG_USING_CHERRYUSB_LATEST_VERSION
             bool "latest"
             bool "latest"
+        config PKG_USING_CHERRYUSB_V010501
+            bool "v1.5.1"
         config PKG_USING_CHERRYUSB_V010500
         config PKG_USING_CHERRYUSB_V010500
             bool "v1.5.0"
             bool "v1.5.0"
         config PKG_USING_CHERRYUSB_V010403
         config PKG_USING_CHERRYUSB_V010403
             bool "v1.4.3"
             bool "v1.4.3"
-        config PKG_USING_CHERRYUSB_V010402
-            bool "v1.4.2"
-        config PKG_USING_CHERRYUSB_V010400
-            bool "v1.4.0"
         config PKG_USING_CHERRYUSB_V010301
         config PKG_USING_CHERRYUSB_V010301
             bool "v1.3.1"
             bool "v1.3.1"
-        config PKG_USING_CHERRYUSB_V010300
-            bool "v1.3.0"
         config PKG_USING_CHERRYUSB_V010200
         config PKG_USING_CHERRYUSB_V010200
             bool "v1.2.0"
             bool "v1.2.0"
         config PKG_USING_CHERRYUSB_V001002
         config PKG_USING_CHERRYUSB_V001002
@@ -445,12 +484,10 @@ if PKG_USING_CHERRYUSB
     config PKG_CHERRYUSB_VER
     config PKG_CHERRYUSB_VER
        string
        string
        default "latest"    if PKG_USING_CHERRYUSB_LATEST_VERSION
        default "latest"    if PKG_USING_CHERRYUSB_LATEST_VERSION
+       default "v1.5.1"   if PKG_USING_CHERRYUSB_V010501
        default "v1.5.0"   if PKG_USING_CHERRYUSB_V010500
        default "v1.5.0"   if PKG_USING_CHERRYUSB_V010500
        default "v1.4.3"   if PKG_USING_CHERRYUSB_V010403
        default "v1.4.3"   if PKG_USING_CHERRYUSB_V010403
-       default "v1.4.2"   if PKG_USING_CHERRYUSB_V010402
-       default "v1.4.0"   if PKG_USING_CHERRYUSB_V010400
        default "v1.3.1"   if PKG_USING_CHERRYUSB_V010301
        default "v1.3.1"   if PKG_USING_CHERRYUSB_V010301
-       default "v1.3.0"   if PKG_USING_CHERRYUSB_V010300
        default "v1.2.0"   if PKG_USING_CHERRYUSB_V010200
        default "v1.2.0"   if PKG_USING_CHERRYUSB_V010200
        default "v0.10.2"   if PKG_USING_CHERRYUSB_V001002
        default "v0.10.2"   if PKG_USING_CHERRYUSB_V001002
 endif
 endif

+ 1 - 2
SConscript

@@ -289,8 +289,7 @@ if GetDepend(['PKG_CHERRYUSB_HOST']):
     if GetDepend(['PKG_CHERRYUSB_HOST_PL2303']):
     if GetDepend(['PKG_CHERRYUSB_HOST_PL2303']):
         src += Glob('class/vendor/serial/usbh_pl2303.c')
         src += Glob('class/vendor/serial/usbh_pl2303.c')
 
 
-    if GetDepend(['PKG_CHERRYUSB_HOST_TEMPLATE']):
-        CPPDEFINES+=['TEST_USBH_MSC=0']
+    if GetDepend(['CONFIG_TEST_USBH_HID']):
         src += Glob('demo/usb_host.c')
         src += Glob('demo/usb_host.c')
 
 
     if GetDepend(['PKG_CHERRYUSB_HOST_CDC_ACM'])    \
     if GetDepend(['PKG_CHERRYUSB_HOST_CDC_ACM'])    \

+ 1 - 1
cherryusb.cmake

@@ -329,7 +329,7 @@ if(CONFIG_CHERRYUSB_HOST)
         list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/rp2040/usb_hc_rp2040.c)
         list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/rp2040/usb_hc_rp2040.c)
     endif()
     endif()
 
 
-    if(CHERRYUSB_HOST_TEMPLATE)
+    if(CONFIG_TEST_USBH_CDC_ACM OR CONFIG_TEST_USBH_HID OR CONFIG_TEST_USBH_MSC)
         list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/demo/usb_host.c)
         list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/demo/usb_host.c)
     endif()
     endif()
 endif()
 endif()