29 Commits

Author SHA1 Message Date
Dániel Buga
8c69e8cb51
Newtype fugit Rate, Instant and Duration (#3083)
* Newtype fugit Rate, Instant and Duration

* Document, remove time::now

* Fix perf

* Tweak docs
2025-02-04 17:23:08 +00:00
Dániel Buga
ce750b5fe4
Remove OutputOpenDrain (#3029)
* Remove OutputOpenDrain

* Remove input-related functions from Output

* Fix documentation

* Improve docs
2025-01-27 16:41:58 +00:00
Jesse Braham
4ea6b76f0a
Add configuration structs for GPIO drivers, make constructors fallible (#2990)
* Add configuration structs for GPIO drivers, make constructors fallible

* Update all examples and HIL tests to use new GPIO driver API

* Update migration guide

* Update `CHANGELOG.md`

* Fix errors

* Add `apply_config` functions

* Fixes
2025-01-22 14:20:06 +00:00
Björn Quentin
5f2c0ec5f2
Support 3-wire-SPI (#2919)
* Support 3-wire-SPI

* CHANGELOG.md

* Remove 'Error::ArgumentsInvalid', more docs

* Rebase Fix

* `DataMode::Single` -> `DataMode::FourWire`

* Rename, again

* docs wording

* Honor ESP32

* Have some testing for DataMode::Single

* Mark `with_sio0/1` unstable
2025-01-17 16:34:34 +00:00
Dániel Buga
848029b152
Test all feature sets (#2901)
* Mark interconnect as unstable

* Explicitly set unstable feature in HIL tests

* WIP append feature set name to artifact

* Add name to feature sets, build all combinations

* Fix tests

* Provide a looping executor for stable async tests

* Fix usb serial jtag

* Hide interconnect types
2025-01-09 13:58:14 +00:00
Jesse Braham
7d0b39dbd2
Fix naming violations for SPI Address and Command enums (#2906)
* Fix naming violations for SPI `Address` and `Command` enums

* Update migration guide

* Update `CHANGELOG.md`
2025-01-08 14:39:54 +00:00
Jesse Braham
bb406cec6b
Fix naming violations for spi::Mode enum variants (#2902)
* Fix naming violations for `spi::Mode`

* Update migration guide

* Update `CHANGELOG.md`
2025-01-07 15:55:19 +00:00
Dominic Fischer
b3401bff59
Refactor SPI MISO setup (#2557)
* Refactor SPI MISO setup

* update HIL

* docs

* missed a spot

* fix changelog

---------

Co-authored-by: Dominic Fischer <git@dominicfischer.me>
Co-authored-by: Scott Mabin <scott@mabez.dev>
2025-01-07 11:31:26 +00:00
Dániel Buga
7f8af8a651
Remove prelude (#2845)
* Remove prelude

* Changelog
2024-12-20 10:24:57 +00:00
Sergio Gasquez Arcos
d4386adfc7
Rename Spi enums (#2828)
* feat: Rename Spi enums

* docs: Update changelog

* feat: Rename crate::Mode to crate::DriverMode

* docs: Udpate changelog

* feat: Rename DM type parameter to Dm for ECC

* style: rustfmt

* feat: Rename crate::Mode to crate::DriverMode
2024-12-19 08:41:59 +00:00
Juraj Sadel
d54f8440a5
HIL(QOL): Use global timeout instead of timeout macros (#2489)
* HIL(QOL): Add missing timeouts to various tests

* Increase timeouts for ECC

* Use global timeout in hil tests

* sha: increase test_digest_of_size_1_to_200 timeout from 10 to 15 seconds
2024-12-04 12:03:39 +00:00
Dominic Fischer
94e7ffbcef
Remove Dma[Rx|Tx]Buffer::length (#2587)
Co-authored-by: Dominic Fischer <git@dominicfischer.me>
2024-12-03 08:27:13 +00:00
Dániel Buga
92910bf1cb
Constructor consistency update (#2610)
* UART: only implement constructors with config, define ConfigError

* UART: only implement interrupt functions for Blocking

* I2C: fallible constructors

* Lcd/Cam

* SPI

* Update tests and examples

* Changelog

* Add note about ConfigError

* Fmt
2024-11-28 09:28:50 +00:00
Jesse Braham
1a2bee6f1f
Add derive macro for BuilderLite, add #[non_exhaustive] to some enums and structs (#2614)
* Add a derive procmacro to implement the Builder Lite pattern for a struct

* Add `#[non_exhaustive]` and derive `BuilderLite` where necessary in I2C module

* Add `#[non_exhaustive]` and derive `BuilderLite` where necessary in UART module

* Add `#[non_exhaustive]` and derive `BuilderLite` where necessary in SPI module

* Update `CHANGELOG.md`

* Fix build errors in HIL tests

* Fix generated doc comments

* Return a `ParseError` rather than panicking

* Add a method to set the value to `None` for `Option` types
2024-11-27 15:54:43 +00:00
Dániel Buga
ef98e2b24f
[DMA 7/8]: Remove Dma, move channels to Peripherals (#2545)
* Move DMA channels into Peripherals

* Initialize DMA in the critical section needed for clock management

* Update esp-hal/MIGRATING-0.22.md

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

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2024-11-25 09:31:18 +00:00
Dániel Buga
3a4a7632b1
[DMA 4/8]: Apply Peripheral pattern (#2526)
* Create DMA Channels inside peripherals

* Add PARL_IO into_async functions

* Update tests and examples

* Restore configurable priority via DmaChannel

* Add mode param to DPI driver

* Fix test by raising SPI frequency

* Fix split

* Changelog

* Update esp-hal/CHANGELOG.md

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2024-11-22 09:05:22 +00:00
Dániel Buga
973671c3cb
[DMA 3/8] Remove ChannelCreator types, temporarily disable burst mode (#2403)
* Remove ChannelCreator types and burst mode

* Fix up I2sParallel

* Always enable burst transfering descriptors

* Configure burst transfer with a non-bool for future chip support

* Reuse buffer preparation code

* Update LoopBuf as well

* Update lcd_cam tests

* Rename config, fix changelog
2024-11-21 15:01:29 +00:00
Dániel Buga
38dde2ebbd
[DMA 1/N] Add mode to DMA channel drivers (#2519)
* Add mode to DMA channel drivers

* Swap dma Channel CH and DM

* Fix copy-paste mistake
2024-11-14 08:03:05 +00:00
Jesse Braham
92b91257e9
Remove get_ prefix from functions (#2528)
* Remove `get_` prefixes from functions

* Update migration guides for `esp-hal` and `esp-wifi`

* Update `CHANGELOG.md` files
2024-11-13 15:40:26 +00:00
Dániel Buga
fbc57542a8
Remove pins from Io (#2508)
* Split pins off of Io

* Remove the GPIO peripheral

* p.GPIO
2024-11-12 10:36:25 +00:00
Dániel Buga
8860aba9b2
Spi master: remove public hidden APIs, add Config/apply_config (#2448)
* Remove hidden public SPI API

* Fix in_progress flags not being set

* Remove redundant checks, fix full-duplex flag

* Remove now-redundant Send impl

* apply_config

* SetConfig

* Return ConfigError

* Unwrap config result in ctor
2024-11-06 09:03:43 +00:00
Dániel Buga
0c86740418
Peripheral interconnect redo, vol 2 (split()) (#2418)
* Replace peripheral connection conversions with split

* Constrain Flex conversions
2024-11-04 11:29:28 +00:00
Dániel Buga
2ac47868f7
Remove FullDuplexMode and HalfDuplexMode type params (#2373)
* Remove duplex type param

* Rename dma_ functions
2024-10-24 07:22:21 +00:00
Dániel Buga
a754e411b1
SPI type erasure (#2334)
* Move SPI peripheral type to the last position

* Implement AnySpi

* Convert peripheral types

* Add new_typed constructors

* Implement PDMA

* Fix conditional

* Clean up constructors

* Fix test

* Move stuff to utils

* Extract any macros

* Merge PeripheralMarker defs into peripherals macro

* Changelogs

* Implement fn degrade

* Changelog num

* Fix typo

* Rename type-erased dma channel

* Remove degrade fn

* Remove utils

* Explain peripherals macro
2024-10-21 14:03:14 +00:00
Dániel Buga
7ca1b4376f
Erase DMA type params (#2261)
* Split PdmaChannel into two

* Take &self in PDMA traits

* Implement type-erased PDMA channels

* Remove Degraded assoc type

* Move degrade fns to base trait

* Use PeripheralDmaChannel on constructors only

* Remove WithDmaAes use

* Erase DMA type params

* Clean up examples/tests

* Remove redundant trait bounds

* Remove peripheral-specific DMA traits

* Document i2s change

* Clean up parl_io

* Deduplicate InterruptAccess

* Fix cfg

* Implement runtime compatibility check

* Clean up a bit

* Document changes

* Swap Channel type params, erase dma channel

* Unsplit traits

* Remove redundant cfg

* Fix docs

* Simplify DmaEligible

* Remove unsafe code

* Revert "Swap Channel type params, erase dma channel"

This reverts commit 415e45e44b297fd3cb55b4261c9ce151cca4b9c9.

* Allow different degraded DMA types

* Allow converting into peripheral-specific DMA channel, use it for compat check

* Erase PDMA types without AnyPdmaChannel

* Hide degrade fns for now, remove from MG

* Clean up SPI slave

* Fix QSPI test

* Fix mem2mem, fix S3 peripherals

* Fix S2

* Remove AnyPdmaChannel

* Remove PeripheralDmaChannel

* Remove unnecessary degrade call
2024-10-08 14:09:27 +00:00
Dániel Buga
c7a2368845
Print test panics using semihosting (#2257)
* Print panic messages using semihosting

* Don't use defmt's asserts

* Make RA_OFFSET available without panic-handler

* Re-add defmt imports where missing

* Revert unintended test change

* Initialise hal in critical-section test

* Disable defmt in tests by default
2024-10-04 06:31:39 +00:00
Dániel Buga
c481c49888
Fix incorrect QSPI setup (#2231)
* Fix QSPI mode on non-ESP32

* Update tests to count pulses on pins separately

* Fix ESP32 addressing phase issue

* Use defmt's assert

* Set fastrd bit

* Apply pulldowns to define signal level when not driven

* Transfer address bits in data phase on ESP32

* Changelog

* Use a separate buffer for the address, make the workaround configurable

* Remove now-unnecessary additions

* Force SpiDma to remain Send

* Clarify wording, remove prefix

* Clean up manual register manipulation

* Fix byte order
2024-09-26 15:28:18 +00:00
Dániel Buga
5076d1ee8f
DMA macro cleanup (#2226)
* Fix typo

* Deduplicate dma macro implementations

* Remove accidental defmt

* Extract count macro, use const block
2024-09-25 07:16:48 +00:00
Dániel Buga
89d9de67eb
Enable QSPI tests on ESP32 and clean up (#2198)
* Clean up qspi test cfgs, enable on ESP32

* Correct comments

* Clean up init_spi_data_mode

* Fix qspi_write on ESP32

* Further cleanup in SPI driver

* Clean up qspi_read

* Fix qspi_write_read test on ESP32

* Merge QSPI tests

* Clean up test

* Attempt to fix test GPIO assingment

* Update esp-hal/src/spi/master.rs

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

* Update esp-hal/src/spi/master.rs

* Make sure pins have no internal pullups

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2024-09-23 08:37:35 +00:00