Migrate I8080 driver to a move based API #2191
Open
+319
−295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
Similar to #1856 but for the I8080 driver.
Starting a transfer now moves the driver into the transfer object. This allows you to store the transfer object in a
static
(for interrupts) or in a struct/enum.Starting a transfer now takes a
DmaTxBuffer
rather than a plain slice. This allows you to bring your own DMA data structure, and also allows you to prepare the next transfer whilst one is already in progress.This PR also adds support for cancelling a transfer on the spot.
Future enhancements
I8080Transfer
(and theSpiDmaTransfer
) struct into a common DmaTransfer struct like so,I8080Transfer<'d, DmaChannel0, Blocking, BUF>
->DmaTransferRx<'d, DmaChannel0, BUF, I8080<'d, Blocking>>
.DmaTxBuffer
implementation that does RLE for the frame buffer.DmaTxBuf
to take a generic param which would allow more primitive types. e.g.DmaTxBuf<u16>
,DmaTxBuf<embedded_graphics::Rgb565>
, etc.cc @JurajSadel to run the example again, this is the last one (but no promises 🙂).
cc @liebman to review as well as this should allow you to easily use PSRAM with this driver after #2161 lands.
Reviewer note: Don't let the diff of the diff in the migration guide confuse you.
Testing
Ran the example and HIL tests