-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RMT: Implement builder-lite for {Rx|Tx}ChannelConfig (#2978)
- Loading branch information
1 parent
0120cb3
commit 81382ba
Showing
5 changed files
with
44 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Migration Guide from v0.23.x to v?.??.? | ||
|
||
## RMT changes | ||
|
||
The `TxChannelConfig` and `RxChannelConfig` structs now support the builder-lite pattern. | ||
Thus, explicit initialization of all fields can be replaced by only the necessary setter methods: | ||
|
||
```diff | ||
let mut channel = rmt | ||
.channel0 | ||
.configure( | ||
peripherals.GPIO1, | ||
- TxChannelConfig { | ||
- clk_divider: 1, | ||
- idle_output_level: false, | ||
- idle_output: false, | ||
- carrier_modulation: false, | ||
- carrier_high: 1, | ||
- carrier_low: 1, | ||
- carrier_level: false, | ||
- }, | ||
+ TxChannelConfig::default().with_clk_divider(1) | ||
) | ||
.unwrap(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters