339 Commits

Author SHA1 Message Date
Sergio Gasquez Arcos
b5f0246129
Reordered RX-TX pairs to be consistent (#2074)
* feat: Update rx-tx order in i2s

* feat: Update rx-tx order in dma macros

* feat: Update rx-tx order in spi

* feat: Update rx-tx order in aes

* feat: Update rx-tx order in mem2mem

* feat: Update rx-tx order in twai and split methods

* feat: Update rx-tx order in twai

* feat: Update rx-tx order in twai and uart docs

* docs: Add sentence about order

* docs: Update changelog

* feat: Update rx-tx order in embassy_interrupt_spi_dma tests

* style: Rustfmt

* docs: Migrating guide

* fix: Typo

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

* fix: Diff

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

* fix: Tests rx-tx order

* fix: Update new_with_default_pins order

* feat: Update rx/tx order in hil_test::common_test_pins!

* feat: Update dma_extmem2mem example

* fix: Revert deleted input arg

* style: rustfmt

* feat: Disable test_asymmetric_dma_transfer for S2

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2024-09-06 09:56:10 +00:00
Scott Mabin
70126c8149
Rename esp_hal::time::current_time to esp_hal::time::now (#2091)
* rename esp_hal::time::current_time to esp_hal::time::uptime

* changelog

* move more things to init

* s/uptime/now/g
2024-09-05 14:57:56 +00:00
Dániel Buga
f11c18a6b9
Optionally type-erased GPIO drivers (#2075)
* Remove type erased gpio structs

* Implement Peripheral for ErasedPin

* Simpler type erasing, accept ErasedPin in pin drivers, remove type erased drivers

* Reformulate pin drivers using Flex

* Erase gpio types by default

* Accept any pin in AnyPin

* Add changelog and migration guide

* Fix tests and examples

* Undo rename of clone_unchecked
2024-09-05 14:14:51 +00:00
M4tsuri
4f97befdde
Implement sleep and wakeup functionalities for ESP32C2 #1920 (#1922) 2024-09-05 13:39:46 +00:00
Dániel Buga
5370afb1eb
Build examples in debug mode (#2078)
* Build examples in debug mode

* Allow building psram examples in debug mode in CI

* Don't rebuild tests, try to avoid rebuilding dependencies
2024-09-05 10:04:07 +00:00
Dániel Buga
99bf346898
Remove the need to manually pass clocks around (#1999)
* Clean up passing clocks to drivers

* Update changelog

* Initialise Clocks in a critical section

* Fix calling now() before init

* Fix doc

* Fix esp-wifi migration guide

* Add safety comment

* Update tests
2024-09-04 14:13:51 +00:00
Dániel Buga
7688504289
Remove Gpio type aliasses (#2073)
* Remove Gpio type aliasses

* Clean up examples
2024-09-04 13:37:56 +00:00
Jesse Braham
b7b916f03a
Remove most trait implementation features from esp-hal (#2070)
* Eliminate esp-hal's `ufmt` feature

* Eliminate esp-hal's `embedded-hal-02` feature

* Eliminate esp-hal's `embedded-hal` feature

* Eliminate esp-hal's `embedded-io` feature

* Eliminate esp-hal's `async` feature

* Update `CHANGELOG.md`

* Remove `async` from required features for HIL tests

* Update migration guide
2024-09-04 06:15:27 +00:00
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
Sergio Gasquez Arcos
f9ab55c38f
fix: Fix nightly errors (#1934) 2024-08-30 14:08:06 +00:00
Dániel Buga
c7a7760b51
Implement timer conversion for some arrays (#2012) 2024-08-28 09:54:58 +00:00
Dániel Buga
8aa1a88a23
Prefer cfg_if (#2003) 2024-08-27 11:53:55 +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
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
Frostie314159
d1acacb757
Implement Sniffer API (#1935)
* Implemented queue_msg_waiting.

* Fmt.

* Adjusted changelog.

* Fixed CI.

* Fixed pointer mutability.

* Implemented experimental sniffer api.

* Fixed CI..

* Added safety comment.

* Featured gated, PromiscuousPkt

* Format.

* Adjusted imports.

* Added injection example.

* Made RxControlInfo::from_raw public.

* Format.

* Added sniffer example.
2024-08-19 06:51:18 +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
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
Kirill Mikhailov
a3a3ef12e4
Add self-testing mode for TWAI peripheral. (#1929)
* Add self-testing mode for `TWAI` peripheral

* changelog entry

* fix docs build

* fix async example

* Restore example to original state

fix comment

* `NoAck` -> `SelfTest`
2024-08-12 15:22:27 +00:00
Kirill Mikhailov
1574e53b0e
Make C6 ADC calibration work properly again (#1911)
* Reverting changes which provoke wrong `ADC` behaviour

* Minor example fix

* clocks update
2024-08-08 11:52:08 +00:00
Jonathan
94db708f49
Touch support for ESP32 (#1873)
* Added touch pad support

* touch: Introduced blocking mode

* touch: moved fns out of TouchPad to prepare async code

* touch: added async support and embassy example
2024-08-06 07:19:41 +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
liebman
c7218fba2b
Implement DMA to/from psram on esp32s3 (#1827)
* initial non-working attemt for dma from psram on esp32s3

* flush cache - now works for extmem as source but not for extmem as destination

* use cache_invalidate_addr on destination address

* update changelog

* require dma transfers to/from psram to be aligned to dcache line size

* cache_writeback_addr() should suspend/resume dcache autoload

* no need for cfg(esp32s3) in esp32s3 specific module

* dma: document alignment requirements for DMA to/from PSRAM

* fix doc typos
2024-07-25 12:51:02 +00:00
Björn Quentin
38f1d28585
Fix async PARL_IO RX (#1851)
* Fix async PARL_IO RX

* CHANGELOG.md
2024-07-24 13:19:19 +00:00
Juraj Sadel
3299348ebc
esp_hal: Warnings in examples cleanup (#1852) 2024-07-24 13:18:50 +00:00
BMCG0011
5d6354ccbd
Expose InputPin.is_interrupt_set in implementation of esp-hal::gpio::… (#1839)
* Expose InputPin.is_interrupt_set in implementation of esp-hal::gpio::Input

* Move entry in changelog from changed to added
2024-07-23 19:47:59 +00:00
Björn Quentin
8be7f81e34
usb-serial-jtag example: Hint for Windows users (#1845) 2024-07-23 19:23:35 +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
Jesse Braham
776f34cff1
Re-export the esp_hal_procmacros::main macro from esp-hal-embassy instead of esp-hal (#1828)
* Re-export the `main` procmacro from `esp-hal-embassy` rather than `esp-hal`

* Fix documentation warnings

* Flatten the `time_driver` module

* clippy

* Update `CHANGELOG.md`
2024-07-18 09:31:03 +00:00
Juraj Sadel
884db5aa32
esp-hal: Add (where missing) used GPIOs to example descriptions (#1810)
* esp-hal: Add (where missing) used GPIOs to example descriptions

* review comments
2024-07-17 08:34:13 +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
Sergio Gasquez Arcos
7ea471c1ac
Remove unnecessary delay (#1794)
* fix: Remove unnecesary delay

* docs: Update changelog

* fix: Remove unused variable

* fix: Remove clippy warning from examples
2024-07-15 13:09:47 +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
W Etheredge
a2883ac318
Take 2 on #[ram] soundness (#1677)
* Improve `#[ram]` soundness

* Allow `Atomic*` in `#[ram(persistent)]`

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2024-07-10 13:30:48 +00: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
Juraj Sadel
d5b6c850f9
esp-hal: ESP32 typo in cfg-gate in embassy_i2s_read example (#1775) 2024-07-09 13:48:08 +00:00
Grant Moyer
dfe628c53d
Fix UsbDm and UsbDp for Gpio19 and Gpio20 (#1764)
GPIO pins 19 and 20 had USB D- and D+ swapped. This change fixes which pin is which USB data line according to the pin descriptions in the ESP32-S2 and ESP32-S3 data sheets (sections 2.2 and 2.3.2 respectively). Since these GpioPins are only used by Usb for lifetime tracking, and UsbDp and UsbDm are always used as a pair, this change is only semantic and doesn't affect functionality.
2024-07-08 13:37:57 +00:00
Sergio Gasquez Arcos
ea34196d8d
Properly update the Uart config in examples (#1759)
* fix: Properly update the config

* feat: Make rx_timeout optional

* docs: Update changelog
2024-07-08 09:30:45 +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
Dominic Fischer
fc826caf18
Expose optional HSYNC input in LCD_CAM (#1707)
* Expose optional HSYNC input in LCD_CAM

* Fix DMA wait check in LCD_CAM

---------

Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-07-02 16:56:53 +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
Dominic Fischer
9d5fb31c4b
TIMG: Fix interrupt handler setup (#1715)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-06-25 13:01:40 +00:00
Dominic Fischer
eee20de116
Patch up LCD_CAM example (#1701)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-06-20 13:27:50 +00:00
Björn Quentin
65b956d6a8
Fix mk_static macro (#1674) 2024-06-12 15:09:43 +00:00