fix(usbh_serial): fix serial iobuffer size, remove length limit of write

Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
sakumisu
2025-12-17 20:42:40 +08:00
parent baf2a56c93
commit a6ffbd3600
4 changed files with 12 additions and 7 deletions

View File

@@ -206,10 +206,10 @@ usbh_serial_write
- **serial** serial 结构体句柄
- **buffer** 数据缓冲区指针
- **buflen** 要写入的数据长度,如果是 USB2TTL 设备,一次最高 wMaxPacketSize
- **buflen** 要写入的数据长度
- **return** 实际写入的数据长度或者错误码
.. note:: 有无设置波特率都可以使用该 API当未设置波特率时长度无限制如果设置了波特率则为 wMaxPacketSize
.. note:: 如果没有开启 CONFIG_USB_DCACHE_ENABLE则 buffer 需要是 nocache区域否则需要是对齐到 CONFIG_USB_ALIGN_SIZE 的区域
usbh_serial_read
""""""""""""""""""""""""""""""""""""
@@ -225,6 +225,8 @@ usbh_serial_read
- **buflen** 要读取的最大数据长度
- **return** 实际读取的数据长度或者错误码
.. note:: 由于内部使用了 ringbuffer对于用户的 buffer 属性没有限制。
usbh_serial_cdc_write_async
""""""""""""""""""""""""""""""""""""
@@ -241,6 +243,8 @@ usbh_serial_cdc_write_async
- **arg** 回调函数参数
- **return** 0 表示正常其他表示错误
.. note:: 如果没有开启 CONFIG_USB_DCACHE_ENABLE则 buffer 需要是 nocache区域否则需要是对齐到 CONFIG_USB_ALIGN_SIZE 的区域。
usbh_serial_cdc_read_async
""""""""""""""""""""""""""""""""""""
@@ -257,6 +261,7 @@ usbh_serial_cdc_read_async
- **arg** 回调函数参数
- **return** 0 表示正常其他表示错误
.. note:: 如果没有开启 CONFIG_USB_DCACHE_ENABLE则 buffer 需要是 nocache区域否则需要是对齐到 CONFIG_USB_ALIGN_SIZE 的区域。
HID
-----------------