112 Commits

Author SHA1 Message Date
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