115 Commits

Author SHA1 Message Date
Dániel Buga
447411fb58
Rework hal initialization (#1970)
* Rework hal initialization

* Turn sw interrupt control into a virtual peripheral

* Return a tuple instead of a named struct

* Fix docs

* Remove SystemClockControl

* Move software interrupts under interrupt

* Re-document what's left in system

* Update time docs

* Update sw int docs

* Introduce Config

* Fix tests

* Remove redundant inits

* Doc

* Clean up examples&tests

* Update tests

* Add changelog entry

* Start migration guide

* Restore some convenience-imports

* Remove Config from prelude
2024-09-02 13:38:46 +00:00
Björn Quentin
2dc285a947
QSPI tests (#2015)
* Add QSPI tests

* Simplify

* Add qspi_write_read test
2024-09-02 07:52:20 +00:00
Jesse Braham
5917275108
Version 0.20.0 (#2038)
* Update package dependencies and bump version numbers

* Update `CHANGELOG.md` for each package to be published

* Remember to update `xtensa-lx-rt` too :)

* Add and use TrapFrame::new() in esp-wifi

* Bump `xtensa-lx-rt` by minor instead of patch, as there are breaking changes

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2024-08-29 19:29:33 +00:00
Dániel Buga
84a060013d
Fix defmt compatibility (#2017)
* Fix defmt compatibility

* Update tests to cover macros
2024-08-28 14:07:09 +00:00
Dániel Buga
6abbc72e11
Test and fix async RSA (#2002)
* RSA cleanup & API consistency change, part 2

* RSA cleanup & API consistency change, part 3

* Add async tests

* Fix async for ESP32

* Merge impl blocks

* Backtrack on some mutability changes

* Use Acquire/Release ordering

* Fwd to write_multi_start instead of duplicating impl
2024-08-28 09:56:05 +00:00
Dániel Buga
c7a7760b51
Implement timer conversion for some arrays (#2012) 2024-08-28 09:54:58 +00:00
Scott Mabin
65c5dc1781
SPI DMA: use State for both blocking and async operations (#1985)
* use `State` for both blocking and async operations, remove async version of SpiDmaBus in favour of being generic over the mode

* reuse wait_for_idle more

* changelog

* rename generic params for consistency

* Add duplex mode to SpiDmaBus

* implement HalfDuplexReadWrite for SpiDmaBus

* Docs on new async APIs

* Limit half duplex transfers to the capacity of the DmaBuf

* docs

* rebase tests

* address review comments

* remove duplex traits from spi

* fix tests

* spi docs rejig

* s/InUse/TemporarilyRemoved/g
2024-08-27 16:15:59 +00:00
Dániel Buga
8aa1a88a23
Prefer cfg_if (#2003) 2024-08-27 11:53:55 +00:00
Dániel Buga
1003ce0c0f
Clean up SHA, RSA, mandate #[must_use] on Futures (#2000)
* Janitor go brr

* Clean up SHA

* Use max CPU speed

* RSA cleanup part 1

* Clean up nonsense comments

* Mark all futures as must_use
2024-08-27 10:43:58 +00:00
Priit Laes
a41bc4cb3d
gpio: Make AnyPin, AnyInputOnlyPin, DummyPin available from gpio module (#1918)
Making these available straight from `gpio` aligns it with other Embassy
implementations (mainly nrf and stm32).

Signed-off-by: Priit Laes <plaes@plaes.org>
2024-08-26 18:30:24 +00:00
Dániel Buga
e1697310f6
Refactor SPI tests & re-enable S3 and some S2 (#1990)
* Deduplicate spi_full_duplex_dma_async

* Refactor SPI tests

* Separate out PCNT tests

* Re-enable test on S3

* Re-enable some S2 tests
2024-08-26 14:22:19 +00:00
Dániel Buga
341db16874
Use uhubctl to disable and enable usb ports (#1997) 2024-08-26 13:46:32 +00:00
Dániel Buga
b4ccb359ef
HIL: Multiple featuresets & conditionally enable generic-queue feature (#1989)
* Conditionally enable generic-queue feature

* Allow specifying multiple feature sets and run all of them
2024-08-26 06:19:03 +00:00
Scott Mabin
0e333f7aa2
tell cargo about all our custom cfgs (#1988)
* tell cargo about all our custom lints

* fixup the unexpected cfg lints, including remove clic
2024-08-23 12:56:00 +00:00
Scott Mabin
d610ee83db
Add tests to ensure that we don't reset current_time drivers (#1978) 2024-08-23 11:24:03 +00:00
Dániel Buga
f829c8f2ac
Fix C2 delays (#1981)
* Re-enable delay tests on S2 and C2

* Systimer: use fn instead of constant to retrieve tick freq

* Reformulate delay using current_time

* Take actual XTAL into account

* Re-enable tests

* Fix changelog

* Disable defmt

* Remove unused esp32 code

* Update esp-hal/src/delay.rs

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2024-08-21 17:33:46 +00:00
Dániel Buga
69cf454a5a
Fix S2 systimers (#1979)
* Add basic systimer interrupt tests

* Remove unnecessary condition

* Fix edge interrupt bitmasks

* Modify target_conf in critical section

* Remove unnecessary fn call

* Fix test

* Add failing test case

* Fix S2 systimer interrupts being fired unexpectedly

* Add changelog entry

* Format
2024-08-21 13:21:13 +00:00
Dominic Fischer
dc6c53ee47
Remove redundant WithDmaSpi traits (#1975)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-08-21 12:59:55 +00:00
Dominic Fischer
41f9925e2c
[3/3] DMA Move API: Introduce DMA buffer objects (#1856)
* [3/3] DMA Move API: Introduce DMA buffer objects

* Remove FlashSafeDma

* Add async HIL test

* Handle set_length(0) correctly

* Fix tx/rx booleans

* Unlucky

* Preserve previous blocking semantics

* Add delay between starting DMA TX and SPI driver

* Update CHANGELOG

* merge tidy

* Add with_buffers builder

---------

Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-08-20 11:47:55 +00:00
Anthony Grondin
70491b9e37
Refactor SHA to use trait. Implement Digest traits for SHA (#1908)
* feat(SHA): Refactor SHA to use trait. Implement Digest traits for SHA

* Fix CI. Fix wrong sha mode for esp32

* Save hash register for interleaving operation

An example (wip) `sha_fuzz.rs` was added to test different functionalities of the SHA driver and to ensure proper functionning under all cases.

* Use random data when testing SHA

* fix(SHA): Buffer words until a full block before writing to memory

This fixes interleaving operations by buffering words into the SHA context until a full block can be processed.

* Fix(SHA): Use correct length padding for SHA384 and SHA512.

- This fixes a long running issue with SHA384 and SHA512, where some digest of specific sizes wouldn't compute correctly, by changing the padding length of the size field.

* Re-export digest for convenience

* Remove completed TODO

* Remove SHA peripheral requirement.

- Document safety of the SHA driver.

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2024-08-19 14:43:47 +00:00
Dániel Buga
ec130877b7
Disable RTT polling in HIL tests by default (#1960)
* Disable defmt-rtt by default

* Update i2s test based on changes done to async

* fmt

* Update readme

* Update more tests
2024-08-19 13:47:22 +00:00
Juraj Sadel
42bbdaeb4f
Add basic HIL test for GPIO that can be configured as pin for (#1963) 2024-08-19 11:43:59 +00:00
Juraj Sadel
e708dbc777
Add more SPI DMA (full-duplex) HIL tests (blocking and async) (#1952)
* Add more SPI DMA HIL tests (blocking and async)

* move test repetitions into loops instead, add a description about why PCNT is used, import embedded_hal_async::spi

* clean up
2024-08-19 06:59:55 +00:00
Dániel Buga
f95ab0def5
Simplify initialization APIs (#1957)
* Accept more types in embassy::init

* Apply the same treatment to esp-wifi

* Changelog

* Clean up

* Add doc examples

* Fix Alarm generic parameters
2024-08-16 16:33:29 +00:00
Dominic Fischer
6e706c5f11
Improve SYSTIMER API (#1871)
* Improve SYSTIMER API

* Remove config object

* fix things

* Allow erasure of unit and comparator numbers

* Merge fail

---------

Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-08-16 14:59:34 +00:00
Dániel Buga
eb1b295116
Do not reset UsbSerialJtag peripheral (#1961)
* Fix typos

* Add a function to detect debugger connection

* Do not reset USB peripheral

* Changelog

* Fix different register names

* Reuse xtensa_lx::is_debugger_attached
2024-08-16 14:51:34 +00:00
Dániel Buga
6127f5df11
Further clean up timers/executors test (#1953)
* Further clean up embassy_timers_executors

* Do not delay for so long

* Print timer values on assert failure

* Clean up some more

* Retry test a few times to counteract probe-rs halting us

* Fix formatting
2024-08-16 06:08:32 +00:00
Dániel Buga
a10f86dbaa
Clean up i2s_async test, add option to repeat (#1951)
* Simplify I2S async test

* Allow running tests repeatedly

* Fail at the first mismatch

* Clean up
2024-08-15 11:48:23 +00:00
Dániel Buga
9e87792fb9
Update probe-rs, prebuild xtask for HIL tests (#1939)
* Update probe-rs

* Differentiate jobs

* Explicitly print that probe-rs's execution failed

* Do not capture stdin/stderr

* Pre-build xtask binary

* Use current_directory

* Print more info when a file can't be read

* Do not erase flash after a failure

* get_time: fail faster

* Make xtask runnable
2024-08-14 15:47:52 +00:00
Kirill Mikhailov
460eaa254a
Adding TWAI HIL test (#1946)
* Adding `TWAI` HIL test

* add `Frame` trait

* mutability
2024-08-14 14:06:08 +00:00
Sycrosity
c83d1de974
Update to latest release (0.6.0) for embassy-executor in esp-embassy-hal (fixes #1941) (#1942)
* Updated to latest release (`0.6.0`) for `embassy-executor`

* update changelog

* update hil-test version of embassy-executor to 0.6.0

* update embassy-executor in `examples`

* reflect esp_hal change in `OneShotTimer` to not have a lifetime.

* update changelog

* revert OneShotTimer changes
2024-08-14 12:45:46 +00:00
Dániel Buga
6b6e628940
Slightly clean up embassy HIL tests (#1937) 2024-08-13 19:39:36 +00:00
Dániel Buga
352879abce
Fix an infinite loop in interrupt executors (#1936)
* Add failing test

Fix the name of the test fn

* Fix interrupt executor looping

* Fix formatting

* Fix changelog reference

* Move changelog to the right crate

* Remove dead code
2024-08-13 12:51:26 +00:00
Dániel Buga
63a2d407ee
Fix some typos (#1930) 2024-08-12 12:20:58 +00:00
Sergio Gasquez Arcos
2e8937a90f
Update probe-rs version (#1914)
* docs: Update probe-rs version

* feat: Simplify probe-rs args

* ci: Update the checkout action to use the fork
2024-08-09 14:11:29 +00:00
Juraj Sadel
c5ea0e9149
esp-hal: Add HIL test for embassy timer and executor (#1886)
* esp_hal: Add embassy timers and executors HIL test

* Add timeout to each test

* cfg-gate out systimer tests for ESP32
2024-08-05 21:49:57 +00:00
Sergio Gasquez Arcos
40d5481edd
ci: Disable test_asymmetric_dma_transfer for S3 (#1888) 2024-07-31 15:47:44 +00:00
liebman
67bb6c54bb
Implement async for lcd_cam i8080 (#1834)
* implement async for lcd_cam i8080

* lcd_cam: implement InterruptConfigurable for blocking and improve async

* lcd_cam: use new async interrupt semantics from #1835

* lcd_cam: move interrupt handler binding into `new_async()`

* lcd_cam: Instance::is_listening_lcd_done not used

* i8080: no need for seperate `new_async()`

* i8080: don't use DmaTxFuture, just test for dma error after complete

* add HIL tests for LCD_CAM i8080 in blocking and async.

* lcd_cam_i8080: test channels configured for async as well since teh compiler can't prevent it for now

* fmt :-/

* lcd_cam fix comment

* changelog

* lcd_cam async: no need to enable interrupts until polled

* lcd_cam: i8080 update for ReadBuffer changes
2024-07-29 13:59:52 +00:00
Björn Quentin
c6207c0f59
Lift static requirement on DMA buffers (#1837)
* Lift `static` requirement on DMA buffers

* Seal `Word`, use `size_of_val`

* Fix

* CHANGELOG.md

* Use Clippy's safety comment style

* Top-level docs regarding mem::forget
2024-07-25 13:55:02 +00:00
Jesse Braham
3215d93f53
Use peripheral ref pattern for OneShotTimer and PeriodicTimer` (#1855)
* Use the peripheral ref pattern for `OneShotTimer` and `PeriodicTimer`

* Update tests and examples to reflect changes in timer API

* Update `CHANGELOG.md`
2024-07-25 12:52:34 +00:00
Björn Quentin
d5bff95a1b
Fix I2s async-tx (#1833)
* Fix I2s async-tx

* CHANGELOG.md

* Add async i2s test

* Cleanup

* Use `Spawner::for_current_executor()` instead of manually creating the executor
2024-07-23 18:09:58 +00:00
Björn Quentin
1424f2a43d
Implement InterruptConfigurable (#1819)
* Implement `InterruptConfigurable`

* Fix doc-tests

* Clippy

* Fix lp_core_uart example

* CHANGELOG.md

* Have DEFAULT_INTERRUPT_HANDLER

* Fix docs

* Clippy

* Add `set_interrupt_handler` for WDT
2024-07-18 13:37:46 +00:00
Scott Mabin
04cad71926
bump esp-backtrace to 0.13.0 (#1804)
* bump esp-backtrace to 0.13.0

* disable spi_half_duplex_write for esp32s2
2024-07-16 13:19:16 +00:00
Dominic Fischer
31a135c0f1
Add SPI Half Duplex Write HIL test (#1801)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-07-16 10:19:16 +00:00
Jesse Braham
77b6cb8615
New package releases (#1800)
* Use published versions of all dependencies, update dependencies as needed

* Fix `embassy_usb_serial` example build errors after updating `embassy-usb`

* New package releases
2024-07-15 20:23:13 +00:00
liebman
1631f22083
support dma chunk sizes other than 4092 (#1758)
* support dma chunk sizes other than 4092

* fmt

* update CHANGELOG

* fix 0 size static assert

* review changes:
- `.div_ceil()`
- return errors for bad chunk size and buffer sizes in Mem2Mem constructors
- correct 0 chunk size check in descripter macros

* dma: clear the mem2mem bit when channel is configured instead of in Drop
2024-07-15 12:00:33 +00:00
Juraj Sadel
45c8107ecd
esp-hal: remove warnings in PCNT example and HIL test (#1793) 2024-07-15 10:49:39 +00:00
Dominic Fischer
0cae79b4cc
Improve PCNT API (with HIL tests) (#1765)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-07-15 09:31:35 +00:00
Jesse Braham
dcc6c896de
Housekeeping: fix warnings, rename some examples, etc. (#1786)
* Build HIL tests for ESP32 in CI, fix resulting build errors

* Fix some warnings in the `hil-test` package

* Fix warnings in examples

* Remove "esp_" prefix from Wi-Fi example file names

* Resolve the last of the known warnings
2024-07-12 09:35:55 +00:00
Dominic Fischer
bb8660d3c5
Add SPI Half Duplex Read HIL test (#1782)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-07-11 12:55:59 +00:00