Replies: 1 comment
-
See #3125 . Short answer is you're free to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我在使用 SPI DMA 功能时遇到一个设计上的疑问,希望能请教一下你们的设计思路,并探讨是否有优化空间。
目前在 spi::master::SpiDmaBus 的实现中,构造 SpiDmaBus 时需要传入一个 DmaTxBuf,这导致必须事先将数据复制到一个 DMA 兼容的缓冲区中。这样的设计在某些场景下增加了内存复制的负担,从而使得“零拷贝传输”的实现变得较为困难。
相比之下,我注意到 I2S 的 DMA 传输是通过实现 ReadBuffer trait 来支持缓冲区访问的,这种方式可以使得原始的数据结构直接参与 DMA 传输,从而规避中间的复制。
因此,我有几个问题想请教一下:
当前 SpiDmaBus 选择要求传入 DmaTxBuf 而不是类似 ReadBuffer trait 的设计,是出于哪些考虑?是硬件上的限制、API 设计一致性,还是安全性方面的考虑?
是否有可能在未来的版本中考虑类似 I2S 的实现方式,以便在 SpiDmaBus 中更好地支持零拷贝?
Beta Was this translation helpful? Give feedback.
All reactions