331 Commits

Author SHA1 Message Date
Simon Fondrie-Teitler
a5d7c11c34
Fix example running commands (#3543) 2025-05-23 22:01:14 +00:00
James Sizeland
dcd55a0ab6
Update wifi_embassy_ble.rs (#3539)
* Update wifi_embassy_ble.rs

add reference link to trouble as an easier signpost than duplicating examples here.

* add changelog entry for trouble reference

* add PR ref

* remove changelog ref
2025-05-23 13:02:12 +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
cb4b09fb62
Rework GPIO matrix impl (#3395)
* WIP

* Clean up init_gpio

* Expand docs a bit

* Remove Input/OutputConnection

* Not everything has PCNT and it's not important for the example

* Remove Frozen, enable input when creating the signal

* Hide fields, add getters

* Update MG

* Add force GPIO matrix fns

* Fix formatting

* Mention latency in the docs

* Rename number to gpio_number

* Deduplicate pin setup code

* Reword associated peripheral

* Rename with_inverted_input/output

* Remove link to doc-hidden OutputSignal

* Fix link syntax
2025-04-25 10:33:29 +00:00
Björn Quentin
11ff06a368
Fix esp32 coex (#3403)
* Make sure to enable relevant interrupts

* Fix more

* Make `current_runlevel` public

* Check that interrupts are enabled when initializing

* Try to be more honest in `is_in_isr`

* Adjust log levels

* Really fix ESP32 COEX

* Improve COEX example

* fmt

* CHANGELOG

* CHANGELOG

* Clarify on `esp_bt_controller_config_t`

* Take INTENABLE into account

* Test esp-wifi init fails

* Simplify test code

* Clarify comment

* fmt

* Rename

* Adapt the test

* Revert unrelated changes (esp_bt_controller_config_t)

* Align Xtensa (current_runlevel)

* Additional test

* Change test
2025-04-24 11:39:07 +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
7b4b41c0ed
Add DMA memcpy support to the S2 (#3352)
* Expose CopyDmaChannel

* Add DMA memcpy support to the S2

* whoops, esp32 is a thing

* clear can be a no-op

* sigh

* rust

* enable the DMA channel

* The S2 wants RX first...

* fmt
2025-04-09 13:57:15 +00:00
Dániel Buga
0a4089b4d3
Refactor GPIO pin types (#3349) 2025-04-09 08:20:37 +00:00
Dominic Fischer
96daf998c8
Migrate DMA memcpy driver to newer DMA API (#3329)
* Migrate DMA memcpy driver to newer DMA API

* remove irrelevant HIL test

* Relax descriptor lifetime
2025-04-08 08:10:32 +00:00
Björn Quentin
fecd592d57
Basic read partition table functionality, partition "views" (#3316)
* Basic read partition table functionality, partition "views"

* CHANGELOG.md

* Check changelog

* derive defmt

* impl nor-flash

* fmt

* Review comments

* Fix

* Fix

* CI check

* Less unwrap, more tests

* add `fmt.rs`

* Simplify

* Update `fmt.rs`

* (Hopefully) last polishing
2025-04-03 15:19:20 +00:00
Björn Quentin
4f4e063c7a
Remove heapless from esp-wifi (#3317)
* Remove heapless from esp-wifi

* CHANGELOG.md

* defmt

* More defmt derives

* Use new scan API

* Simplify scan result

* Update migration guide

* Back again

* Review comments

* Validate

* Address review comments
2025-04-03 13:33:46 +00:00
Dominic Fischer
4c3c4253ed
Migrate SPI Slave to new DMA API (#3326)
* Migrate SPI Slave to new DMA API

* fix bad merge
2025-04-03 11:30:55 +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
Juraj Sadel
dca82d60b1
fix wifi_embassy_access_point example, use interfaces.ap instead of interfaces.sta (#3321) 2025-04-02 09:52:38 +00:00
Björn Quentin
cbdaeb648d
esp-wifi: Move esp-now and sniffer into Interfaces (#3283)
* esp-now interface

* sniffer is now a "wifi-interface"

* Remove Drop from EspNowManager

* Fix

* CHANGELOG.md

* Fix

* Don't silently fallback to EspNowWifiInterface::Sta
2025-03-24 13:02:56 +00:00
David Laban
7a6d381e19
Make wifi_embassy_access_point_with_sta example listen on both network addresses (#3121)
* Make wifi_embassy_access_point_with_sta listen on both network addresses

* turns out it does work on esp32s2

* update example instructions

* whitespace
2025-02-20 09:35:38 +00:00
Dániel Buga
ff2a46dbc8
UART: make async operations cancellation-safe, update others for consistency (#3142)
* Make async operations cancellable

* Handle thresholds

* Fix written amount calculation

* Fix waiting for events

* Don't return 0 bytes, don't modify TX threshold

* Add read_exact implementation

* Fix tests

* Add tests

* Inline constant into the default values

* Make FIFO config stable

* Fix doc links

* Changelog

* Remove duplicate changelog entries

* Check for RX error

* Fix write_async not recalculating available space

* Fix ESP32 timeout loop

* Check the unmasked interrupt bits to actually detect errors

* Improve naming

* Change async handler to not clear interrupt status

* Test and fix case where write_async returned Ok(0)

* Tweak docs

* Address review feedback

* Use embedded_io to fill buffer in test

* Rename
2025-02-20 08:19:55 +00:00
Scott Mabin
07463bfabf
unstabilize Uart::split, globally remove _bytes postfix (#3137)
* unstabilize split, remove unneeded bounds

* remove _byte postfixes, make uart::flush fallible (inline with the async variant), unify read/write logic for inherent impls and trait impls

* fix tests

* changelog and migration

* put trait dm bound on driver structs

* changelog again

* fixups

* fixups

* fix uart tests

* small docs update

* small docs update

* test fix

* rebase fixup
2025-02-17 12:58:04 +00:00
Björn Quentin
0138d462b7
Rethink WiFi API (#3027)
* Rethink WiFi API

* Fix
2025-02-14 10:02:35 +00:00
Dániel Buga
1e58278a6a
Remove redundant macro syntax (#3135) 2025-02-14 08:04:07 +00:00
Björn Quentin
68c660f1c5
CI optimizations (#3129)
* CI Improvements

* Fix

* Lint with stable

* Fix

* Xtensa

* cleanup
2025-02-13 15:20:10 +00:00
Easyoakland
d1fd24fc32
fix #3051: pass attributes through heap_allocator macro (#3133)
* pass attributes through heap_allocator macro

* Update changelog

* use global path in macro

* fix typo.

use 64*1024B of dram2_uninit not 72

* Fix doc example

* Add PR number to changelog
2025-02-13 09:24:01 +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
Björn Quentin
9a34d0e931
Allow set_power_saving even for coex (#3081)
* Allow `set_power_saving` even for coex

* CHANGELOG.md

* Remove useless migration guide entry
2025-02-03 09:08:11 +00:00
Juraj Sadel
e513f1ba8a
Use #[instability::unstable] where possible, cleanup and improve consistency (#3055)
* Use #[instability::unstable] where possible, cleanup and improve consistency

* De-duplicate marking SpiDma as unstable

* Remove #[unstable] from private structs, functions and inherent impl blocks, address review comments

* Don't mark uWrite as unstable

* API guidelines entry

* mark uWrite unstable again

* Make SetConfig and InterruptConfigurable consistent and add inherent set_interrupt_handler functions vol.2

* warnings
2025-01-30 16:40:14 +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
e5836ae52a
Better not block in 802.15.4 sniffer (#3044) 2025-01-27 15:55:46 +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
Dániel Buga
e842ec4c6c
Slight GPIO cleanup, un-stabilize Io (#3021)
* Clean up, add fixme

* Destabilize Io, add inherent set_interrupt_handler

* Explicitly mark functions, not the impl block
2025-01-23 15:02:11 +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
Kirill Mikhailov
67c9159176
Add separate config for Rx and Tx (UART) (#2965)
* wip

* wip2

* derive Default for Config and TxConfig

* Roll back changes related to SharedConfig

* fmt

* sure

* Changelog + migration guide entry

* `tx.apply_config(&TxConfig)` -> `tx.apply_config(&Config)`

 to be consistent

* address review

* Reflect the removal of the rx prefix in migration guide

* reviews + rebase
2025-01-22 09:58:29 +00:00
Kirill Mikhailov
3cb90cba62
UART documentation fixes (#2996)
* UART documentation fixes

* reviews

* sure

* reviews
2025-01-21 17:23:15 +00:00
Björn Quentin
5d0145eca9
esp-wifi: Late enable BT interrupts (#2981)
* Enable BT interrupts AFTER setting the callback

* Reduce logging level

* Use published `edge-*` crates

* CHANGELOG.md
2025-01-17 15:45:26 +00:00
Benedikt
2105ba0f81
RMT: Use gpio::Level for carrier and pulse levels (#2989)
* rmt: Use gpio::Level instead of bool to specify output levels

* rmt: Use gpio::Level for PulseCode::level{1|2}
2025-01-17 11:58:34 +00:00
Benedikt
81382bafc7
RMT: Implement builder-lite for {Rx|Tx}ChannelConfig (#2978) 2025-01-16 17:48:22 +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
Kirill Mikhailov
398555ee73
Avoid public API changes due to config options. (#2945)
* csi_enable: from option to feature

* fix

* enable feature for example

* migration guide update

* changelog entry

* address reviews
2025-01-14 09:53:45 +00:00
Björn Quentin
732c442c24
Main macro (#2941)
* Re-organize code

* Update dependencies

* Introduce `esp_hal::main` macro

* Migration Guide

* CHANGELOG.md

* Move around

* Remove redundant features, improve error message

---------

Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
2025-01-13 17:08:47 +00:00
Dániel Buga
8c48c74039
Make Uart::read_bytes blocking (#2935) 2025-01-13 14:44:45 +00:00
Juraj Sadel
03ea4f6c90
Remove the single byte read/write inherent functions (#2915)
* SPI: remove read/write_byte functions

* UART: make read/write_byte functions private

* changelog

* migration guide

* fix ieee802154_sniffer example

* review comments and cleanup

* use variable name buf instead of buff

* add pub fn read_bytes

* migration guide update

* another migration guide update

* improve docs of read/write_bytes
2025-01-10 14:36:24 +00:00
Kirill Mikhailov
8d948ba017
Mark unstable modules, make macros private (#2900)
* Mark unstable APIs + make `macros` private

* address reviews

* use `instability` instead of feature

* fix dependencies

* More tagging

* `Persistable` and `procmacros` - unstable

* Adjust for changes

* sure...
2025-01-10 14:32:34 +00:00
Juraj Sadel
8a7f8361a6
UART: Move RX/TX pin assignment from constructor to builder functions (#2904)
* Add with_rx() and with_tx() methods to UART drivers

* changelog

* migration guide

* forgotten tests

* fmt

* fix H2 example

* Use the same calling order of calling TX and RX as before
2025-01-08 16:35:22 +00:00
Jesse Braham
bb406cec6b
Fix naming violations for spi::Mode enum variants (#2902)
* Fix naming violations for `spi::Mode`

* Update migration guide

* Update `CHANGELOG.md`
2025-01-07 15:55:19 +00:00
Dániel Buga
337b3cc6b7
Use _CONFIG_ to separate config prefix and key (#2848)
* Use two underscores to separate prefix

* Change separator to _CONFIG_

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2025-01-03 14:36:30 +00:00
Dániel Buga
1f929af377
Remove redundant config setters (#2847)
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2025-01-02 09:55:37 +00:00
Anthony Grondin
0f384992cf
Update smoltcp to 0.12.0 and embassy-net to 0.5.0 (#2849)
* chore: Update smoltcp to `0.12.0` and embassy-net to `0.5.0`

* Add CHANGELOG entry

* Remove `wifi_dhcp_smoltcp_nal.rs` example

`smoltcp-nal`, a core dependency on which this example depends on doesn't receive the desired amount of maintainability needed to keep up to date with new dependencies releases.
2025-01-02 09:41:31 +00:00
Kirill Mikhailov
62c72947dd
Multiple API fixes in UART driver (#2851)
* Close a number of issues

doctest update

fmt

* changelog entry

* dumb

* addressing reviews

* Add an entry to migration guide
2024-12-20 14:01:11 +00:00
Dániel Buga
7f8af8a651
Remove prelude (#2845)
* Remove prelude

* Changelog
2024-12-20 10:24:57 +00:00
Sergio Gasquez Arcos
d4386adfc7
Rename Spi enums (#2828)
* feat: Rename Spi enums

* docs: Update changelog

* feat: Rename crate::Mode to crate::DriverMode

* docs: Udpate changelog

* feat: Rename DM type parameter to Dm for ECC

* style: rustfmt

* feat: Rename crate::Mode to crate::DriverMode
2024-12-19 08:41:59 +00:00