Preparatory i2s refactor (#2316)

* Take self

* Consolidate signal impls

* Remove traits

* Deduplicate impls

* Seal AcceptedWord

* Changelog

* Migration guide

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
This commit is contained in:
Dániel Buga 2024-10-16 15:04:00 +02:00 committed by GitHub
parent 39c0baf2c7
commit 99a579973a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 409 additions and 627 deletions

View File

@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### Removed
- The `i2s::{I2sWrite, I2sWriteDma, I2sRead, I2sReadDma, I2sWriteDmaAsync, I2sReadDmaAsync}` traits have been removed. (#2316)
## [0.21.1] ## [0.21.1]
### Fixed ### Fixed

View File

@ -1 +1,24 @@
# Migration Guide from 0.21.x to v0.22.x # Migration Guide from 0.21.x to v0.22.x
## Removed `i2s` traits
The following traits have been removed:
- `I2sWrite`
- `I2sWriteDma`
- `I2sRead`
- `I2sReadDma`
- `I2sWriteDmaAsync`
- `I2sReadDmaAsync`
You no longer have to import these to access their respective APIs. If you used these traits
in your functions as generic parameters, you can use the `I2s` type directly instead.
For example:
```diff
-fn foo(i2s: &mut impl I2sWrite) {
+fn foo(i2s: &mut I2s<'_, I2S0, Blocking>) {
// ...
}
```

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ use esp_hal::{
dma::{Dma, DmaPriority}, dma::{Dma, DmaPriority},
dma_buffers, dma_buffers,
gpio::Io, gpio::Io,
i2s::{asynch::*, DataFormat, I2s, Standard}, i2s::{DataFormat, I2s, Standard},
prelude::*, prelude::*,
timer::timg::TimerGroup, timer::timg::TimerGroup,
}; };

View File

@ -37,7 +37,7 @@ use esp_hal::{
dma::{Dma, DmaPriority}, dma::{Dma, DmaPriority},
dma_buffers, dma_buffers,
gpio::Io, gpio::Io,
i2s::{asynch::*, DataFormat, I2s, Standard}, i2s::{DataFormat, I2s, Standard},
prelude::*, prelude::*,
timer::timg::TimerGroup, timer::timg::TimerGroup,
}; };

View File

@ -21,7 +21,7 @@ use esp_hal::{
dma::{Dma, DmaPriority}, dma::{Dma, DmaPriority},
dma_buffers, dma_buffers,
gpio::Io, gpio::Io,
i2s::{DataFormat, I2s, I2sReadDma, Standard}, i2s::{DataFormat, I2s, Standard},
prelude::*, prelude::*,
}; };
use esp_println::println; use esp_println::println;

View File

@ -35,7 +35,7 @@ use esp_hal::{
dma::{Dma, DmaPriority}, dma::{Dma, DmaPriority},
dma_buffers, dma_buffers,
gpio::Io, gpio::Io,
i2s::{DataFormat, I2s, I2sWriteDma, Standard}, i2s::{DataFormat, I2s, Standard},
prelude::*, prelude::*,
}; };

View File

@ -14,7 +14,7 @@ use esp_hal::{
dma::{Dma, DmaPriority}, dma::{Dma, DmaPriority},
dma_buffers, dma_buffers,
gpio::{Io, NoPin}, gpio::{Io, NoPin},
i2s::{asynch::*, DataFormat, I2s, I2sReadDma, I2sTx, I2sWriteDma, Standard}, i2s::{DataFormat, I2s, I2sTx, Standard},
peripherals::I2S0, peripherals::I2S0,
prelude::*, prelude::*,
Async, Async,