Skip to content

Commit

Permalink
Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Jan 23, 2025
1 parent 7ca6790 commit 1656e54
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
2 changes: 2 additions & 0 deletions esp-hal-procmacros/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added `#[builder_lite_into]` attribute that generates the setter with `impl Into<T>` parameter (#2897)

### Changed

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- GPIO drivers now take configuration structs, and their constructors are fallible (#2990)

- SPI and I2C `Config::frequency` has been replaced by `clock`. (#3011)
- SPI `Config::frequency` has been replaced by `clock`. (#3011)
- SPI `Config::with_frequency` has been renamed to `with_clock`. (#3011)

### Fixed
Expand All @@ -46,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Removed `Pin`, `RtcPin` and `RtcPinWithResistors` implementations from `Flex` (#2938)

- `clock_source` form `uart::Config` (#3011)

## [0.23.1] - 2025-01-15

### Fixed
Expand Down
56 changes: 55 additions & 1 deletion esp-hal/MIGRATING-0.23.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,32 @@ e.g.
+ uart.read_bytes(&mut byte);
```

### Changes to UART baud rate/clock source configuration

UART baud rate and clock source configuration have now been grouped together in a `BaudRateConfig`
struct. This struct implements `From<u32>`, which means if you haven't configured a clock source
previously, you don't need to make changes to your code.

The clock source configuration is now unstable, and the unstable option can be used
by making the following code changes:

```diff
+use esp_hal::uart::BaudRateConfig;
let mut uart = Uart::new(
peripherals.UART0,
Config::default()
- .with_clock_source(clock_source),
.with_baudrate(
- baud_rate,
+ BaudRateConfig::default()
+ .with_baudrate(baudrate)
+ .with_clock_source(clock_source),
+ ),
)
.unwrap();
```


## `timer::wait` is now blocking

```diff
Expand All @@ -128,6 +154,33 @@ Use `DataMode::SingleTwoDataLines` to get the previous behavior.

`Spi` now offers both, `with_mosi` and `with_sio0`. Consider using `with_sio` for half-duplex SPI except for [DataMode::SingleTwoDataLines] or for a mixed-bus.

### SPI master driver configuration

SPI `Config::with_frequency` has been renamed to `with_clock`. This function now takes either
a `fugit::HertzU32` or `BusClockConfig`.

```diff
let config = Config::default()
- .with_frequency(10.MHz());
+ .with_clock(10.MHz());
```

The new structure supports configuring a clock source, although currently only `ClockSource::Apb`
is available.

## I2C changes

### I2C master driver configuration

SPI `Config::with_frequency` has been renamed to `with_clock`. This function now takes either
a `fugit::HertzU32` or `BusClockConfig`.

```diff
let config = Config::default()
- .with_frequency(100.kHz());
+ .with_clock(100.kHz());
```

## UART halves have their configuration split too

`Uart::Config` structure now contains separate `RxConfig` and `TxConfig`:
Expand All @@ -153,4 +206,5 @@ GPIO drivers now take configuration structs, and their constructors are fallible
+ OutputOpenDrain::new(
+ peripherals.GPIO0,
+ OutputOpenDrainConfig::default().with_level(Level::Low).with_pull(Pull::Up)
+ ).unwrap();
+ ).unwrap();
```

0 comments on commit 1656e54

Please sign in to comment.