-
Notifications
You must be signed in to change notification settings - Fork 236
Open
Description
There is currently no support for SPI operations (in a transaction slice) to mutably share data.
Use case: SPI devices often implement the following behavior (happy to provide numerous examples if this is in doubt) to implement an atomic update of several bits.
- Load "active" bits into the SPI shift register (that sits between SDI and SDO) on CS assertion.
- Load new bits from shift register into "active" register on CS deassertion.
The intention is to implement a read of the active bits without altering them (not even a transient alteration).
The approach would be to keep CS asserted accross a transaction of reading and writing the same values again.
let mut bits = [0; 4];
spi_device.transaction(&mut [Operation::Read(&mut bits), Operation::Write(&bits)]);
This is currently not possible with the Operation
enum.
reitermarkus
Metadata
Metadata
Assignees
Labels
No labels