36 Commits

Author SHA1 Message Date
Juraj Sadel
bc96351c17
C6: Basic LP_UART driver (#1113)
* WIP

* Add basic LP_UART C6 driver

* Add lp-uart example for C6

* modify entry macro and fmt

* final cleanups

* revert lp_core_basic example and add lp_core_uart and uart examples

* changelog

* review changes

* second changelog

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
2024-01-25 16:22:14 +00:00
Jesse Braham
e5cd1bd33e
Add initial support for the ESP32-P4 (#1101)
* Add `esp32p4` feature to `esp-hal-procmacros`

* Add `esp32p4` feature to `esp-hal-common`

* Create the `esp32p4-hal` package

* Add ESP32-P4 to CI workflow

* Fix a silly typo :)

* Update `CHANGELOG.md`
2024-01-22 15:28:05 +00:00
Jesse Braham
c55a6b70ae
New package releases (#1018)
* Fix typos in top-level `README.md`

* Bump version numbers of all packages and update necessary dependencies

* Update `CHANGELOG.md` files
2023-12-12 10:17:17 -08:00
Dániel Buga
39519dfdc9
RISC-V executors (#947)
* RISC-V executors

* Add multiprio example to RISC-V SoCs

* Check new examples

* Hack in support for generic queue

* Reserve SoftwareInterrupt0 for multicore thread-mode executors

* Merge interrupt executors

* Merge thread-mode executors

* Document the new features and expand on time drivers

* Main tasks don't have to return !

* Unify multiprio examples

* Undo C6 log output change
2023-11-22 14:36:53 +00:00
Björn Quentin
c612fecfae
Clear LP/RTC RAM (#916)
* Clear LP_RAM/RTC RAM to make sure .bss is cleared

* Rename `ulp-riscv-hal` to `esp-ulp-riscv-hal`

* CHANGELOG.md entry
2023-11-09 14:06:58 +01:00
Jesse Braham
8a3e63cdeb
New package releases (#887)
* New package releases

* Update `CHANGELOG.md`
2023-10-31 09:18:20 -07:00
Jesse Braham
0304a10b2f Documentation improvements for esp-hal-procmacros 2023-10-27 08:27:06 -07:00
Jesse Braham
c6af8ba88b
Assimilate lp-hal-procmacros into esp-hal-procmacros (#845)
* Assimilate `lp-hal-procmacros` into `esp-hal-procmacros`

* Update `CHANGELOG.md`
2023-10-12 06:58:37 -07:00
Björn Quentin
a0ebdf0399
embassy #[main] convenience for RISC-V / Xtensa (#841) 2023-10-11 12:10:14 +01:00
Björn Quentin
47821e6b3b
Add ULP RISC-V HAL (#840) 2023-10-10 16:32:52 +02:00
Jesse Braham
2badf86705
Bump the MSRV to 1.67, check the defmt feature in MSRV check (#798)
* Bump MSRV to 1.67, check with `defmt` feature enabled in MSRV checks where applicable

* Add `esp32c6-lp-hal-procmacros` package to VS Code workspace

* Update `CHANGELOG.md`
2023-09-19 05:19:55 -07:00
Björn Quentin
a0e5737a22
Macro to load LP core code (#779)
* Macro to load LP core code

* Fix imports, add CHANGELOG.md entry

* Avoid code warning

* Omit path from function signature

* More error checking

* Clippy fix

* Include the ELF used by the lp_core_basic example

* Make object dependency optional

* Use 1.65 for RISCV MSRV check

* Use RUSTC_BOOTSTRAP for RISCV MSRV check

* Remove the pre-compiled LP core example

* Pin toml_edit in esp32c6-lp-hal-procmacro
2023-09-14 12:16:12 +02:00
Björn Quentin
a642ee40da
Async RMT (#787)
* Async RMT

* Add CHANGELOG item

* Pin toml_edit transitive dependency
2023-09-13 09:02:36 +02:00
Jesse Braham
ad74108e00 New package releases 2023-09-05 07:47:49 -07:00
Kirill Mikhailov
2bd10526a7
Documenting a number of peripherals and packages (#680)
* Initial documentation improvements

* More documentation improvements

* More documentation improvements


More modules documented

* Finished SOC documentation for esp32 + TWAI

* Fix: fix incorrect formatting

* Adding more documentation to rom, and soc peripherals for multiple chips

* Adding documentation for multiple peripherals

* Adding SOC module documentation

* Analog and clock modules are documented

* Adding module-level documentation for DMA and INTERRUPT peripherals

* Finishing job + minor fixes

* Fix unopened HTML break

* Rustfmt adjustment 


formatting


Fix typo

* Add CHANGELOG record


Fix typo

* Fix typos, mistakes, improving docs

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

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

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

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

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

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

Co-authored-by: Scott Mabin <scott@mabez.dev>
Fixing typos, mistakes, improving docs.

* Fix formatting, mistakes and typos

* Fixing a bunch of logical, grammatical and formatting mistakes
2023-08-09 06:33:50 -07:00
Jesse Braham
8b8eea66ee New package releases 2023-07-04 10:57:06 -07:00
Jesse Braham
26473baf0e
Assorted small fixes and improvements (#635)
* Include the `esp-riscv-rt` package in VS Code workspace

* Fix a couple warnings

* Update dependencies

* Top-level README improvements
2023-07-04 10:41:32 -07:00
Jesse Braham
89ba8f6e30
Update esp-hal-procmacros package dependencies and features (#628)
* Remove unnecessary `riscv` and `xtensa` features from proc macro crate

* Update `darling` and `syn`, address breaking changes

* Update CHANGELOG

* Remove unneeded macro definition/invocation
2023-06-28 08:43:06 -07:00
Kirill Mikhailov
9493b38a1b Started adding ESP32-H2 support (#482) 2023-05-08 08:03:08 -07:00
Jesse Braham
a9104020fc
Minor documentation improvements (#460)
* Add README, improve documentation for `esp-hal-procmacros`

* Improve documentation for `esp-hal-smartled`

* Use esp-rs logo for all packages' documentation
2023-03-30 06:05:28 -07:00
Jesse Braham
aac83644af New releases for all packages 2023-03-27 10:38:46 -07:00
Jesse Braham
536adac991
Clean up cfg gating and prelude module (#442)
* Add additional `cfg` gates to re-exports in `esp-hal-common`

This leaves only `clock`, `delay`, `peripheral`, `prelude`, `rom`, and `soc` *not* behind `cfg`s

* Simplify the prelude, update its `cfg`s, and re-export some missing traits

* Update various dependencies
2023-03-20 11:22:55 +00:00
Jesse Braham
d293d9f162
Add support for the ESP32-C6 (#392)
* Create the `esp32c6-hal` package

* Teach `esp-hal-common` about the ESP32-C6

* Get a number of peripheral drivers building for the ESP32-C6

bckup

initial clocks_ii

* Create the `esp32c6-hal` package

C6: update

* Simplify and fix the linker script

update

* C6: add I2S

* Create the `esp32c6-hal` package

* Teach `esp-hal-common` about the ESP32-C6

* Get a number of peripheral drivers building for the ESP32-C6

bckup

initial clocks_ii

* Create the `esp32c6-hal` package

* C6: update

* Simplify and fix the linker script

* update

* C6: add I2S

* update

* C6 Interrupts

* C6: Update build.rs, linker scripts and initial examples

* C6: RMT

* Fix interrupt handling

* Fix `ClockControl::configure`

* C6: revert to I2S0 instead of just I2S

* C6: rebase and update

* RTC not buildable

* Implement RWDT and SWD disable

* C6: working LEDC

* C6: working RMT

* C6: add aes

* C6: add mcpwm

* C6: add rtc_cntln - not finished

* C6: update and formatting

* C6: add pcnt

* C6: add examples and format

* Remove inline assembly, fix interrupts and linker scripts

* Remove unused features, update cargo config for atomic emu, misc cleanup

* Get ADC building and example "working" (as much as it ever does)

* Remove a bunch of unused constants which were copied from ESP-IDF

* The `mcpwm` example now works correctly

* Get `TWAI` peripheral driver building for C6

* Clean up the `rtc_cntl` module and get all the other HALs building again

* Add the C6 to our CI workflow

* Fix various things that have been missed when rebasing

Still missing a few examples (`clock_monitor`, `embassy_spi`, `ram`)

* C6: Small updates in wdt (#1)

* C6: Update WDT

* C6: Update examples with WDT update

* Update `esp-println` dependency to fix build errors

* Fix formatting issues causing pre-commit hook to fail

* Get some more examples working

* Working `ram` example

* Sync with changes in `main` after rebasing

* Working `embassy_spi` example

* Use a git dependency for the PAC until we publish a release

* Fix I2S for ESP32-C6

* Fix esp32c6 direct boot (#4)

* Add direct boot support for C6

* Fix direct boot for c6

- Actually copy into rtc ram
- remove dummy section that is no longer needed (was just a waste of
  flash space)
- Move RTC stuff before the no load sections

* Update RWDT and refactor RTC (#3)

* C6: Update RWDT and add example, refactor RTC and add not-really-good example

* Update based on review comments, resolve bunch of warnings and run cargo fmt

* Update C6 esp-pacs rev commit

* Fix clocks_ll/esp32c6.rs

* Fix riscv interrupts

* Remove clock_monitor example for now

* RAM example works in direct-boot mode

* Add a TODO for &mut TIMG0 and cargo fmt

* Fix linker script after a bad rebase

* Update CI and Cargo.toml embassy required features

* use riscv32imac-unknown-none-elf target for C6 in CI

* change default target to riscv32imac-unknown-none-elf

* add riscv32imac-unknown-none-elf target to MSRV job

* another cleanup

---------

Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Jesse Braham <jesse@beta7.io>

* Make required changes to include new `RADIO` peripheral

* Use published versions of PAC and `esp-println`

* Use the correct target extensions (`imac`)

* Fix the super watchdog timer, plus a few more examples

* Fix UART clock configuration

* Make sure to sync UART registers when configuring AT cmd detection

* Disable APM in direct-boot mode

* Address a number of review comments

* Fix `SPI` clocks and `rtc_watchdog` example  (#6)

* fix SPI clocks

* run cargo fmt

* Add comment about used default clk src

* Fix rtc_watchdog example in BL mode

* run cargo fmt

* Update rtc_watchdog example that it works in DB mode

* README and example fixes/cleanup

* Add I2C peripheral enable and reset

* Fix `ApbSarAdc` configuration in `system.rs`

---------

Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
Co-authored-by: Scott Mabin <scott@mabez.dev>
2023-02-27 09:15:44 -08:00
Jesse Braham
d3969c3130 New releases for all HAL packages 2023-02-21 07:43:44 -08:00
Björn Quentin
4e88e48bbe
Remove unnecessary rt crate dependencies (#391)
* Remove unnecessary `rt` crate dependencies

* Bump versions, update to latest released dependencies
2023-02-10 07:24:12 -08:00
Björn Quentin
ab9aeb2443 AnyPin 2023-02-08 14:31:54 +01:00
Jesse Braham
d03c267084 New releases for all HAL packages 2023-01-26 08:51:24 -08:00
Scott Mabin
452fde2c12
Peripheral ref/gpio (#323)
* Implement Peripheral for all GPIO pins

* Update i2c & i2s to use the new gpio peripherals ref

* gpio pref: usb

* gpio pref: pulse control (RMT)

* gpio pref: spi

* gpio pref: uart

* gpio pref: ledc

* gpio pref: mcpwm

* fixup smartleds to use new pulse controller traits

* dump msrv

* bump rust-version in cargo tomls
2022-12-19 14:40:29 +00:00
Scott Mabin
248fb356f8
PeripheralRef init: uart (#272)
* Add the peripheral module plus some helper macros in preparation

* peripheral macro

* Add peripheral generation macro

* Fixes after rebase

* Update the signature of Peripherals::take

* syncronise hello world example

* fmt the entire repo

Co-authored-by: Jesse Braham <jesse@beta7.io>
2022-12-12 14:45:33 +00:00
Gleb Dubrovin
5c28663d67
esp-hal-procmacros::interrupt fix example in doc (#270) 2022-11-21 17:25:17 +00:00
Jesse Braham
6f20358124
Update the Cargo manifests and top-level README (#168)
* Add the `rust-version` key to each Cargo manifest

* Normalize dependencies and features in each Cargo manifest

* Enable all features in CI when checking examples

* Update the top-level README
2022-08-25 09:20:05 -07:00
Andreas Hartmann
525c6054ba procmacros: Replace then_some
which was just [recently stabilized in rust 1.62.0][1] and hence raises
the MSRV to 1.62.0 for all HALs. Use `bool::then` instead, which takes a
closure instead of a parameter but has the same effect otherwise and is
available [since rust 1.50.0][2].

[1]: https://github.com/rust-lang/rust/pull/96628
[2]: https://doc.rust-lang.org/stable/std/primitive.bool.html#method.then
2022-08-03 16:59:23 +02:00
Scott Mabin
1789780d06
Xtensa vectored interrupts (#103)
* Xtensa interrupt vectoring: peripheral source

- Initial Xtensa vectoring, updated esp32 gpio example to use new interrupt macro.
- Only peripheral sources supported.
- Only level one priority supported.
- CPU & Edge interrupts still need to be handled.

* Xtensa interrupt vectoring: CPU & EDGE

- Add support for handling CPU interrupts and edge interrupts
- PR required to xtensa-lx-rt for CPU handlers

* Xtensa interrupt vectoring: Priority

- Finally implement priortization
- Only three priorities available at the moment. Xtensa programmer guide
  discourages using highpri interrupts in Rust/C. Guide also mentions
  using software priortization to increase the number of Priorities
  available

* support CPU interrupts, using patch xtensa-lx-rt

* Update example

* Add support & examples for the s2 & s3 too

* Fix formatting and missing imports

* Run interrupt handling in ram, optionally run the vector handler in ram in the examples

* Use xtensa_lx::Mutex CS when enabling interrupts

* Run clippy on each target

* Remove redundant features

* Fix C3 builds

* make enable unsafe. Add note about preallocated interrupts in vectored mode.

* Remove `INTERRUPT_LEVELS` static

The interrupt levels static introduces a few issues
  - A lock is needed when configuring interrupts to keep
    INTERRUPT_LEVELS in a consistent state
  - Interrupts enabled from outside the Rust domain wouldn't be
    serviced, this is the case with the wifi blobs

To remove it, the prioty configuration is now calculated dynamically in
the interrupt handler. Essentially INTERRUPT_LEVELS is now created once
the interrupt triggers. It has some benefits, such as only having to
look at interrupts configured on the current core, not both, but there
is of course an overhead with doing this in the interrupt.

* Allow raw interrupts on levels 4-7, whilst also supporting vectoring on levels 1-3

* rename core number features

* Fix examples and formatting

* use xtensa-lx-rt release, update pacs

* Support passing the trap frame into interrupt handlers

* cfg away the #[interrupt] macro when not using vectoring

* rename enable to map

move vectored feature to chip specific hals

* export vectored functions

- rename `enable_with_priority` to `enable`
- add docs for interrupt macro

* Update all examples to use vectored interrupts
2022-07-25 07:12:34 -07:00
Jesse Braham
67bd5837cd Make cargo manifests consistent and bump dependencies 2022-05-05 11:56:43 +02:00
bjoernQ
7b59c9e76d Move linker scripts to sub-folders 2022-02-18 12:00:05 +01:00
Björn Quentin
70109ffe36
Initial implementation of ram proc macro (#6)
* Add .iram section for ESP32C3, make it possible to use direct-boot or normal-boot

* Add ram proc-macro
2022-01-18 10:02:40 -08:00