You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is allowed for read and write to have different lengths, even zero length. The transfer runs for max(read.len(), write.len()) words. If read is shorter, incoming words after read has been filled will be discarded. If write is shorter, the value of words sent in MOSI after all write has been sent is implementation-defined, typically 0x00, 0xFF, or configurable.
leading to panics when the buffer lengths differ. We should adjust the buffers passed to read_write, or split the transfer into a read_write and a write or something, to accommodate.
The text was updated successfully, but these errors were encountered:
adamgreig
added a commit
to adamgreig/linux-embedded-hal
that referenced
this issue
Sep 25, 2023
In embedded-hal SPI transfers, the read and write buffers may be different lengths:
In spidev read_write, it is not:
However currently we implement
transfer
by callingread_write
directly:linux-embedded-hal/src/spi.rs
Line 100 in 86ab035
leading to panics when the buffer lengths differ. We should adjust the buffers passed to
read_write
, or split the transfer into a read_write and a write or something, to accommodate.The text was updated successfully, but these errors were encountered: