74 Commits

Author SHA1 Message Date
Juraj Sadel
693b99a7e3
Remove unused deps (#4184) 2025-09-26 07:07:17 +00:00
Kirill Mikhailov
c700b8bda3
Fix RISC-V direct vectoring and re-enable interrupts HIL test (#4171)
* Fix direct vectoring

* WIP global_asm

* resolve reviews

ugh

* Document `enable_direct` function more, remove misc conversion.

fix

* Make instructions stricter
2025-09-25 13:07:10 +00:00
Dániel Buga
f3907af22b
Possibly awful SMP implementation (#4152)
* Test and fix time slicing

* Possibly awful SMP implementation

Co-authored-by: g1ibby <wss.world@gmail.com>

* Remove __esp_radio_builtin_scheduler

---------

Co-authored-by: g1ibby <wss.world@gmail.com>
2025-09-24 08:34:55 +00:00
Dániel Buga
38bd6a5a88
ESP32/I2S: Allow connecting MCLK (#4128)
* Support CLK_OUT on ESP32 I2S

* Enable example

* Remove mclk_signal from ESP32
2025-09-17 10:40:14 +00:00
Dániel Buga
646495eb16
Runtime wifi config options (#4121)
* Turn country code and default power mode into runtime configs

* Move G_CONFIG setup to wifi::new

* Turn most configs into runtime options

* Set core ID to current one

* Mark most options unstable
2025-09-17 08:13:18 +00:00
Dániel Buga
9d596ca752
esp-radio: remove scheduler lifecycle management, remove idle task (#4093)
* Start scheduler on preempt init, remove deinit

* Static-allocate the main task context

* taskless idle

* Remove the need for an idle task
2025-09-15 12:47:39 +00:00
Juraj Sadel
e888f574fb
Update embassy-futures (#4079) 2025-09-08 14:39:42 +00:00
Dániel Buga
91e0cea412
Update embassy, embedded-test (#3945) 2025-09-05 13:51:26 +00:00
Kirill Mikhailov
38fd991ff7
More cleanup in esp-radio (#4040)
* More cleanup in `esp-radio`

* misc

* address reviews

* docs update

* fmt
2025-09-04 14:03:19 +00:00
Juraj Sadel
34b908dc56
Remove wifi_state and split WifiState into WifiStaState and WifiApState (#4046)
* Remove wifi_state adn split WifiState into WifiStaState and WifiApState

* MG

* changelog

* review
2025-09-04 11:28:00 +00:00
Fun Maker
46eed04403
Add Config structure for I2s (#3985)
* Add Config structure for I2s

* Add apply_config for I2sTx/I2sRx
2025-09-04 10:16:49 +00:00
Juraj Sadel
fe0a04517f
General esp-radio cleanup (#4017)
* General esp-radio cleanup

* changelog

* MG

* fix build error

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-09-02 16:48:17 +00:00
Jesse Braham
1ecb6f5f76
Add BLE examples using trouBLE, move some Wi-Fi examples to qa-test (#3999)
* Move `embassy_wifi_bench`, `wifi_bench`, and `wifi_csi` examples to `qa-test` package

* Remove blocking BLE example, replace Embassy example with trouble-based scanner

* Add BLE `bas_peripheral` example
2025-08-28 09:31:37 +00:00
Dominic Fischer
d21e64e9a2
Align I8080 driver pin configurations with latest guidelines (#3997) 2025-08-27 07:46:05 +00:00
Juraj Sadel
90e3907617
update hil-test and qa-test readme to match reworked xtask (#3975) 2025-08-22 11:15:54 +00:00
Juraj Sadel
68345293ed
More consistent naming of interrupt-related functions (#3933)
* More consistent naming of interrupt-related functions

* MG entry

* changelog

* use correct package for MG

* fix hil

* other drivers

* address review comments
2025-08-21 09:46:04 +00:00
Björn Quentin
3c12be8d24
Move exception handler from esp-backtrace to esp-hal (#3887)
* Move exception handler from esp-backtrace to esp-hal

* CHANGELOG.md

* Fix

* Only use defmt compatible display hints

* Workaround xtensa-lx-rt and riscv-rt not implementing defmt::Format

* Add `defmt` feature to xtensa-lx-rt and esp-riscv-rt

* Favor feature gates over random `allow`s - remove unnecessary `allow`s
2025-08-01 07:57:42 +00:00
Björn Quentin
cc2083fd1a
Introduce esp-rom-sys crate (#3688)
* Move ROM function definitions to esp-hal-rom crate

* Patch ESP32 ROM-functions, use it in esp-storage

* Allow placing additional code in IRAM

* esp-storage depends on esp-hal-rom

* Move ROM function wrappers from esp-hal to esp-hal-rom

* Make bootloader-support crate use CRC ROM function

* Minor polishing

* changelogs

* Make CI green

* Define (some) spiflash ROM functions in esp-hal-rom

* Lint

* Avoid duplicate definition of `__assert_func`

* Rename to `esp-rom-sys`

* Mention versioning this crate in the README

* Fixes

* Check self-version

* Docs

* Clippy

* Check if version bump is allowed

* Unconditionally place spiflash ROM function patches (if present) in rwtext

* Cleanup

* Change how unacceptable version bump requests are detected

* Initial version 0.1.0

* Docs

* Use correct version

* Force esp-rom-sys bumps to patch

* Fix
2025-07-01 13:05:01 +00:00
Dániel Buga
3e6b85bf30
Update i2c/spi instance info (#3627)
* Add instances to drivers

* Move AnyI2c

* Move AnySpi and DataMode

* Generate new semver baseline
2025-06-13 13:56:52 +00:00
Björn Quentin
00565c39ed
Improve PSRAM detection (#3554)
* Improve PSRAM detection

* CHANGELOG.md

* Just probe ESP32 PSRAM

* Read device ID workaround

* Exit QIO mode before trying to read the SPI RAM device id

* Last try

* Fix

* Workaround faulty SVD
2025-06-02 13:44:47 +00:00
Renken
631b4aab41
Expose ADC asynchronous functionalities where applicable (#3443)
From a user's perspective, logic based on asynchronous ADC
functionalities using esp-hal v0.23 is no longer possible with
v1.0.0-beta.0. This is due to the fact that asynchronous traits used to
implement the latter are gatekept behind a module, called `asynch`,
accessible only to the esp-hal crate itself. As a result, users cannot
write generic logic that requires the implementation of such traits as
they are currently private.

See https://github.com/esp-rs/esp-hal/discussions/3441 for a concrete
example.

Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
2025-05-27 09:19:14 +00:00
Juraj Sadel
c6437c7a44
Update examples and qa-test to new bootloader (#3541) 2025-05-26 10:37:41 +00:00
Dániel Buga
16897bb68d
Tweak features and dependencies (#3425)
* Group optional dependencies

* Separate version from crate name

* Restore defmt-log mutual exclusivity

* Gate ufmt

* Remove usb-device

* Feature-gate unsable dependencies behind unstable

* S2: assume single core for portable-atomic

* Clean up feature flag docs

* Sack debug

* Fix clippy

* Update examples

* Fix usb-otg feature

* Fix fmt

* Add version to log dep

* Also mark bluetooth private

* Correct changelog/MG

* Clean up esp-hal-embassy

* Clean up ieee802154

* Clean up esp-println

* Move the timestamp function up

* Move info from readme to feature docs

* Clean up esp-storage

* Clean up esp-wifi

* Fix examples

* Add a note for the private features
2025-05-05 11:33:55 +00:00
Dániel Buga
b1f487093b
Update dependencies (#3416) 2025-04-24 13:41:20 +00:00
Dániel Buga
ffbcae162a
Simplify Flex (#3387)
* Simplify Flex

* Rename functions
2025-04-22 12:30:34 +00:00
Kirill Mikhailov
b33b877592
Bump edition to 2024, bump MSRV to 1.85 (#3391)
* inter-state

* inter-state (2)

* warnings fix

* fix warnings

* fmt + changelogs

* another unsafe extern "C" doode

* real fmt now

* MSRV + format

* Ignore unsafe_op_in_unsafe_fn lint for now in esp-hal and esp-wifi

* msrv + fmt

* ugh....

* get lcd_cam example right

* expr_2021 -> expr experiment

* gagagugu

* reviews

* more unneeded unsafes (help)

* finish esp-hal unsafe cleanup

* each unsafe call is marked separately

fmt

* should be good now (?)

* piece was never an option...

* dumb
2025-04-22 10:39:11 +00:00
Dominic Fischer
bfe6a1c689
Tidy up Camera according to latest guidelines (#3375)
* Tidy up `Camera` according to latest guidelines

* fmt

* enum
2025-04-16 09:19:49 +00:00
Juraj Sadel
689c362403
S2 sleep (#3341)
* esp32s3 copy for esp32s2

* idf's rtc_sleep_pd

* Add the new NRX, FE & FE2 peripherals from the PAC

* Went through rtc_sleep_init -> apply

* Add all else statements of idf's rtc_sleep_init and made the style match the cpp code more for easier checking

* Finish checking/copying base_settings

* Checked flags in apply

* Allow base_settings

* Remove unused variables

* Reenable rtc_peri for Ext1WakeupSource

* Correct comment. Probably copy-pasted and still present in esp32s3

* Remove TODO comments

* Add the esp32s2 sleep work to the changelog

* Add esp32s2 to qa-test where applicable

* update pacs and update after rebase

* changelog

* provide missing ROM functions

* Update PACs

* review comments and cleanup

* review

* Fix wrong cfg condition

---------

Co-authored-by: mennovf <mennovanfrachem@hotmail.com>
2025-04-09 09:46:16 +00:00
Dániel Buga
9db968b473
Remove Peripheral/PeripheralRef (#3305)
* Rework GPIOs without Peripheral/PeripheralRef

* Completely remove Peripheral/Ref

* Remove lifetime from DMA Channel structs

* Try to document changes

* Explain reborrow

* Add lifetime to Instance traits, make them public

* Add Trace to changelog

* Remove lifetimes from Instance traits

* Rewrite section about singletons

* Remove unintended doc comment

* Remove inherent degrade

* Fix reiniting esp-wifi

* Add examples to the root-level docs
2025-04-03 10:40:07 +00:00
Dominic Fischer
5cec008506
Refactor I2S driver to take DmaDescriptors later in construction (#3324)
* Refactor I2S driver to take `DmaDescriptor`s later in construction

* unused import

* stray test
2025-04-03 07:53:56 +00:00
Dániel Buga
9d2005841d
Miniscule interrupt handler optimizations (#3282)
* Add QA test for GPIO interrupt handler testing

* Simplify generated interrupt handling

* Ensure interrupt status is bounds-check-free

* Deduplicate default handlers

* S3: Remove dead branch

* Remove an instruction

* Remove interrupt id bounds check

* Invert condition - prioritize interrupt

* Explain QA test

* Update qa-test
2025-03-28 16:28:23 +00:00
Björn Quentin
dc55ef008c
Quality of life improvements (#3279)
* Use a different SCLK pin for QSPI qa-tests on ESP32

* Try to be helpful when building for an unsupported target

* Typo

* Check we are building for the correct target

* Typo, again
2025-03-19 10:24:51 +00:00
Dániel Buga
f2b2d37f24
Various minor SPI fixes (#3201)
* Correctly clear fastrd_mode when data mode is Single

* Print logs in QA test

* Port SPI timing tuning from esp-idf

* Fix ESP32 QSPI signals

* Print the reason of an Unsupported error

* Partial changelog
2025-03-05 10:58:12 +00:00
Dániel Buga
c8822b4f83
Restore multiple-integrated timer queues (#3166) 2025-02-28 13:02:58 +00:00
Björn Quentin
4d075751ae
Minor fixes (#3162) 2025-02-21 10:27:37 +00:00
Dániel Buga
a5bfa3a61d
Disable multiple-integrated timer queue flavour (#3159) 2025-02-21 10:01:05 +00:00
Björn Quentin
90cc8b219c
Fix example (#3155) 2025-02-20 08:05:19 +00:00
Dániel Buga
392d5ccdc1
Unstabilize CPU-related functionality, merge modules (#3099)
* Move Cpu to a new module

* Move cpu_control's contents into cpu

* Merge raw_core functions

* Hide cpu control APIs

* Move reset into cpu

* Fix software_reset_cpu

* Allow inlining cpu functions

* Changelog

* Mark software_reset no-return

* Move WakeupReason

* Remove PeripheralIter

* Move cpu into system

* Mark system stable
2025-02-07 14:15:26 +00:00
Dániel Buga
8c69e8cb51
Newtype fugit Rate, Instant and Duration (#3083)
* Newtype fugit Rate, Instant and Duration

* Document, remove time::now

* Fix perf

* Tweak docs
2025-02-04 17:23:08 +00:00
Dániel Buga
17255ac0ab
Enable async ADC for C2 and H2 (#3082)
* Enable async ADC for H2

* Enable for C2

* Prevent disabling interrupt if an async ADC is in use

* Introduce adc1/2 symbols
2025-02-03 09:41:04 +00:00
Davo
9a28bdfdbd
ADC: Add async support for oneshot reads for esp32c3 and esp32c6 (#2925)
* ADC: Add async support for oneshot reads for esp32c3 and esp32c6

* ADC: change interrupt waking logic

- fix migrating document
- add ADC2 reading qa example and fix sensor reading

* ADC: run `cargo xtask fmt-packages`

* ADC: remove TODO comment
2025-01-31 07:52:47 +00:00
Dániel Buga
af6ee36d93
Ability to precompute/cache config register values (#3011)
* Cache bus clock register and support clock source

* Recalculate eagerly to keep Config Copy

* Destabilize UART clock source

* Update I2C

* Changelog

* Refactor builder lite helpers for more flexibility

* Flatten config structs

* Add getters, hide fields

* Hide all config fields

* Fix changelog

* Document the precomputation
2025-01-30 09:44:52 +00:00
Björn Quentin
bb1ad1485a
I2C: Make non-async fn available in async-mode (#3056)
* I2C: Make non-async fn available in async-mode

* PR number
2025-01-29 13:30:35 +00:00
Dániel Buga
ce750b5fe4
Remove OutputOpenDrain (#3029)
* Remove OutputOpenDrain

* Remove input-related functions from Output

* Fix documentation

* Improve docs
2025-01-27 16:41:58 +00:00
Björn Quentin
f247b4099c
Remove flip-link feature, replace by flip-link option (#3001)
* Fix renamed config options

* Make `flip-link` feature into a config-option

* Remove `psram-quad`/`psram-octal` - replaced by `psram`

* Changelogs

* Fix

* Add `esp_config::Validator::Enumeration`

* Fix HIL-tests

* HIL: use octal psram for the S3

* Fix xtask

* xtask

* examples

* Make `spi-address-workaround` only available on ESP32

* Always allow `cfg(spi_address_workaround)`

* Make config-options valid for all targets
2025-01-23 15:21:46 +00:00
Jesse Braham
4ea6b76f0a
Add configuration structs for GPIO drivers, make constructors fallible (#2990)
* Add configuration structs for GPIO drivers, make constructors fallible

* Update all examples and HIL tests to use new GPIO driver API

* Update migration guide

* Update `CHANGELOG.md`

* Fix errors

* Add `apply_config` functions

* Fixes
2025-01-22 14:20:06 +00:00
Dániel Buga
ae35b465bf
Fix DMA not having data available in time (#3003)
* Fix DMA not having data available in time

* Fix not registering I2S interrupts when only using TX
2025-01-21 20:28:15 +00:00
Dániel Buga
18ef297a47
Remove RtcPin trait impls from Flex (#2938) 2025-01-17 16:41:28 +00:00
Björn Quentin
5f2c0ec5f2
Support 3-wire-SPI (#2919)
* Support 3-wire-SPI

* CHANGELOG.md

* Remove 'Error::ArgumentsInvalid', more docs

* Rebase Fix

* `DataMode::Single` -> `DataMode::FourWire`

* Rename, again

* docs wording

* Honor ESP32

* Have some testing for DataMode::Single

* Mark `with_sio0/1` unstable
2025-01-17 16:34:34 +00:00
Dániel Buga
571760884b
Update our time driver for upcoming embassy changes (#2701)
* Add a timer-driven task

* Spawn another timer

* Log

* foo

* Do not access current time on each schedule

* Update generic queue

* Minimize alarm priorities

* Point to github with patches

* Fix build without any queue impl selected

* Remove explicit generic-queue features

* Define cfgs, fix calling something uninitialized

* Clean up RefCell+generic queue

* Fix arg order

* Feature

* Fix single integrated-timer queue

* Fix next expiration when arming

* Add note

* Adjust impl to latest changes

* Local patch

* Refactor the refactor refactor

* Track the timer item's owner

* Clear owner on dequeue

* Clean up

* Point at the right branch

* Fix panic message

* Hide private function

* Remove integrated-timer references

* Point at upstream embassy

* Configure via esp-config

* Document, clean up, fix

* Hack

* Remove patches

* Update config separator, test the complex variant

* Undo esp-config hack

* Remove trouble example, update edge-net

* Update test deps

* Document

* Update bt-hci.

* Fix generic queue

* Fix panic message

* Fix UB

* Fix rebase

* Resolve UB

* Avoid mutable reference in interrupt executor

---------

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2025-01-14 16:17:58 +00:00