Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added

- RMT: All public types now derive `Debug` and `defmt::Format`. (#4302)
- RMT: `Channel::apply_config` has been added. (#4302)

- Added blocking `send_break`, `wait_for_break` and `wait_for_break_with_timeout` for sending and detecting software breaks with the UART driver (#4284)
- Added support for `RxBreakDetected` interrupt and `wait_for_break_async` for detecting software breaks asynchronously to the UART driver (#4284)
- Unsafely expose GPIO pins that are only available on certain chip/module variants (#4520)
- ESP32-H2: light sleep and deep sleep support with timer wakeup source (#4587)
- RMT: Added the `Encoder` trait and `CopyEncoder`, `IterEncoder` and `BytesEncoder` implementations. (#4604)

### Changed

- RMT: `SingleShotTxTransaction` has been renamed to `TxTransaction`. (#4302)
- RMT: `ChannelCreator::configure_tx` and `ChannelCreator::configure_rx` now take the configuration by reference. (#4302)
- RMT: `ChannelCreator::configure_tx` and `ChannelCreator::configure_rx` don't take a pin anymore, instead `Channel::with_pin` has been added. (#4302)
- RMT: Configuration errors have been split out of `rmt::Error` into the new `rmt::ConfigError` enum. (#4494)
- RMT: `Rmt::new()` now returns `Error::UnreachableTargetFrequency` instead of panicking when requesting 0 Hz. (#4509)

- Internal clock configuration rework (#4501)
- RMT: Support for `Into<PulseCode>` and `From<PulseCode>` has been removed from Tx and Rx methods, respectively. Instead, Tx methods now take data as `impl Encoder`. (#4604)

### Fixed

Expand Down
27 changes: 27 additions & 0 deletions esp-hal/MIGRATING-1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,30 @@ Configuration methods
now return `ConfigError` instead of `Error`.
Corresponding enum variants have been removed from `Error`, and some variants
that are now part of `ConfigError` have been renamed.

### RMT data type changes

Support for `Into<PulseCode>` and `From<PulseCode>` has been removed from Tx and Rx methods, respectively.

For Rx methods, you need to provide a `PulseCode` buffer now:

```diff
-let mut data: [u32; 8] = [0u32; 8];
+let mut data: [PulseCode; 8] = [PulseCode::default(); 8];
rx_channel.receive(&mut data);
```

For Tx methods, data types now need to implement the `Encoder` trait.
Transmitting slices of `PulseCode` is possible via the provided `CopyEncoder`
type, but more sophisticated implementations are possible:

```diff
let data: [PulseCode; 2] = [
PulseCode::new(Level::High, 42, Level::Low, 24),
PulseCode::end_marker(),
];
-tx_channel.transmit(&data)?;
+let mut encoder = CopyEncoder::new(&data);
+tx_channel.transmit(&mut encoder)?;
```

Loading
Loading