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-hal
output pin traits forNoPin
(#2019, #2133) - Added
esp_hal::init
to 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) Flex
now implementsWait
. (#2075)- Added sleep and wakeup support for esp32c2 (#1922)
Input
,Output
,OutputOpenDrain
andFlex
now implementPeripheral
. (#2094)- Previously unavailable memory is available via
.dram2_uninit
section (#2079) - You can now use
Input
,Output
,OutputOpenDrain
andFlex
pins as EXTI and RTCIO wakeup sources (#2095) - Added
Rtc::set_current_time
to allow setting RTC time, andRtc::current_time
to 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_freq
andRtcClock::get_slow_freq
publically for all chips (#2183) - TWAI support for ESP32-H2 (#2199)
- Make
DmaDescriptor
methods public (#2237) - Added a way to configure watchdogs in
esp_hal::init
(#2180) - Introduce
DmaRxStreamBuf
(#2242) - Implement
embedded_hal_async::delay::DelayNs
forTIMGx
timers (#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 aconst
function (#1999)Input
,Output
,OutputOpenDrain
andFlex
are now type-erased by default. Use the newnew_typed
constructor to keep using the ZST pin types. (#2075)- To avoid confusion with the
Rtc::current_time
wall clock time APIs, we've renamedesp_hal::time::current_time
toesp_hal::time::now
. (#2091) - Renamed
touch::Continous
totouch::Continuous
. (#2094) - Faster SHA (#2112)
- The (previously undocumented)
ErasedPin
enum has been replaced with theErasedPin
struct. (#2094) - Renamed and merged
Rtc::get_time_us
andRtc::get_time_ms
intoRtc::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
AnyPin
withInputSignal
andOutputSignal
and renamedErasedPin
toAnyPin
(#2128) - Replaced the
ErasedTimer
enum with theAnyTimer
struct. (#2144) Camera
andAesDma
now support erasing the DMA channel type (#2258)- Changed the parameters of
Spi::with_pins
to no longer be optional (#2133) - Renamed
DummyPin
toNoPin
and removed all internal logic from it. (#2133) - The
NO_PIN
constant has been removed. (#2133) - Allow handling interrupts while trying to lock critical section on multi-core chips. (#2197)
- Migrate
Camera
to a move based API (#2242). - Removed the PS-RAM related features, replaced by
quad-psram
/octal-psram
,init_psram
takes a configuration parameter, it's now possible to auto-detect PS-RAM size (#2178) EspTwaiFrame
constructors now accept any type that converts intoesp_hal::twai::Id
(#2207)- Change
DmaTxBuf
to support PSRAM onesp32s3
(#2161) - I2c
transaction
is now also available as a inherent function, lift size limit onwrite
,read
andwrite_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)
I2C
driver 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
write
andread
for 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::transfer
transferring data twice in some cases (#2159) - Fixed UART freezing when using
RcFast
clock 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
wait
has returned before the DMA has finished writing the memory (#2179) - SPI: Fixed an issue where repeated calls to
dma_transfer
may 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_nanos
behaviour (#2256) - Fixed unsoundness around
Efuse
(#2259)
Removed
- Removed
digest::Digest
implementation from SHA (#2049) - Removed
NoPinType
in favour ofDummyPin
. (#2068) - Removed the
async
,embedded-hal-02
,embedded-hal
,embedded-io
,embedded-io-async
, andufmt
features (#2070) - Removed the
GpioN
type aliasses. UseGpioPin<N>
instead. (#2073) - Removed
Peripherals::take
. Useesp_hal::init
to obtainPeripherals
(#1999) - Removed
AnyInputOnlyPin
in 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_pins
UART constructors (#2132) - Removed transfer methods
send
,send_dma
andsend_dma_async
fromI8080
(#2191) - Removed
uart::{DefaultRxPin, DefaultTxPin}
(#2132) - Removed
PcntSource
andPcntInputConfig
. (#2134) - Removed the
place-spi-driver-in-ram
feature, this is now enabled via esp-config (#2156) - Removed
esp_hal::spi::slave::prelude
(#2260) - Removed
esp_hal::spi::slave::WithDmaSpiN
traits (#2260) - The
WithDmaAes
trait has been removed (#2261) - The
I2s::new_i2s1
constructor has been removed (#2261)