在各种协议中,单次传输长度一般都有限制。
关于SPI的长度可以参考下边邮件。
I2C的长度现在大家在linux驱动模型中也能找到限制。
在/drivers/i2c/i2c-dev.c 中参考代码:
i2cdev_read / i2cdev_write / i2cdev_ioctl_rdrw 中都有限制
如下:
/* Limit the size of the message to a sane amount */
if (rdwr_pa[i].len > 8192) {
res = -EINVAL;
break;
SPI单次 4K, I2C 单次 8K。
随着内核版本版本变迁可能会有变化,对应的在spi-dev 和 i2c-dev 中查找。