0.21.0
Please note that only changes to the esp-hal package are tracked in these release notes.
Migration Guides
esp-hal: https://github.com/esp-rs/esp-hal/blob/v0.21.0/esp-hal/MIGRATING-0.20.mdesp-hal-embassy: https://github.com/esp-rs/esp-hal/blob/v0.21.0/esp-hal-embassy/MIGRATING-0.3.mdesp-wifi: https://github.com/esp-rs/esp-hal/blob/v0.21.0/esp-wifi/MIGRATING-0.9.md
Changelog
Added
- Introduce traits for the DMA buffer objects (#1976, #2213)
- Implement
embedded-haloutput pin traits forNoPin(#2019, #2133) - Added
esp_hal::initto simplify HAL initialisation (#1970, #1999) - Added GpioPin::degrade to create ErasePins easily. Same for AnyPin by accident. (#2075)
- Added missing functions to
Flex:unlisten,is_interrupt_set,wakeup_enable,wait_for_high,wait_for_low,wait_for_rising_edge,wait_for_falling_edge,wait_for_any_edge. (#2075) Flexnow implementsWait. (#2075)- Added sleep and wakeup support for esp32c2 (#1922)
Input,Output,OutputOpenDrainandFlexnow implementPeripheral. (#2094)- Previously unavailable memory is available via
.dram2_uninitsection (#2079) - You can now use
Input,Output,OutputOpenDrainandFlexpins as EXTI and RTCIO wakeup sources (#2095) - Added
Rtc::set_current_timeto allow setting RTC time, andRtc::current_timeto getting RTC time while taking into account boot time (#1883) - Added APIs to allow connecting signals through the GPIO matrix. (#2128)
- Allow I8080 transfers to be cancelled on the spot (#2191)
- Implement
TryFrom<u32>forledc::timer::config::Duty(#1984) - Expose
RtcClock::get_xtal_freqandRtcClock::get_slow_freqpublically for all chips (#2183) - TWAI support for ESP32-H2 (#2199)
- Make
DmaDescriptormethods public (#2237) - Added a way to configure watchdogs in
esp_hal::init(#2180) - Introduce
DmaRxStreamBuf(#2242) - Implement
embedded_hal_async::delay::DelayNsforTIMGxtimers (#2084) - Added
Efuse::read_bit(#2259) - Limited SPI slave support for ESP32 (Modes 1 and 3 only) (#2278)
- Added
Rtc::disable_rom_message_printing(S3 and H2 only) (#2280) - Added
esp_hal::time::{Duration, Instant}(#2304)
Changed
- Bump MSRV to 1.79.0 (#1971)
- Make saving and restoring SHA digest state an explicit operation (#2049)
- Reordered RX-TX pairs in all APIs to be consistent (#2074)
- Make saving and restoring SHA digest state an explicit operation (#2049)
Delay::new()is now aconstfunction (#1999)Input,Output,OutputOpenDrainandFlexare now type-erased by default. Use the newnew_typedconstructor to keep using the ZST pin types. (#2075)- To avoid confusion with the
Rtc::current_timewall clock time APIs, we've renamedesp_hal::time::current_timetoesp_hal::time::now. (#2091) - Renamed
touch::Continoustotouch::Continuous. (#2094) - Faster SHA (#2112)
- The (previously undocumented)
ErasedPinenum has been replaced with theErasedPinstruct. (#2094) - Renamed and merged
Rtc::get_time_usandRtc::get_time_msintoRtc::time_since_boot(#1883) - ESP32: Added support for touch sensing on GPIO32 and 33 (#2109)
- Removed gpio pin generics from I8080 driver type. (#2171)
- I8080 driver now decides bus width at transfer time rather than construction time. (#2171)
- Migrate the I8080 driver to a move based API (#2191)
- Replaced
AnyPinwithInputSignalandOutputSignaland renamedErasedPintoAnyPin(#2128) - Replaced the
ErasedTimerenum with theAnyTimerstruct. (#2144) CameraandAesDmanow support erasing the DMA channel type (#2258)- Changed the parameters of
Spi::with_pinsto no longer be optional (#2133) - Renamed
DummyPintoNoPinand removed all internal logic from it. (#2133) - The
NO_PINconstant has been removed. (#2133) - Allow handling interrupts while trying to lock critical section on multi-core chips. (#2197)
- Migrate
Camerato a move based API (#2242). - Removed the PS-RAM related features, replaced by
quad-psram/octal-psram,init_psramtakes a configuration parameter, it's now possible to auto-detect PS-RAM size (#2178) EspTwaiFrameconstructors now accept any type that converts intoesp_hal::twai::Id(#2207)- Change
DmaTxBufto support PSRAM onesp32s3(#2161) - I2c
transactionis now also available as a inherent function, lift size limit onwrite,readandwrite_read(#2262) - SPI transactions are now cancelled if the transfer object (or async Future) is dropped. (#2216)
- The DMA channel types have been removed from peripherals (#2261)
I2Cdriver renamed toI2c(#2320)
Fixed
- SHA driver can now be safely used in multiple contexts concurrently (#2049)
- Fixed an issue with DMA transfers potentially not waking up the correct async task (#2065)
- Fixed an issue with LCD_CAM i8080 where it would send double the clocks in 16bit mode (#2085)
- Fix i2c embedded-hal transaction (#2028)
- Fix some inconsistencies in DMA interrupt bits (#2169)
- Fix SPI DMA alternating
writeandreadfor ESP32 and ESP32-S2 (#2131) - Fix I2C ending up in a state when only re-creating the peripheral makes it useable again (#2141)
- Fix
SpiBus::transfertransferring data twice in some cases (#2159) - Fixed UART freezing when using
RcFastclock source on ESP32-C2/C3 (#2170) - I2S: on ESP32 and ESP32-S2 data is now output to the right (WS=1) channel first. (#2194)
- SPI: Fixed an issue where unexpected data was written outside of the read buffer (#2179)
- SPI: Fixed an issue where
waithas returned before the DMA has finished writing the memory (#2179) - SPI: Fixed an issue where repeated calls to
dma_transfermay end up looping indefinitely (#2179) - SPI: Fixed an issue that prevented correctly reading the first byte in a transaction (#2179)
- SPI: ESP32: Send address with correct data mode even when no data is sent. (#2231)
- SPI: ESP32: Allow using QSPI mode on SPI3. (#2245)
- PARL_IO: Fixed an issue that caused garbage to be output at the start of some requests (#2211)
- TWAI on ESP32 (#2207)
- TWAI should no longer panic when receiving a non-compliant frame (#2255)
- OneShotTimer: fixed
delay_nanosbehaviour (#2256) - Fixed unsoundness around
Efuse(#2259)
Removed
- Removed
digest::Digestimplementation from SHA (#2049) - Removed
NoPinTypein favour ofDummyPin. (#2068) - Removed the
async,embedded-hal-02,embedded-hal,embedded-io,embedded-io-async, andufmtfeatures (#2070) - Removed the
GpioNtype aliasses. UseGpioPin<N>instead. (#2073) - Removed
Peripherals::take. Useesp_hal::initto obtainPeripherals(#1999) - Removed
AnyInputOnlyPinin favour ofAnyPin. (#2071) - Removed the following functions from
GpioPin:is_high,is_low,set_high,set_low,set_state,is_set_high,is_set_low,toggle. (#2094) - Removed
Rtc::get_time_raw(#1883) - Removed
_with_default_pinsUART constructors (#2132) - Removed transfer methods
send,send_dmaandsend_dma_asyncfromI8080(#2191) - Removed
uart::{DefaultRxPin, DefaultTxPin}(#2132) - Removed
PcntSourceandPcntInputConfig. (#2134) - Removed the
place-spi-driver-in-ramfeature, this is now enabled via esp-config (#2156) - Removed
esp_hal::spi::slave::prelude(#2260) - Removed
esp_hal::spi::slave::WithDmaSpiNtraits (#2260) - The
WithDmaAestrait has been removed (#2261) - The
I2s::new_i2s1constructor has been removed (#2261)