Skip to content

Simplify user-facing DMA channel types #626

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

Merged
merged 6 commits into from
Jun 28, 2023
Merged

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Jun 27, 2023

The goal of this PR is to simplify the SpiDma type from

 SpiDma<
    'd,
    SpiInstance,
    ChannelTx<'d, ChannelNTxImpl, ChannelN>,
    ChannelRx<'d, ChannelNRxImpl, ChannelN>,
    SuitablePeripheralN,
    FullDuplexMode,
>

to

 SpiDma<
   'd,
    SpiInstance,
    ChannelN,
    FullDuplexMode,
>

This PR also makes the I2s type ascribe-able by the user. Previously, the list of generics included a private type which has been turned into an associated type now.

I have also removed the example introduced in #623 and changed the s3 embassy-spi example to use SPI3.

@bugadani bugadani force-pushed the channel branch 5 times, most recently from ee88f49 to 3971e96 Compare June 27, 2023 10:44
bugadani added 5 commits June 27, 2023 12:45
This trait is then used to hold types related to the particular DMA channel. This change allows us to simplify user-facing types.
@bugadani bugadani changed the title [WIP] Simplify user-facing DMA channel types Simplify user-facing DMA channel types Jun 27, 2023
@bugadani bugadani marked this pull request as ready for review June 27, 2023 10:45
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, much cleaner!

Closes #381.

@MabezDev MabezDev requested a review from bjoernQ June 27, 2023 14:03
@MabezDev MabezDev merged commit 2371c30 into esp-rs:main Jun 28, 2023
@bugadani bugadani deleted the channel branch June 28, 2023 12:05
@bjoernQ
Copy link
Contributor

bjoernQ commented Jun 28, 2023

Seems I somehow didn't notice this PR ... LGTM

SergioGasquez pushed a commit to SergioGasquez/esp-hal that referenced this pull request Jun 28, 2023
* Introduce a trait for DMA channels

This trait is then used to hold types related to the particular DMA channel. This change allows us to simplify user-facing types.

* Remove private type from I2s

* Remove redundant spi3 example, update examples

* Merge markdown sections

* Add changelog entry
MabezDev pushed a commit that referenced this pull request Jul 12, 2023
* Introduce a trait for DMA channels

This trait is then used to hold types related to the particular DMA channel. This change allows us to simplify user-facing types.

* Remove private type from I2s

* Remove redundant spi3 example, update examples

* Merge markdown sections

* Add changelog entry
playfulFence pushed a commit to playfulFence/esp-hal that referenced this pull request Sep 26, 2023
* Introduce a trait for DMA channels

This trait is then used to hold types related to the particular DMA channel. This change allows us to simplify user-facing types.

* Remove private type from I2s

* Remove redundant spi3 example, update examples

* Merge markdown sections

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants