97 Commits

Author SHA1 Message Date
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
Scott Mabin
6c3ccb6043
Add read_bytes method to uart (#1784)
* Add read_bytes method to uart

* Changelog
2024-07-11 12:55:42 +00:00
Jesse Braham
eb9bfd52b1
Fix clippy warning in esp-wifi, remove Cargo patch and update semihosting dependency (#1778)
* Update `semihosting` dependency and remove Cargo patch

* Fix clippy error in `esp-wifi`
2024-07-09 09:50:09 -07:00
Björn Quentin
a5be31fadc
Improve and use timer abstractions (#1753)
* Make esp-wifi timer agnostic

* Use timer-abstractions in embassy time driver

* Refactor

* Fix

* Fix

* Docs

* Adapt examples

* Adapt tests

* Refactoring

* Changelogs

* Fix example

* Adapt xtask

* Make CI pass

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2024-07-09 15:59:38 +00:00
Sergio Gasquez Arcos
8e0a2012dc
Update module documentation (#1763)
* docs: Update GPIO docs

* docs: Update other GPIO modules docs

* docs: Update AES mod documentation

* docs: Update Analog and ADC mod documentation

* docs: Update DAC mod documentation

* docs: Update lib docs

* docs: Update clock  mod documentation

* docs: Update dma  mod documentation

* docs: Update interrupt  mod documentation

* docs: Update lcd_cam  mod documentation

* docs: Update ledc  mod documentation

* docs: Update mcpwm mod documentation

* docs: Update pcnt mod documentation

* docs: Update rom mod documentation

* docs: Update rsa mod documentation

* docs: Update rtc_cntl mod documentation

* docs: Update spi mod documentation

* docs: Update timer mod documentation

* docs: Update twai mod documentation

* docs: Format headers

* style: Fix fmt

* refactor: Change visibility instead of hidding docs

* style: Fix header

* Fix typo

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

* Fix typo

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

* Fix typo

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

* Fix typo

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

* Fix typo

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

* docs: Add tracking issue

* docs: Remove architecture and simplify sentence

* fix: Update visibilities remove hidden docs

* Fix type

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

* docs: Improve wording

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

---------

Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2024-07-09 15:40:31 +00:00
Scott Mabin
e75d43d3f0
Fix new clippy lints introduced in 1.78 & 1.79 (#1776)
* Fix new clippy lints introduced in 1.78 & 1.79

* Patch semihosting
2024-07-09 13:23:19 +00:00
Kirill Mikhailov
163f45076e
Enable i2s HIL test for esp32h2 (#1755)
Delete invalid comment
2024-07-04 15:28:37 +00:00
Sergio Gasquez Arcos
786682c0b2
HIL: Erase flash on failure (#1748)
* ci: Erase flash on failure

* docs: Add espflash install instructions and fix format
2024-07-04 07:50:40 +00:00
Dominic Fischer
c62bd8b332
Add PCNT HIL test (#1746)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-07-04 06:23:14 +00:00
liebman
cc7077624c
dma: add Mem2Mem to support memory to memory transfer (#1738)
* dma: add Mem2Mem to support memory to memory transfer

* fmt

* update CHANGELOG

* removed some debugging

* use "gdma" as the selector for support

* fix empty else

* clippy

* Mem2Mem::new now accepts the peripheral to use

* mark Mem2Mem::new() unsafe

* fmt :-/

* add Mem2MemN values for gdma on non-esp32s3
tested on esp32c3,esp32c6 (will have an esp32h2 in a few days)

* support the esp32c2 (esp8684)

* DmaEligible trait providing dma peripheral value & safe constructor for Mem2Mem dma.

* added hil-test for Mem2Mem

* fmt dma_mem2mem test

* remove `debug!()`

* reset the mem2mem bit (mem_trans_en) in in_conf0 on drop
2024-07-03 17:56:37 +00:00
Kirill Mikhailov
cd0272ee81 Make links be in the same format 2024-07-03 12:53:17 +02:00
Kirill Mikhailov
f177b945b7 docs: Add missing link to HIL README 2024-07-03 12:53:17 +02:00
Sergio Gasquez Arcos
d0cd890e51
Update some modules documentation (#1726)
* docs: Add inverting documentation and examples

* docs: Update I2C mod docs

* docs: Update LEDC documentation

* docs: FIx format

* Fix a typo in docstring in `esp-hal/src/uart.rs`

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2024-06-27 16:50:30 +00:00
Dominic Fischer
7753551671
[2/3] DMA Move API: Move DMA descriptors to peripheral drivers (#1719)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-06-26 14:31:41 +00:00
Sergio Gasquez Arcos
e46e80b8c1
Enable C2 HIL (#1680)
* ci: Enable c2 hil

* docs: Update pins and add C2

* feat: Update C2 probe-rs args

* test: Update pins and disable failing tests

* docs: Update S3 wires

* ci: Enable C2 hil tests
2024-06-26 14:17:40 +00:00
Björn Quentin
d34a872230
Additional move base dma api (#1672)
* Additional owning DMA transfers for SPI half-duplex

* CHANGELOG.md

* CHANGELOG.md

* Clippy
2024-06-19 13:17:22 +00:00
Björn Quentin
1630868d06
Improve DMA pop implementation (#1664)
* Improve DMA `pop` implementation

* CHANGELOG.md

* Minor Fixes

* Cover more edge-cases in DMA pop, make sure the test is testing these

* Fixes

* Working available/pop

* Remove misleading `last_in_dscr_address`

* Remove unnecessary check from `available`

* Remove now-unused function

* Remove duplicate change-log entry
2024-06-19 12:51:24 +00:00
Sergio Gasquez Arcos
e7f8f50e82
Update embedded-tests and wiring docs (#1652)
* build: Update embedded-test

* docs: Update probe-rs version

* docs: Revert probe-rs update

* docs: Update wiring

* docs: Update source command
2024-06-12 10:12:04 +00:00
Björn Quentin
1122df15e2
Check DMA descriptors and buffers addresses (#1670)
* Check DMA descriptors and buffers addresses

* Add PR id

* Add test for the memory region check

* Clippy
2024-06-11 14:42:46 +00:00