8 Commits

Author SHA1 Message Date
Dániel Buga
280caad378
RISC-V: Make atomic emulation opt-in (#904)
* RISC-V: Make atomic emulation opt-in

* Update embassy-executor, embassy-sync

* Don't automatically enable portable-atomic

* Update changelog

* Fix warnings
2023-11-10 11:51:47 +00:00
sanxus
c196b67587
Improve spi master constructor (#901)
* make pins optional for Spi::new (master, full-duplex mode)

* add additional method to setup spi pins (master, full-duplex mode)

* add additional method to setup spi pins (master, half-duplex mode)

* remove generic type parameters for Spi::new

* update documentation

* make `with_pins` could be chained

* update CHANGELOG.md

* update CHANGELOG.md

* make the return value of a method like `with_{*}` owned

* fix (maybe?) all broken examples caused by the change (esp32-hal)

* fix (maybe?) all broken examples caused by the change (esp32c2-hal)

* fix (maybe?) all broken examples caused by the change (esp32c3-hal)

* fix (maybe?) all broken examples caused by the change (esp32c6-hal)

* fix (maybe?) all broken examples caused by the change (esp32h2-hal)

* fix (maybe?) all broken examples caused by the change (esp32s2-hal)

* fix (maybe?) all broken examples caused by the change (esp32s3-hal)

* rerun 'cargo fmt' for esp-hal-common

* rerun 'cargo fmt' for the rest of examples
2023-11-08 12:11:58 +01:00
Jesse Braham
33bfe80d95
Prelude improvements/fixes (#860)
* Move SPI-related traits into their own preludes in the `spi` module

* Remove the `embedded-hal-async` trait re-exports and the `eh1` module from the prelude

* Update `CHANGELOG.md`
2023-10-20 06:56:17 -07:00
Jesse Braham
f81dc50748
Refactor the spi and spi_slave modules into a common spi module (#843)
* Refactor the `spi` and `spi_slave` modules into a single `spi` module

* Update import paths in examples as needed

* Extract some common types from `spi::master` into the root `spi` module

* Fix imports in examples (again)

* Documentation fixes/improvements

* Remove unnecessary re-exports

* Update `CHANGELOG.md`
2023-10-11 11:38:38 -07:00
Scott Mabin
db409ffe7b
Unify the system peripheral (#832)
* Unify the system peripheral

Whilst the PCR, SYSTEM and DPORT peripherals are different, we currently
use them all in the same way. This PR unifies the peripheral name in the
hal to `SYSTEM`. The idea is that they all do the same sort of thing, so
we can collect them under the same name, and later down the line we can
being to expose differences under an extended API.

The benifits to this are imo quite big, the examples now are all identical,
which makes things easier for esp-wifi, and paves a path towards the
multichip hal.

Why not do this in the PAC? Imo the pac should be as close to the
hardware as possible, and the HAL is where we should abstractions such
as this.

* changelog
2023-09-29 08:14:50 -07:00
Jesse Braham
0064766ef2
No longer publicly expose the PeripheralClockControl struct (#817)
* No longer publicly expose the `PeripheralClockControl` struct

* Update examples as needed to get things building again

* Update CHANGELOG.md

* Address review feedback, fix a warning

* Use a critical section for all devices other than the ESP32-C6/H2, as they modify multiple registers

* Rebase and update `etm` driver to fix build errors
2023-09-26 09:07:57 -07:00
Jesse Braham
d12a3dbac5
Update all examples to remove unnecessary disabling of watchdogs (#768)
* Update `esp32-hal` examples

* Update `esp32c2-hal` examples

* Update `esp32c3-hal` examples

* Update `esp32c6-hal` examples

* Update `esp32h2-hal` examples

* Update `esp32s2-hal` examples

* Update `esp32s3-hal` examples

* Fix the `ram.rs` examples
2023-08-31 07:17:12 -07:00
Jesse Braham
d86300f799
Add all SPI examples for the ESP32-H2 (#549)
* Update the `GDMA` driver to support the ESP32-H2

* Update the `SPI` driver to support the ESP32-H2

* Add `SPI` examples for ESP32-H2

* Update CHANGELOG

* Remove copy-pasted references to ESP32-C6

* Update GPIO pins used in SPI examples, add `qspi_flash` example

* Update SPI clock configuration to produce correct clock rate

* Correct comment regarding clock source frequency

Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>

* H2: Add PLL_48M_CLK src to ClockControl and RawClocks

* H2: Use PLL_48M_CLK as SPI clk src

* H2: cleanup commented block in SPI driver

* H2: update docs comment in embassy_spi example

* fmt

* Add a new line in embassy_spi example

---------

Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
2023-05-31 09:49:13 +02:00