-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare LPSPI driver for embedded-hal 1.0
rework
#149
base: main
Are you sure you want to change the base?
Conversation
@mciantyre Sorry that I was gone for a while. Don't know how much time I will be able to spend on the SPI device, but I'll try to do a little :) I finally finished this PR. I didn't update examples yet, but I think there's no point really in updating them until we have a properly reworked driver. Any feedback? |
@mciantyre Ping :) |
I’d say squash this and I’ll merge, changes look good. Ian is presumably busy with other endeavors at the moment. |
@teburd I don't think I agree time to continue this any time soon, so let's keep that one open because it's a breaking change. |
There's useful non-breaking changes in this branch, changes that could help today's users. I extracted them into #156. |
@mciantyre Welcome back! Glad to see your life has cooled down enough to dabble in some Rust again :) |
Some fixes/modifications to the existing LPSPI driver.
This is in preparation for the
embedded-hal 1.0
rework, which will introduce a new high level driver that wraps this low level one.Changes:
CS_PIN
fromSpi
deviceSpi
intoSpi
+SpiCsPin
in theboard
subcrategpio::Output
constructor. This is important for cases where the state needs to be set before enabling the pin.PCSSCK
andSCKPCS
properly for contiguous transferssoft_reset
that cancels the current transfer without requiring a full re-initializationenqueue_transaction
so that multiple transactions with different settings can be enqueued in seriesflush
function that waits for the current transaction to be finished whilst repeatedly checking for errorsdisabled()
not waiting for the current transfer to be finishedset_watermark
out ofdisabled
, because it doesn't require it.