SPI providers are too helpful #521
Replies: 4 comments 1 reply
-
|
This is similar to this I2C issue #522 |
Beta Was this translation helpful? Give feedback.
-
|
SPI considerations for FFM Some time back a user offered a fix for pigpio, it was accepted. Recently This should be a single transfer with a spi_ioc_transfer[] . In addition there is conversation on creating a general use SPI write API for the *A *B I have a version of the linuxfs-spi with the above changes. transfers with one |
Beta Was this translation helpful? Give feedback.
-
|
Do you mean the myriad of transfer methods on Spi? If so, then as they are all default implementations, i don't see it necessary to test them in each implementation, but rather that we test com.pi4j.io.spi.Spi#transfer(byte[], int, byte[], int, int). |
Beta Was this translation helpful? Give feedback.
-
|
Tonight i will push that code as another set of eyes would be good. Thanks
The code leaves CS asserted until the last element in the array.
The existing code does release the CS each time, the prologue explains this
as it was the pigpio way and not the best. I saw Stefans comments on the
existing code. If debugging my problem with a preferred implementation is
lengthy I will update the present implementation from the comments.
…On Tue, Oct 7, 2025 at 4:13 AM Stefan Haustein ***@***.***> wrote:
Can you share the code you have so far for the array-based transfer?
Perhaps it just needs a second pair of eyes?
Not holding the chipselect would increase the chance the spi chip
operation fail.
The latest iteration of the implementation seems to force a CS toggle,
which seems to be the opposite of the quote above. I am concerned that this
will force a break up of large logical transfers and might even disrupt
logical transfers done in chunks.
—
Reply to this email directly, view it on GitHub
<#521 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK5A324JZARXX7PN2P66RAT3WN75HAVCNFSM6AAAAACIOIOIWOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTINRRGMYDKNQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Most functions provided by SPI are arguably not required at the "driver" level.
The only is actually required per plugin is
transfer. This could be considered problematic for a few reasons:transferand this then being dependent hardware, unit testing duplicate code can become complicated or repetitive.I'm not suggesting they are not useful. Simply that, if they were elsewhere in the codebase, writing and unit testing additional plugins might be simpler.
Maybe this is a long-winded way of suggesting they move to the abstract base class or
Spiinterface where they can be properly tested with a fake implementation oftransfer.Beta Was this translation helpful? Give feedback.
All reactions