130 Commits

Author SHA1 Message Date
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
Andres O. Vela
05076697ec
Rename PSRAM examples for better discoverability (#1675) 2024-06-12 14:23:55 +00:00
Sergio Gasquez Arcos
d2a93894f5
feat: Avoid using a macro for default pins (#1671) 2024-06-11 15:49:44 +00:00
Sergio Gasquez Arcos
a33159a021
Rework Uart constructors, add UartTx and UartRx constuctors. (#1592)
* feat: Add with_pins methods for UART

* feat: Remove configure_pin methods

* docs: Update changelog

* fix: Update tests and examples

* style: Fix format

* Add UartTx/Rx constructors

* feat: Add new_with_default_pins methods

* docs: Update changelog

* feat: Remove optional cts/rts arguments

* feat: Add UartTx/Rx::new_async methods

* fix: Attach interrupt handler to new_ascyn UartRx/Tx

* style: Avoid long module paths

* feat: Make flush_tx public

* test: Use Uart async instead of UartTx/Rx async

* test: Add tests for UartTx/UartRx

* feat: Add configuration method to constuctors

* feat: Move set_rx_fifo_full_threshold and set_rx_timeout to UartRx

* docs: Fix changelog

* test: Fix executor

* feat: Configure UartRx threshold and timeout

* docs: Update changelog

* test: Update uart instance

* feat: Add default_uart0_pins macro to simplify examples

* feat: Address feedback pt1

* feat: Address feedback pt2 - Make constructors fallible

* fix: Doctest
2024-06-11 13:07:17 +00:00
Juraj Sadel
4c5e493b1b
esp-hal: Add runnable doctests to peripheral drivers (#1663)
* Check docs examples II

* rebase and update

* fix root crate macro expansion in doctest snippets

* clean up and fmt

* add xtask run-doc-test subcommand and check in CI

* address review comments

* remove commented printlns

* fix the host target check

* rebase and update

* hide docs for before_snippet macro and remove commented block code in twai
2024-06-11 10:18:09 +00:00
Jesse Braham
dc8e0a6496
Refactor Dac1/Dac2 drivers into a single Dac driver (#1661)
* Refactor `Dac1`/`Dac2` drivers into a single `Dac` driver

* Fix unrelated build errors resulting from updated PACs

* Add new `Instance` trait to `prelude` module, update `dac` example

* Update `CHANGELOG.md`

* Fix example in module documentation

* Turns out these are 0-indexed after all
2024-06-10 13:52:00 +00:00
Jesse Braham
48e3e912f3
Extract embassy support into esp-hal-embassy package (#1595)
* Extract embassy support into `esp-hal-embassy` package

* Update relevant packages/examples/tests to get CI green again

* Add back `defmt` support

* Re-export `Executor` and `InterruptExecutor` rather than making `executor` module public

* Document the `esp-hal-embassy` package

* Update `CHANGELOG.md`

* Hack together a "fix" for the `SYSTIMER` time driver

* Make `clippy` shut up
2024-06-03 11:27:20 +00:00
Jesse Braham
40c327eeae
Housekeeping (#1647)
* Remove version from path dependencies in `examples` and `hil-test` packages

* Remove unused constant from `esp-println`

* Consistent badges across `README.md` files
2024-05-31 13:58:54 +00:00
Björn Quentin
83dfb5b803
Add IEEE802.15.4 Wireshark Extcap (#1636) 2024-05-29 14:04:44 +00:00
Scott Mabin
db39d0197a
Examples and test cleanup (#1590)
* initial cull of examples

* Remove direct vector example, replace with interrupt latency test

* Remove clock monitor in favour of just a test
2024-05-28 18:58:48 +00:00