Skip to content

Commit

Permalink
Update migration guides for esp-hal and esp-wifi
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed Nov 13, 2024
1 parent abb0687 commit 8566abe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion esp-hal/MIGRATING-0.21.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ You can now use the `UartInterrupt` enum and the corresponding `listen`, `unlist
Use `interrupts` in place of `<INTERRUPT>_interrupt_set` and `clear_interrupts` in place of the old `reset_` functions.

`UartInterrupt`:

- `AtCmd`
- `TxDone`
- `RxFifoFull`
Expand Down Expand Up @@ -359,6 +360,7 @@ refer to the `Config` struct as `uart::Config`.
## I8080 driver split `set_byte_order()` into `set_8bits_order()` and `set_byte_order()`.

If you were using an 8-bit bus.

```diff
- i8080.set_byte_order(ByteOrder::default());
+ i8080.set_8bits_order(ByteOrder::default());
Expand All @@ -369,7 +371,6 @@ If you were using an 16-bit bus, you don't need to change anything, `set_byte_or
If you were sharing the bus between an 8-bit and 16-bit device, you will have to call the corresponding method when
you switch between devices. Be sure to read the documentation of the new methods.


## `rmt::Channel::transmit` now returns `Result`, `PulseCode` is now `u32`

When trying to send a one-shot transmission will fail if it doesn't end with an end-marker.
Expand Down Expand Up @@ -412,3 +413,9 @@ You can use `gpio::NoPin` instead.
+let mut rx_clk_pin = NoPin;
+parl_io.rx.with_config(&mut rx_pins, &mut rx_clk_pin, BitPackOrder::Msb, Some(0xfff))
```

## `get_` prefixes have been removed from functions

In order to better comply with the Rust API Guidelines [getter names convention], we have removed the `get_` prefixes from all functions which previously had it. Due to the number of changes it's not practical to list all changes here, however if a function previous began with `get_`, you can simply remove this prefix.

[getter names convention]: https://rust-lang.github.io/api-guidelines/naming.html#c-getter
8 changes: 7 additions & 1 deletion esp-wifi/MIGRATING-0.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use esp_wifi::{
+ let mut rng = Rng::new(peripherals.RNG);
- let init = init(timg0.timer0, rng, peripherals.RADIO_CLK).unwrap();
+ let init = init(timg0.timer0, rng.clone(), peripherals.RADIO_CLK).unwrap();

let mut wifi = peripherals.WIFI;
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
+ let (iface, device, mut controller) =
Expand All @@ -76,3 +76,9 @@ use esp_wifi::{
```

The related features are removed from `esp-wifi`: wifi-default, ipv6, ipv4, tcp, udp, icmp, igmp, dns, dhcpv4

## `get_` prefixes have been removed from functions

In order to better comply with the Rust API Guidelines [getter names convention], we have removed the `get_` prefixes from all functions which previously had it. Due to the number of changes it's not practical to list all changes here, however if a function previous began with `get_`, you can simply remove this prefix.

[getter names convention]: https://rust-lang.github.io/api-guidelines/naming.html#c-getter

0 comments on commit 8566abe

Please sign in to comment.