diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 5cb05f8ba0e..e30f448aaa0 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -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 diff --git a/esp-hal/src/i2s/parallel.rs b/esp-hal/src/i2s/parallel.rs index 08467791a19..226499b8152 100644 --- a/esp-hal/src/i2s/parallel.rs +++ b/esp-hal/src/i2s/parallel.rs @@ -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,