在 Raspbian 中增加 SPI 缓冲区大小 [英] Increase SPI buffer size in Raspbian

查看:92
本文介绍了在 Raspbian 中增加 SPI 缓冲区大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在单次传输中通过 SPI 发送 10 k 字节(是的,因为 Linux 是实时的,如果我在两次传输中发送这些字节,我与 IC 的时序不匹配).

I need to send 10 k bytes over SPI in single transfer (yes, because Linux is so realtime, if I send these bytes in two transfers, I do not match the timings of IC).

但是 spi_bcm2708 内核模块中消息的最大大小是 4096 字节.我如何修改这个值(最好不重新编译模块)?如果我可以为模块指定参数,那么我需要指定什么参数和在什么文件中?

But maximum size of message in spi_bcm2708 kernel module is 4096 bytes. How do I modify this value (preferably without recompilation of the module)? If I can do with specifying parameter to the module, what parameter and in what file I need to specify?

提前致谢.

推荐答案

一段时间以来,Pi Foundation 已经将 SPI 设备驱动程序编译到内核中.现在改变缓冲区大小的方法是编辑/boot/cmdline.txt文件并添加:

For some time, the Pi Foundation have compiled the SPI device driver into the kernel. The way to change the buffer size now is to edit the /boot/cmdline.txt file and add:

spidev.bufsiz=<NEEDED BUFFER SIZE>

这篇关于在 Raspbian 中增加 SPI 缓冲区大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆