-
Notifications
You must be signed in to change notification settings - Fork 221
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
Migrate I8080 driver to a move based API #2191
Conversation
What do you think about introducing |
Can do. I have a comment in the example explaining why I didn't but I can add a really simple wrapper. |
Mmm I guess if there are common variants we might want to do it, but don't spend time just to humour me if I don't understand something :) |
The blocking case is somewhat straight forward but for the async case, when the user drops the future, should I cancel the transfer or let it complete in the background like SPI? I'll probably skip async for now. On second thought, I'd rather skip it. This driver isn't too popular I think and the few folks that use it can copy the bus implementation in the example and tweak it to their needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example works as before, thanks!
# Conflicts: # esp-hal/src/dma/gdma.rs # esp-hal/src/dma/mod.rs # esp-hal/src/dma/pdma.rs # esp-hal/src/lcd_cam/lcd/i8080.rs
Looks like the ESP32 I2S HIL test is flaky. As it's unrelated to this change, I'll hold off on rerunning it until the PR is approved. |
# Conflicts: # esp-hal/src/dma/mod.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
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
Refactor theWith the workaround in Fix incorrect QSPI setup #2231 I'm not sure if this is right direction anymore.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 (See Add an example of a compressed DMA frame buffer #2238).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