125 Commits

Author SHA1 Message Date
Jesse Braham
59a2c17a52
New package releases (#2959)
* Fix some styling issues in top-level README.md

* Update package dependencies and bump version numbers

* Update each `CHANGELOG.md` file for packages to be published

* Update `esp-hal` migration guide

* Fix typo in `esp-hal` changelog
2025-01-15 11:37:36 +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
Jesse Braham
e6c38c59b7
Bump MSRV of all packages to 1.84, add MSRV policy to each README.md (#2951)
* Various top-level `README.md` updates

* Set MSRV to 1.84.0 for all packages

* Add MSRV policy to each `README.md`

* Update each `CHANGELOG.md`
2025-01-14 11:01:28 +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
7d7ce279d1
De-allocate memory used by timers on removal (#2936)
* De-alocate memory used by timers on removal

* CHANGELOG.md
2025-01-13 08:28:19 +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
Dániel Buga
0ef00206d5
Remove all instance type params (#2907) 2025-01-09 11:27:48 +00:00
Björn Quentin
6b4312fb90
Use own implementation instead of ROM functions, re-add memchr (#2896)
* Use own implementation instead of ROM functions, re-add memchr ROM function

* CHANGELOG.md

* Improve

* Cast
2025-01-08 07:12:04 +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
19eb7728bb
Allow clippy to break API, ignore a few initialism errors (#2840) 2025-01-03 14:13:07 +00:00
Björn Quentin
551386216e
Mention performance considerations (#2881) 2025-01-03 12:34:52 +00:00
Sergio Gasquez Arcos
06a15807e3
Fix C-METADATA violations (#2874)
* fix: C-METADATA violations of esp-hal

* feat: Normalize keyword and categories for most of the pacakges
2025-01-02 09:44:27 +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
Dániel Buga
7f8af8a651
Remove prelude (#2845)
* Remove prelude

* Changelog
2024-12-20 10:24:57 +00:00
Dániel Buga
f2b958b501
Convert into c_char (#2837) 2024-12-18 18:59:28 +00:00
Scott Mabin
78c63a7a0f
fix link to esp-wifi self hosted docs (#2836) 2024-12-18 14:43:38 +00:00
Juraj Sadel
d9f1e9a53f
Rename DM type parameter to Dm (#2821)
* Rename DM type parameter to Dm

* Rename M, DmaMode, MODE type parameters to Dm

* fmt
2024-12-17 16:49:23 +00:00
Scott Mabin
85d30e9816
Updates for Xtensa enabled 1.83 compiler (#2615)
* test ci

* fix ci with new compiler

* god bless clippy fix

* refmuts

* clippy

* tests work

* use new compiler

* use new compiler

* bump MSRV of esp-hal and crates that depend on esp-hal

* fix eyesore

* clippy again

* remove hardcoded compiler version

* bump rust-version as well

* note MSRV bump in changelog
2024-12-17 15:02:03 +00:00
Dániel Buga
a12e7fece1
Fix WIFI_EVENT (#2817)
* Fix WIFI_EVENT

* Update esp-wifi/src/common_adapter/mod.rs

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2024-12-16 11:53:45 +00:00
Dániel Buga
bc0bedd628
Add priority-limited locks (#2684)
* Add priority-limited locks

* Rename to RawMutex, only provide lock() publicly

* Explode implementation and move into the interrupt module
2024-12-16 08:39:42 +00:00
Juraj Sadel
3a03dd88c7
Prefer line comments // over block comments /* */ (#2738)
* Prefer line comments // over block comments /* */

* esp-wifi: Prefer line comments // over block comments /* */

* Mention in our API guideline that // should be prefered over /* */
2024-12-12 15:53:38 +00:00
Dániel Buga
5135965116
Hide most of the unstable peripherals (#2667)
* Hide most of the unstable peripherals

* Lint with correct toolchain, lint with unstable enabled

* Require unstable feature and lint using it

* Auto-lint xtensas with esp toolchain

* Fix msrv and ieee802154

* Add feature to examples

* Don't require building ieee802154 for all examples

* Mark modules in documentation
2024-12-06 11:03:56 +00:00
Dániel Buga
9f3476b006
Unstable documentation proof of concept (#2628)
* Unstable documentation proof of concept

* Hide the red banner in esp-wifi documentation

* Changelog
2024-12-02 10:49:06 +00:00
Björn Quentin
cfb83b153d
Fixed triggering a debug-assertion during scan (#2612)
* Fixed triggering a debug-assertion during scan

* CHANGELOGs

* Change `debug_assert` into warning level log

* Enable debug-asserts in hil-test, qa-test and examples

* Change the way we detect and warn about debug-builds

* Warn if opt-level is `0` or `1`
2024-11-27 14:14:04 +00:00
Scott Mabin
2512658653
[3/3] Timer refactor: Timer driver mode, ETM support and erasure (#2586)
* Add mode param and type erasure to high level timer drivers

* Add async impls for the timers plus eha impl

* re add etm example, fix etm for systimer

* re add tests

* Add Into<AnyTimer> + 'static bounds to the Timer trait

* remove set_alarm_active impl detail from the timer trait

* clippy

* doc fix ups

* changelog and migration guide

* review

* fix h2, reuse schedule for delay
2024-11-27 14:10:56 +00:00
Dániel Buga
eec75c8f82
Replace some esp-wifi critical sections with locks (#2554)
* Replace some esp-wifi critical sections with locks

* Remove critical section from event handlers

* Fix doc warnings and accidentally hard-coded esp32s3

* Use Lock in wifi_int_disable/restore

* Replace critical_section in ConcurrentQueue

* Deduplicate wifi_int_disable
2024-11-25 17:06:05 +00:00
Dániel Buga
45395d4cc9
Add custom AtomicWaker and embassy-sync mutex implementation (#2555)
* Add custom AtomicWaker

* Replace Option with a null waker

* Revert "Replace Option with a null waker"

This reverts commit 9a861571790d13087e1448fa9d209d2edf956cb8.

* Clippy

* Implement RawMutex

* Move AtomicWaker, reimplement using Generic
2024-11-23 00:36:32 +00:00
Scott Mabin
79ca9d07aa
[2/3] Timer refactor: TIMG (#2581)
* system timer simplfication

* Removes _all_ type params on Alarm
* Systimer no longer implements peripheral ref, the peripheral ref
  pattern is instead intended to be used on the higher level timer
  drivers
* Removed `Unit` as a type, in favour of an enum
* Alarms are back in the main `SystemTimer` "driver"
* Made all `Unit` modification methods unsafe, it's not possible to
  modify the `Unit`'s safely whilst timers and or the `time::now` API is
  in use

* fix examples and tests (by removing them :D)

* changelog and migration

* Review feedback

* changelog and migration

* /unit_count/unit_value/g

* changelog and migration

* /unit_count/unit_value/g

* system timer simplfication

* Removes _all_ type params on Alarm
* Systimer no longer implements peripheral ref, the peripheral ref
  pattern is instead intended to be used on the higher level timer
  drivers
* Removed `Unit` as a type, in favour of an enum
* Alarms are back in the main `SystemTimer` "driver"
* Made all `Unit` modification methods unsafe, it's not possible to
  modify the `Unit`'s safely whilst timers and or the `time::now` API is
  in use

* Make TimerGroup Timer's dumb and untyped

* changelog

* review

* review
2024-11-22 16:14:14 +00:00
Scott Mabin
60a2c76005
[1/4] Timer refactor: system timer (#2576)
* system timer simplfication

* Removes _all_ type params on Alarm
* Systimer no longer implements peripheral ref, the peripheral ref
  pattern is instead intended to be used on the higher level timer
  drivers
* Removed `Unit` as a type, in favour of an enum
* Alarms are back in the main `SystemTimer` "driver"
* Made all `Unit` modification methods unsafe, it's not possible to
  modify the `Unit`'s safely whilst timers and or the `time::now` API is
  in use

* fix examples and tests (by removing them :D)

* changelog and migration

* /unit_count/unit_value/g

* etm doctest

* Review feedback
2024-11-22 11:24:06 +00:00
Jesse Braham
02ddad47c0
Add new migration guides (#2571) 2024-11-21 09:05:33 +00:00
Jesse Braham
bdfec3781f
New package releases (#2569)
* New package releases

* Update `CHANGELOG.md` for all packages to be published
2024-11-20 09:16:33 +00:00
Scott Mabin
9c06c69600
Touch up the migration guide for esp-wifi (#2561) 2024-11-18 14:41:11 +00:00
Dániel Buga
4f6d51fefa
Add missing Sealed impl (#2560)
* Add missing Sealed impl

* Typos

* It compiles
2024-11-18 14:15:40 +00:00
Jesse Braham
959631ee55
Fix nightly lint errors (#2537) 2024-11-14 07:59:55 +00:00
Jesse Braham
92b91257e9
Remove get_ prefix from functions (#2528)
* Remove `get_` prefixes from functions

* Update migration guides for `esp-hal` and `esp-wifi`

* Update `CHANGELOG.md` files
2024-11-13 15:40:26 +00:00
Easyoakland
30276e1609
implement wifi event handling with data (#2453)
* implement event handling for apsta{,dis}connect and probe

add to wifi_access_point example

* hide internal `Option` to simplify api

* move handler call logic to event.rs

* update_handler_leak

* - Add comments

- match simpler api from `std::panic::update_hook`

- do not assume size_of in prelude

- make all events handleable

- box static instead of leak

* update changelog

* elide lifetime on default handler

* newtypes for all event types.

* add doc to newtypes

* fix previous doc example

* - `get_handler` -> `handler`
- pass critical section to event handlers
- comment on perf of Box<ZST>
- don't pass `prev` in `update_handler`, instead call previous handler first unconditionally

* pass cs to dispatch_event_handler

* don't print "unhandled event" for handled events.
2024-11-13 08:49:41 +00:00
Björn Quentin
5d120f7a70
Remove the integrated blocking networking stack (#2488)
* Add simple example using `smoltcp-nal`

* Remove the blocking networking stack

* Renaming

* Fix CI

* CHANGELOG.md

* Fixes after re-base

* Update esp-wifi/MIGRATING-0.10.md

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

* Improve diff in migration guide

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2024-11-12 11:43:01 +00:00
Jesse Braham
cf10f07a9e
Add validation to esp-config (#2475)
* Clean up and re-organize `lib.rs` a bit (sorry)

* Add configuration validation, some other refactoring/improvements

* Add a built-in range validator, re-document the `generate_config` function

* Update build scripts to reflect new configuration API
2024-11-12 10:14:14 +00:00
Sergio Gasquez Arcos
7402ad61ed
Expose CSI API in esp-wifi (#2422)
* feat: (WIP) add CSI api

* feat: Enable G_CONFIG.csi_enable and update example

* fix: Allow user to set the dessired cb method

* fix: Clippy warnings

* fix: Add missing doccomments

* feat: Add csi_enable config

* refactor: Update CsiConfiguration c6 struct

* feat: Create set_csi WifiController and EspNowManager methods

* docs: Update changelog

* refactor: Rename CsiConfig struct

* docs: Document c6 version of CsiConfig

* feat: impl From<CsiConfig> for crate::include::wifi_csi_config_t

* style: Rustfmt

* docs: Fix comment

Co-authored-by: Dániel Buga <bugadani@gmail.com>

* docs: Fix typo

Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>

* feat: Enable CSI on examples by default

* feat: Handle errors

* style: Rustfmt

* feat: Update error

* feat: Panic if csi config is not enabled

* feat: Cfg CSI stuff when CSI is disabled instead of panicing

* fix: Clippy lints

* feat: Fix signed bitfields

* feat: Pass the cb via ctx

* feat: Update CSI callback to use closures

* refactor: Rename promiscuous_csi_rx_cb to csi_rx_cb

* feat: Move extra boxing inside set_receive_cb

* feat: Refactor CSI callback to use generic types

* refactor: Remove Sized bound from CsiCallback trait

* feat: Add csi_enable field to EspWifiConfig and update CsiCallback trait for conditional compilation

* feat: Remove unnecessary boxes

* feat: Update callback type in set_csi to require Send trait

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2024-11-08 16:33:13 +00:00
Scott Mabin
50d8187e39
esp-wifi: Remove unneeded features (#2446)
* remove async features

* phy-usb config

* modem powersaving

* Fix examples

* make ps a runtime config

* fix linting

* changelog and migration guide

* revert esp-config changes

* remove blanklines after doc comments

* cfg away ps API
2024-11-08 13:30:33 +00:00
Björn Quentin
ca9ee23b5e
Prefer ROM-fns over custom impl (#2462)
* Prefer ROM-fns over custom impl

* PR number
2024-11-04 15:55:23 +00:00
Scott Mabin
c717f04d4d
Remove EspWifiInitFor & more granular init/deinit per driver (#2301)
* More granular init and deinit per driver

- Rework EspWifiInit
- No longer require EspWifiInitFor
- Add Drop impls for each driver, and add Drop for EspWifiController to
  fully deinit the stack

* unwrap! more stuff

* fixup examples and esp-now

* unwrap less stuff

* review feedback

* seal wifi traits, allow rng or trng to init esp-wifi

* changelog and migration guide

* return wifi error in esp now constructor instead of panic
2024-11-04 08:08:19 +00:00
Jesse Braham
fc4eaa1ebf
Make our nightly CI checks pass (#2356)
* Fix nightly lint errors for ESP32-C2

* Fix nightly lint errors for ESP32-C3

* Fix nightly lint errors for ESP32-C6

* Fix remaining nightly lint errors
2024-11-01 10:31:56 +00:00
Björn Quentin
e5b923b678
Esp wifi/more dynamic allocations (#2396)
* Dynamic allocation of timers

* Replace statically allocated NPL events

* Remove NPL CALLOUTS

* Remove NPL EventQueue

* Use `Vec` instead of `heapless::spsc::Queue` internally in NPL

* Use `alloc` since we have it in NPL

* Refactor

* Fix

* More `Vec`

* Fix

* Fix nightly-warnings

* Limit RX_STA queue

* Revert unintentional change

* esp-now: Make data private

* CHANGELOG.md

* Clippy

* MSRV

* Move locking into RawQueue

* Remove unused import

* Simplify `queue_recv`

* Address TODO

* Clippy

* Review I

* Review II

* Clarify

* Review III

* Review IV

* Review V

* Fix

* `steal` RNG and RADIO_CLOCKS

* `drop_in_place`

* De-duplicate

* Use `VecDeque`

* Revert unintentional changes

* Fix

* Update esp-wifi/MIGRATING-0.10.md

Co-authored-by: Dániel Buga <bugadani@gmail.com>

* assert

* Fix

* Expect `*mut ConcurrentQueue` where applicable

* Comment why stealing is fine

* Fix

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2024-10-31 12:26:10 +00:00
Björn Quentin
05a1ebead3
Use esp-wifi-sys from Git (#2426)
* Use esp-wifi-sys from Git

* Update esp-wifi-sys rev
2024-10-30 16:38:16 +00:00
Easyoakland
1de2483609
fix wifi async fn disconnect hanging if not connected when called (#2392)
* fix wifi async fn disconnect hanging if not connected when called

* update changelog

* clarify comment

* add pr number to changelog
2024-10-23 21:29:00 +00:00
Björn Quentin
54d4407042
Better align atoi to what the C-library does (#2380)
* Better align `atoi` to what the C-library does

* Address review comments

* Clippy

* More clippy

* Prefer `read` over `read_volatile`
2024-10-22 14:55:24 +00:00
Björn Quentin
c574834ae3
Include ROM API symbols (#2374)
* Include ROM API symbols

* Fixes and CHANGELOG.md

* Fix

* Move migration steps to the right crate's migration guide

* Remove `-Trom_functions.x` where necessary
2024-10-22 10:02:49 +00:00
Georges
9d51d1befe
fix doc (#2363) 2024-10-18 10:22:39 +00:00
Kirill Mikhailov
88c4dba9e0
esp-wifi docs improve (#2354)
* Improve esp-wifi docs (WIP)

* Finalize

* Address reviews, make cratewide public functions be `pub(crate)`.

* config -> configure
2024-10-18 08:23:16 +00:00