75 Commits

Author SHA1 Message Date
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
Dániel Buga
86e006b601
Rework how peripheral singletons are generated (#3747)
* Handle GPIOs as stable peripherals

* Define interrupts in create_peripheral

* Remove the rest of paste from the peripherals macro

* Move create_peripheral calls out of peripherals!

* Merge macros

* Merge peripherals files

* Delete the peripheral module

* Replace the peripherals macro with for_each generated code

* Do not generate code directly in GPIO metadata
2025-07-04 12:15:12 +00:00
Dániel Buga
9146407573
Fix and extend pin layouts (#3726)
* Fix ESP32 pin layout

Co-authored-by: rmsyn <github@weathered-steel.dev>

* Tabulate ESP32

* Fix C2 pin layout

* Fix C3 pin layout

* Fix C6 pin layout

Co-authored-by: rmsyn <github@weathered-steel.dev>

* Note AF availability on IoMuxSignal

* Add mising AFs to H2

* Remove unavailable pins

* Add mising signals to S2

* Add mising signals to S3

* Changelog

* Update semver baseline

---------

Co-authored-by: rmsyn <github@weathered-steel.dev>
2025-07-02 13:16:48 +00:00
Dániel Buga
21f1d89f15
Generate peripherals macro call & remove paste (#3713)
* Expand peripheral metadata

* Generate peripherals macro call

* Remove paste from peripherals

* Add missing peris

* Fix ETM and TRACE0 naming

* Remove redundant tsens symbol

* Remove RTCIO stuff from h2

* Rename S2 RTC_CNTL

* Add missing SYSCON back to S2

* Do not mark the GPIO singleton stable

* Treat unlisted drivers as not available

* Assign stability based on driver info

* Fmt

* Remove unused info
2025-07-01 19:31:21 +00:00
Dániel Buga
8c4878cb03
Refactor AssistDebug symbols (#3730) 2025-07-01 14:42:27 +00:00
Dániel Buga
745cfd71b6
de-paste! the any_peripheral macro (#3699)
* Stop using paste in any_peripheral

* Drop unused macro

* Generate a delegate macro for any-peripheral dispatching

* Fix up PDMA
2025-07-01 13:48:40 +00:00
Dániel Buga
175f4a16b6
Extract SPI metadata (#3702)
* Extract SPI M/S metadata

* Clean up additional instance trait

* Further SPI cleanups, add OSPI pin setters

* Re-generate semver baseline

* Fix typo
2025-07-01 11:13:26 +00:00
Dániel Buga
b2a8d6bcee
Move UART instance info to esp-metadata (#3698)
* Move UART instance info to esp-metadata

* Fix typo
2025-06-30 16:38:15 +00:00
Dániel Buga
b11d810d97
Tweak and make use of the old bind_X_interrupt functions (#3689)
* Rename bind_interrupt functions

* Generate enable/disable functions, remove redundant irq mapping from metadata

* Clean up PARL_IO

* Refactor SPI master, I2S, Uart

* Update USB_DEVICE
2025-06-30 15:28:42 +00:00
Dániel Buga
101de4eab8
Cleanup esp-metadata (#3686)
* Clean up esp-metadata a bit

* Update esp-metadata/src/cfg/gpio.rs

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

* Document public API, arrange structs better

---------

Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
2025-06-30 08:16:22 +00:00
Dániel Buga
9d452a108f
Move USB device pin info to metadata (#3685)
* Allow else in impl_for_pin_type

* Move USB pin workaround info to metadata

* Simplify pin attr collection
2025-06-27 15:13:24 +00:00
Björn Quentin
99042a7d60
Don't lie about the MSRV (#3692)
* Don't lie about the MSRV

* Don't mention MSRV in xtensa-lx-* docs
2025-06-25 11:20:52 +00:00
Dániel Buga
c72889a73d
Generate i2c instances from metadata (#3678) 2025-06-24 12:18:22 +00:00
Dániel Buga
d7622ff8c3
More gpio macro tweaks (#3669)
* Split up loop

* Generate io_type calls

* Unify various if-pin-implements macros into two generated ones

* Remove unused syntax from the gpio macro
2025-06-24 10:52:28 +00:00
Dániel Buga
fbe8ddc954
Move AnalogPin's impl out of the macro (#3668) 2025-06-24 10:51:27 +00:00
Dániel Buga
077fc22305
Remove paste! from the gpio! macro (#3666)
* Remove paste from the gpio macro

* Remove unnecessary optional from macro
2025-06-23 14:57:04 +00:00
Dániel Buga
1cd3a28954
Move IO_MUX signals to metadata (#3663)
* Generate Input/OutputSignal enums

* Deduplicate alternate function tables

* Don't misuse instance config for pins and signals
2025-06-23 14:43:17 +00:00
Dániel Buga
9507fa38b4
Move smaller GPIO properties to metadata (#3657)
* Move other GPIO properties

* Redo USB pins as pin capability

* Deduplicate interrupt status enum

* Remove unnecessary interrupt enable bits on S2

* Update S2 PAC and remove manual io_mux hackery

* Generate io_mux function from metadata
2025-06-23 12:45:21 +00:00
Dániel Buga
b98631570f
Move GPIO pin properties to metadata (#3656)
* Reorganize esp-metadata

* Move GPIO properties to metadata

* Fix AF enum variants, remove need for paste for them
2025-06-20 07:45:49 +00:00
Dániel Buga
2438d03b21
Simplify generated code to save on build time, yeet a few dependencies (#3643)
* Reduce use of iter::chain

* Cache all symbols

* Trim xtensa-lx-rt deps

* Remove unused dep

* Replace chrono with jiff

* Yeet minijinja

* Save a bit on toml_edit

* Disable some default features

* Disable regex log filters

* Reduce xtensa-lx-rt build script

* Remove unnecessary dependencies

* Remove darling

* Update embedded-test

* lol

* Clean up

* Only validate loaded config once

* fmt

* Changelog
2025-06-17 20:35:00 +00:00
Dániel Buga
891a5a4a8c
Move some more peripherals to metadata (#3633)
* Remove gpio bank 1 symbol

* Remove intr status width symbols

* Allow virtual periphs, redo ADC/DAC
2025-06-17 08:10:12 +00:00
Dániel Buga
c29c436be5
Prefix peripheral cfg symbols with chip_has_* (#3628)
* Prefix peri cfg with `soc_has_`

* Clean up ETM
2025-06-16 08:13:28 +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
Dániel Buga
793b01beaa
Move timer instance config into driver metadata (#3626)
* Remove timg_timer1 symbol

* Ensure instances exist

* Rename timers to timergroup

* Remove unnecessary cfg
2025-06-12 14:49:04 +00:00
Dániel Buga
db3eb3da95
Remove hand-defined radio symbols (#3632) 2025-06-12 13:04:36 +00:00
Dániel Buga
f22ddb4a87
More i2c metadata & some additional cleanup (#3620)
* Define more i2c metadata

* Remove I2C1 AHB base address

* Encode address in metadata

* Extract timeout value calculation
2025-06-11 09:47:42 +00:00
Dániel Buga
61aa33b259
Inline width variables (#3624) 2025-06-11 07:59:22 +00:00
Dániel Buga
f394af8ca2
Peri support corrections (#3621) 2025-06-10 13:58:19 +00:00
Dániel Buga
48a5927767
Generate peripheral support table (#3617) 2025-06-10 13:13:24 +00:00
Dániel Buga
f6d54a0471
Generate macros from metadata (#3604)
* Generate macros from metadata

* Don't generate metadata env vars

* Add trm link, change cores to integer

* Port RMT memory constants

* Add some I2C flags

* Auto-generate PeriConfig, remove trait

* Make sure memory_range is hidden
2025-06-10 10:06:32 +00:00
Scott Mabin
3cd36062d4
Finalize crates for release (#3588) 2025-06-03 12:30:48 +00:00
Dániel Buga
f5287c3ef9
Remove note about fixed cargo bug (#3105)
* Remove note

* Remove workaround

* Fix MSRV changelogs
2025-06-02 13:51:36 +00:00
Scott Mabin
e97de69b42
use 1.87 in CI, bump MSRV to 1.86 (#3560)
* use 1.87 in CI, bump MSRV to 1.86

* update API baseline files (rustdoc json format change)

* Add api-baseline regen guide to guidelines
2025-05-29 13:45:22 +00:00
Dániel Buga
fbdb99ec6a
xtask: Bump version in changelog, add check-changelog (#3478)
* Parse and update changelog on version bump

* Add check-changelog

* Fix changelogs

* Check changelog format in CI

* Fix log string

* Update readme

* Add tests, remove empty changelog groups
2025-05-19 07:15:47 +00:00
Dániel Buga
5df246c702
Rely on esp-metadata for chip feature check (#3447) 2025-05-06 08:11:53 +00:00
Dániel Buga
b1f487093b
Update dependencies (#3416) 2025-04-24 13:41:20 +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
Scott Mabin
0876bac6c5
xtask: refactor feature selection and package validation (#3358)
* apply_feature_rules applies more things

* apply features in one place only, fix missing features and clippy warnings

* move various logic to package enum, re-add the ability to test packages with custom feature sets

* small cleanup

* simplify msrv check, fix CI

* review feedback

* try and fix msrv check

* rebase fixups

* use msrv toolchain in check
2025-04-14 11:23:54 +00:00
Björn Quentin
faf7115b0c
Define DRAM memory region in esp-metadata (#3300)
* Define DRAM memory region in esp-metadata

* CHANGELOG.md

* Dedicated macros for memory region start/end

* Use `from_str_radix` in esp-config

* Fix search+replace mistake

* Fix

* fix'n fmt

* fix unused

* Minor change
2025-04-02 14:56:34 +00:00
Sergio Gasquez Arcos
d65497de59
Update documentation links (#3244)
* docs: Update documentation links

* docs: Update docs.rs badges
2025-03-14 09:01:31 +00:00
Björn Quentin
38eb5aefc9
Xtask/latest redirect (#3231)
* Support "build-documentation-index --serve"

* Support `/latest` in generated docs

* `/latest` vs `/latest/`

* Update documentation field
2025-03-07 11:28:41 +00:00
Sergio Gasquez Arcos
3816de0d87
Update documentation links (#3197)
* feat: Update documentation links

* feat: Add documentation field to Cargo.toml
2025-03-03 10:58:03 +00:00
Jesse Braham
fd2bdefaab
New package releases (#3163)
* Update dependencies and bump version numbers

* Update `CHANGELOG.md` for each package being published

* Update repo-level `README.md`

* Use older nightly to resolve CI issues

* also release esp-backtrace and esp-metadata

* Cleanup

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2025-02-24 13:32:29 +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
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
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
Davo
5a64d9ba8f
feat: add support for internal temperature sensor (tsens) for esp32c6 and esp32c3 (#2875)
* feat: add basic support for temperature sensor (tsens) for esp32c6

* feat: add basic support for temperature sensor (tsens) for esp32c3

* feat: add configurable clock source for temperature sensor

* feat: add Temperature struct to avoid enforcing usage of floats

- Also add misc derives to multiple structs
- Add power_up / power_down methods to TemperatureSensor
- Enable ApbSarAdc via PeripheralGuard

* fix: move tsens module to unstable module list
2025-01-07 16:40:12 +00:00
Dániel Buga
6b01f7993b
SPI and related changes (#2681)
* Define Octal SpiDataMode

* Fix BitOrder capitalization

* Hide DmaError

* Derive more traits

* Return error for unsupported half-duplex parameter combinations

* Remove unnecessary implementation detail

* Return error instead of silently breaking transaction

* Downgrade assert to debug_assert

* Expand on the enum variants

* Remove redundant imports

* Hide some unstable functions
2024-12-06 10:30:43 +00:00
Dániel Buga
9458fd3ed4
[DMA 8/8] Burst configuration (#2543)
* Implement burst configuration

* Reject transfers if the DMA in incapable of accessing external memory

* Fix psram

* Rename, documentation

* Address a few review comments

* Check buffer length, too

* Return error instead of panic

* Allow users to only specify the relevant burst config

* Add missing conversion

* Add missing docs

* Fix IN alignment requirements

* Fix test

* Deduplicate chunk size literal
2024-12-06 08:30:58 +00:00