Skip to content

Commit

Permalink
i2s: fix pin offset for 8bit parallel on i2s1 (#2886)
Browse files Browse the repository at this point in the history
* i2s: fix pin offset for 8bit parallel on i2s1

* i2s: fix pin offset for 8bit parallel on i2s1

* changelog

* changelog

* fix changelog
  • Loading branch information
liebman authored Jan 17, 2025
1 parent e150a53 commit da7dda3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- It is no longer possible to safely conjure `GpioPin` instances (#2688)
- UART: Public API follows `C-WORD_ORDER` Rust API standard (`VerbObject` order) (#2851)
- `DmaRxStreamBuf` now correctly resets the descriptors the next time it's used (#2890)
- i2s: fix pin offset logic for parallel output on i2s1 (#2886)

### Removed

Expand Down
7 changes: 4 additions & 3 deletions esp-hal/src/i2s/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,10 @@ impl Instance for I2S1 {
bits
);

// signals for 8bit and 16bit both start at an offset of 8 for I2S1
// https://github.com/espressif/esp-idf/blob/9106c43accd9f5e75379f62f12597677213f5023/components/esp_lcd/i80/esp_lcd_panel_io_i2s.c#L701
match i + 8 {
// signals for 8bit start at an offset of 8 for 16bit on I2S1
let pin_offset = if bits == 16 { 8 } else { 0 };

match i + pin_offset {
0 => OutputSignal::I2S1O_DATA_0,
1 => OutputSignal::I2S1O_DATA_1,
2 => OutputSignal::I2S1O_DATA_2,
Expand Down

0 comments on commit da7dda3

Please sign in to comment.