24 Commits

Author SHA1 Message Date
Dániel Buga
e1b8558057
RSA tweaks (#3900)
* RSA tweaks

* Fix copy-pasted typos from esp-idf docs

* Clean up

* Fix doc issues
2025-08-10 12:34:04 +00:00
Dániel Buga
90fb97531c
Make metadata macros available even for build scripts (#3906) 2025-08-07 11:03:47 +00:00
Björn Quentin
3ab3490d62
Move malloc etc to esp-alloc, common C functions to esp-rom-sys, define "C functions" in esp-radio weak (#3890)
* Provide malloc, free and friends in esp-alloc

* Mute warning

* Remove some (now unused) global symbols

* Have a way to opt-out of esp-alloc's malloc,free etc.

* Fixes

* Move some common C functions from esp-radio to esp-rom-sys

* Fix

* Make esp-readio symbols weakly linked

* CHANGELOG.md

* Align MSRV, cleanup visibility

* Init before `assume_init`

* Linker script fixes

* Fix examples

* Remove heapless - esp-radio is alloc

* Fix examples

* Whitespace

* realloc_internal

* Make `__esp_radio_putchar` a no-op if `sys-logs` is not enabled
2025-08-05 11:58:31 +00:00
Dániel Buga
406056ab9c
Midterm AES rework (#3882)
* Midterm AES rework

* Update esp-hal/src/aes/mod.rs

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

* Update esp-hal/MIGRATING-1.0.0-rc.0.md

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

* Panic on wrong size

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2025-07-30 15:02:12 +00:00
Dániel Buga
a215aca629
Move REF_TICK and RC_FAST_CLK to metadata (#3866)
* Move REF_TICK and RC_FAST_CLK to metadata

* Don't try to use ref_tick if it doesn't exist

* Fix S3
2025-07-28 10:14:34 +00:00
Dániel Buga
bb50746e9c
Move TIMG clock source defaults to metadata (#3864)
* Read register once

* Move TIMG clock sources to metadata

* Also describe C2/3/S2/S3 clock source options

* H2: Use PLL as WDT clock source

* Fix H2 WDT calculation

* Initialize clocks before setting up WDT

* Set clock source for all timers in the timer group
2025-07-28 07:10:58 +00:00
Dániel Buga
1af4e29014
Move RSA operand sizes to metadata (including AES fallout) (#3845)
* Encode RSA operand sizes in metadata, compactly

* Rework AES with for-each macro
2025-07-24 08:36:32 +00:00
Dániel Buga
0c1cc17ed1
Move SHA algos to metadata (#3844) 2025-07-21 19:47:33 +00:00
Dániel Buga
fd66bd3dcc
Encode AES key lengths in metadata (#3843) 2025-07-21 19:01:45 +00:00
Dániel Buga
0d9f43db29
Rewrite RNG (#3829) 2025-07-21 15:10:35 +00:00
Dániel Buga
af6ffb102f
Update instability (#3836) 2025-07-21 09:37:58 +00:00
Dániel Buga
8c64b09ba7
Allow configuring longer WDT periods (#3816)
* Clean up with new PAC

* Allow configuring longer WDT periods

* Enable WDT after updating timeout
2025-07-17 14:50:26 +00:00
Dániel Buga
f9419afcc2
Update PAC (#3802) 2025-07-17 12:23:51 +00:00
Dániel Buga
e146e03c72
Use metadata to define LP peripheral FIFO sizes (#3812) 2025-07-17 12:16:24 +00:00
Scott Mabin
6b758d75b8
Finalize releases (#3805)
* Finalize crate releases

* changelog fixup

* fixup docsrs ci test

* docs fixup
2025-07-16 10:29:34 +00:00
Dániel Buga
496aeb864b
More touching up of generated code (#3791)
* Document remaining macros, update gpio syntax

* Update if_pin_is_type syntax, simplify impl

* Remove impl_for_pin_type

* Remove if_pin_is_type

* Remove the gpio macro
2025-07-14 13:05:27 +00:00
Dániel Buga
40fc4f2c6c
Make sure repeated matchers in for_each macros don't overlap (#3790)
* Allow generating separate repeat branches

* Generate separate repeated matchers for simple/expanded signals
2025-07-14 13:04:51 +00:00
Dániel Buga
df7ba7d427
Document esp-metadata-generated (#3787)
* Try to make it more obvious how to update e-m-g

* Document top level, ensure build-script docs are present

* Document Chip, hide Config
2025-07-11 12:48:25 +00:00
Dániel Buga
3a5aa72c4e
Define analog/LP functions (#3781)
* Shorten name

* Define analog/rtc functions

* Try to make the data useable

* Remove general pin attributes

* Do not generate unnecessary expanded matchers

* Remove expanded GPIO cases

* Move simplified io_type to where it is used

* Fix RTC IO with resistors calls

* Hide macros on H2

* Define rtcio pins for C2/C3

* Fix S2

* Compare against the correct GPIO number

* Deduplicate

* Restore one waker per pin

* Remove case that is no longer needed, avoid inline(always)
2025-07-11 09:41:50 +00:00
Sergio Gasquez Arcos
3bc667ee4f
Add missing c-examples (#3770)
* docs: Add missing c-examples

* feat: Config docflags for `run doc-tests`

* docs: Update before/after macro and format code in docs

* docs: Improve chip! example

* docs: Fix format and error

* feat: Add ESP_HAL_DOCTEST environment variable for documentation tests
2025-07-09 12:46:22 +00:00
Simon Neuenhausen
3d6e522cbc
Allow splitting control over modem clocks. (#3687)
* Minimal architecture for split RCC.

* Removed critical section.

* Add all modem clock controllers and adjust esp-ieee802154.

* Fixed incorrect cfg.

* Fixed unstable attribute usage.

* Replaced AtomicU8 with Cell<u8>

* Reverted example channel back to 15

* Added unstable attribute to ModemClockController impls.

* Remember to actually increase the ref count.

* Experimentally removed RadioClockController

* Merged ref counters and made decrease panic if zero is reached.

* Removed RADIO_CLK peripheral.

* Removed RADIO_CLK again.

* Revert "Removed RADIO_CLK again."

This reverts commit 6da2d2834850068aa21bc52b141de2cfd8154acc.

* Removed RADIO_CLK without reformatting the files.

* Applied changes to examples and hil-tests.

* Fixed OS adapter for C2 and H2

* Adjusted docs and used unwrap!

* Fixed comments.

* Added changelog.

* Fixed esp-wifi for esp32h2.

* Changed comment for PHY_CLOCK_REF_COUNTER.

* Fixed lint for esp32c2.

* Update esp-hal/src/clock/mod.rs

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

* Update esp-hal/src/clock/mod.rs

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

* Removed unnecessary comments and made init_radio_clocks unstable.

* Update esp-hal/src/clock/mod.rs

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

* Fixed lint.

* Removed clocks_ll functions for chips that don't have those peripherals.

* fmt

* Changed modem clock controller stealing.

* Added lifetime

* fixed peripheral stealing again

* Made modem_clock_controller not const.

* Used type alias instead of function for peripheral stealing.

* fmt

* Adjusted remaining comments.

* Added note about coex.

* fmt

* misc

* Revert "misc"

This reverts commit d8740421e0dff84af605160939e246f2308a48e1.

* Regenerated esp metadata

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-07-08 17:23:55 +00:00
Dániel Buga
1a9b4bafe0
Calculate max input/output signal ID automatically (#3773) 2025-07-08 13:39:00 +00:00
Dániel Buga
3537b5ecae
Use indexmap to ensure stable iteration order (#3771) 2025-07-08 09:51:43 +00:00
Dániel Buga
692a768b3a
Introduce esp-metadata-generated (#3754)
* Move macros to new crate

* Generate a single file

* Pre-generate esp-metadata-generated

* Move saving code to xtask

* Format with both rustfmt and prettyplease

* Fix doc build

* Unhide macros

* Fix doc string

* Update semver-check baseline
2025-07-07 15:37:05 +00:00