From 3227ca978c78e02770bcd627d1ec975bc480e1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Mon, 25 Nov 2024 19:04:59 +0100 Subject: [PATCH] Changelog --- esp-hal/CHANGELOG.md | 6 ++++- esp-hal/MIGRATING-0.22.md | 48 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 9fec3115f3..8e330f0d08 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ESP32-C6, H2, S3: Added `split` function to the `DmaChannel` trait. (#2526) - Added PSRAM configuration to `esp_hal::Config` if `quad-psram` or `octal-psram` is enabled (#2546) - Added `esp_hal::psram::psram_raw_parts` (#2546) +- Added `I8080::apply_config`, `DPI::apply_config` and `Camera::apply_config` (#2610) ### Changed @@ -37,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - PSRAM is now initialized automatically if `quad-psram` or `octal-psram` is enabled (#2546) - DMA channels are now available via the `Peripherals` struct, and have been renamed accordingly. (#2545) - Interrupt handling related functions are only provided for Blocking UART. (#2610) +- Changed how `Spi`, (split or unsplit) `Uart`, `LpUart`, `I8080`, `Camera`, `DPI` and `I2C` drivers are constructed (#2610) +- I8080, camera, DPI: The various standalone configuration options have been merged into `Config` (#2610) ### Fixed @@ -51,7 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `FrozenUnit`, `AnyUnit`, `SpecificUnit`, `SpecificComparator`, `AnyComparator` have been removed from `systimer` (#2576) - `esp_hal::psram::psram_range` (#2546) - The `Dma` structure has been removed. (#2545) -- Remove `embedded-hal 0.2.x` impls and deps from `esp-hal` (#2593) +- Removed `embedded-hal 0.2.x` impls and deps from `esp-hal` (#2593) +- Removed `Camera::set_` functions (#2610) ## [0.22.0] - 2024-11-20 diff --git a/esp-hal/MIGRATING-0.22.md b/esp-hal/MIGRATING-0.22.md index 15cecfe3e9..551b55ebc5 100644 --- a/esp-hal/MIGRATING-0.22.md +++ b/esp-hal/MIGRATING-0.22.md @@ -160,7 +160,7 @@ is enabled. To retrieve the address and size of the initialized external memory, The usage of `esp_alloc::psram_allocator!` remains unchanged. -### embedded-hal 0.2.* is not supported anymore. +## embedded-hal 0.2.* is not supported anymore. As per https://github.com/rust-embedded/embedded-hal/pull/640, our driver no longer implements traits from `embedded-hal 0.2.x`. Analogs of all traits from the above mentioned version are available in `embedded-hal 1.x.x` @@ -184,3 +184,49 @@ Analogs of all traits from the above mentioned version are available in `embedde You might also want to check the full official `embedded-hal` migration guide: https://github.com/rust-embedded/embedded-hal/blob/master/docs/migrating-from-0.2-to-1.0.md + +## Driver constructors now take a configuration and are fallible + +The old `new_with_config` constructor have been removed, and `new` constructors now always take +a configuration structure. They have also been updated to return a `ConfigError` if the configuration +is not compatible with the hardware. + +```diff +-let mut spi = Spi::new_with_config( ++let mut spi = Spi::new( + peripherals.SPI2, + Config { + frequency: 100.kHz(), + mode: SpiMode::Mode0, + ..Config::default() + }, +-); ++) ++.unwrap(); +``` + +```diff + let mut spi = Spi::new( + peripherals.SPI2, ++ Config::default(), +-); ++) ++.unwrap(); +``` + +### LCD_CAM configuration changes + +- `cam` now has a `Config` strurct that contains frequency, bit/byte order, VSync filter options. +- DPI, I8080: `frequency` has been moved into `Config`. + +```diff ++let mut cam_config = cam::Config::default(); ++cam_config.frequency = 1u32.MHz(); + cam::Camera::new( + lcd_cam.cam, + dma_rx_channel, + pins, +- 1u32.MHz(), ++ cam_config, + ) +```