Commit Graph

225 Commits

Author SHA1 Message Date
Jesse Braham
4238a630fc
Assorted analog-related simplifications/clean up (#857)
* Remove duplicated `analog` modules, which are not necessary

* Merge the `SarAdcExt` and `SensExt` traits into a single `AnalogExt` trait

* Clean up/simplify the analog module a bit

* Update `CHANGELOG.md`
2023-10-19 13:37:14 +02:00
Jesse Braham
2d2561024f
Replace SpiNInstance marker traits with concrete types (#853)
* Replace `SpiNInstance` marker traits with concrete types

* Update `CHANGELOG.md`
2023-10-17 06:16:07 -07:00
Jesse Braham
0c8dd59163
Add a defmt feature to esp-hal-smartled (#846)
* Add a `defmt` feature to `esp-hal-smartled`

* Update `CHANGELOG.md`
2023-10-12 11:21:30 -07:00
Dániel Buga
5365031d9d Support SysTimer as timebase on ESP32-S2 2023-10-12 10:15:35 -07:00
Jesse Braham
c6af8ba88b
Assimilate lp-hal-procmacros into esp-hal-procmacros (#845)
* Assimilate `lp-hal-procmacros` into `esp-hal-procmacros`

* Update `CHANGELOG.md`
2023-10-12 06:58:37 -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
Björn Quentin
a0ebdf0399
embassy #[main] convenience for RISC-V / Xtensa (#841) 2023-10-11 12:10:14 +01:00
Bryan Kadzban
0aa0232f1b
SPI slave support (#580)
* Duplicate spi to spi_slave

* Restore spi

* Add barebones SPI slave mode, DMA only.

This setup allows registering buffers for future transactions the master
does (lowering cs, toggling sclk, and raising cs again). The transfer
struct returned from the registration API will complete its wait() or
return true from is_done() after cs has been raised.

Copied from spi.rs, so most of the changes are deleting code that
handles e.g. segmented transfers or synchronous operations.

Fix non-c3 devices' builds

* Limit spi_slave to non-pdma devices

* SPI slave DMA example

Ensure the API "feels" right.

Since there's no way to route GPIOs to other peripherals, we choose four
other wires and bit-bang SPI for the master side, relying on the person
running the example to connect the bus.  This way we ensure the slave
code works, since we created the master ourselves.

Also, it's not really possible to use a second ESP device as the master
anyway: all the digital lines have glitches on startup, and those
glitches cause the slave's DMA engine to skip descriptors (it thinks
they're intended CS indicators); this causes it to lose data.

Then, fix the bitbang master (recording the progression here)

- When bitbanging, iterate the bits by "for _ in 0..8", instead of the
  broken "for _ in [0..8]".  The latter only runs the iteration once,
  since there's only one list given ... and because the code uses _
  instead of a real loop variable, type checking didn't save us.
- When bitbanging, send the bits out (and read them in) MSB first, since
  that's actually how we have the slave configured.

* Add changelog entry

* Split DMA prepare_transfer into two fns.

The first does everything but write to the start bit and check for an
error. The second does those. We need 2 fns because the  SPI slave needs
to start the transfer only after resetting the various afifo hardware
components (if it starts the transfer before, the first 8 bytes will be
lost when that reset happens).

Use the split fns everywhere.

Also split flush().  It needs to be pollable, so split it into one fn that
polls and one that waits until the poll returns clear. Also call the poll
fn from the is_done() fn, so we don't trample in-progress transfers.

* Make example code fill rx buffer before transfer

This way we can tell if it's ever touching certain bytes - 0xff is never
added to the master transmit buffer.

While I'm changing this, make the slave tx buffer never contain 0xff
either (go from 254 to 0).

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-10-10 09:00:18 -07:00
Björn Quentin
47821e6b3b
Add ULP RISC-V HAL (#840) 2023-10-10 16:32:52 +02:00
Dániel Buga
44e968f7a8
Make sure examples can actually build with defmt enabled, build some examples in CI (#810)
* Make sure examples can build with defmt

* Remove duplicate example checks

* Fix examples

* Add changelog entry

* Actually build some examples with defmt feature enabled

* Add the defmt linker script in each package's build script
2023-10-05 12:13:09 -07:00
Jesse Braham
6ab08efd6b
Do not implement async delay for SYSTIMER if the embassy-time-systick feature is enabled (#839)
* Do not implement async delay for `SYSTIMER` if the `embassy-time-systick` feature is enabled

* Update CHANGELOG.md
2023-10-05 09:35:12 -07:00
Jesse Braham
edd6c16637
Replace any underscores in feature names with dashes (#833)
* Replace any underscores in feature names with dashes

* Update `CHANGELOG.md`
2023-09-29 16:36:09 +01: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
jneem
d819945522
Sleep support for esp32c3 (#795)
* Make the example work

* Make GPIO wakeups work

* Add example

* revert hello_rgb change

* Clean up the first hacky version

* Fix example warnings

* Add changelog entry

* Fix example comment

* Stop skipping rustfmt
2023-09-29 08:09:50 -07:00
Jesse Braham
d316e24df6
Unify the ESP32's and ESP32-C2's xtal frequency features (#831)
* Unify the xtal frequency features for ESP32 and ESP32-C2

* Group and re-organize features for `esp-hal-common`

* Update `esp-hal-smartled` and fix its CI check

* Update `CHANGELOG.md`

* Update feature names in documentation
2023-09-29 07:40:01 -07:00
Scott Mabin
ab775e7106
Fix last changelog entry (#829) 2023-09-28 14:14:33 +01:00
Björn Quentin
547f6db6ce
Add SYSTIMER ETM (#828)
* Add SYSTIMER ETM

* Remove logger-init from examples
2023-09-28 11:59:50 +02:00
Juraj Sadel
ca4e1b3a26
(G)DMA AES working mode support (#821)
* Add (G)DMA AES initial support

* Modify AES examples to the driver changes

* Add DMA examples(tests)

* fmt

* changelog

* review changes

* typo
2023-09-27 09:08:14 -07:00
Kirill Mikhailov
24c5e8cb79
Adding async support for RSA peripheral (#790)
* Adding async support for RSA peripheral

* Add esp32 support (doesn't work properly yet)

* Xtensa chips are supported (except of esp32)

Add modular multiplication for esp32

Adding a CHANGELOG entry

Rebase issue fix

* Code cleanup

* Add `.await` on `RsaFuture::new()` calls

* Refactor and rebase

Made `read_results` functions to be `async`, got rid of `nb` usage

* Change API methods naming + refactor `start_step2` method

* Adjust example to the API change + documentation

* Code cleaning + refactoring

Update examples
2023-09-27 09:03:06 -07:00
Björn Quentin
94cd593a45
Make sure to use ESP32Reset - not Reset as entry (#823)
* Make sure to use ESP32Reset - not Reset as entry

* Add CHANGELOG.md entry
2023-09-27 16:13:17 +02: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
Björn Quentin
774d5c4f21
Add ETM, Add GPIO ETM (#819)
* Add ETM, Add GPIO ETM

* Add CHANGELOG.md entry
2023-09-26 12:56:09 +02:00
Jesse Braham
b91b3b1b77
Implement embedded_hal_async::delay::DelayUs trait for SYSTIMER alarms (#812)
* Implement `embedded_hal_async::delay::DelayUs` trait for `SYSTIMER` alarms

* Update CHANGELOG.md

* Address review feedback
2023-09-25 07:33:47 -07:00
Mariusz Białończyk
56b8eddb22
Update CHANGELOG.md (#815) 2023-09-25 09:23:37 +02:00
jneem
ced8088fe9
Make ADC reads return u16s, not generic types (#792)
* Make ADC reads return u16s, not generic types

* Changelog entry

* Add the PR number to the changelog

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-09-22 07:49:59 -07:00
Scott Mabin
eeb2d1db6f
Fix UART to handle CPU/APB clock changes (#808)
* Ensure that uart is configured to account for clock changes, not just boot defaults

* fix examples

* changelog

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-09-21 09:06:56 -07:00
Björn Quentin
24edf7bdc4
Async PARL_IO support (#807)
* Async PARL_IO support

* Add CHANGELOG.md entry
2023-09-21 17:34:53 +02:00
Dániel Buga
996ec49878
Optimize multicore critical section impl (#797)
* Optimize multicore critical section impl

* Assert reserved bits, explain bit choices, remove redundant checks

* Don't assume the bit reads as 0

* Simplify code generated for thread_id()

* Use non-0 value for unlocked

* Optimise release

* Assume reserved bits read as 0

* Add changelog entry

* Clean up warning

* Fix direct boot ld
2023-09-21 15:59:53 +01:00
Sergio Gasquez Arcos
a4edb0dfc9
Fix SHA registers access (#805)
* fix: Fix SHA registers access

* build: Update esp32s3 pacs

* docs: Update changelog
2023-09-21 06:18:56 -07:00
Mariusz Białończyk
240b2057f6
esp-hal-common: uart/ESP32: fix get_rx_fifo_count() (#804)
Currently the `get_rx_fifo_count()` is using `fifo_cnt`, which is unreliable
for ESP32, according to the errata:
https://www.espressif.com/sites/default/files/documentation/esp32_errata_en.pdf
section 3.17

This commit is fixing the code for the ESP32 according to the
workaround example.

Main discussion and my debugging results:
https://github.com/esp-rs/esp-hal/discussions/765
2023-09-21 12:25:31 +08:00
Björn Quentin
434a32763c
Async I2S support (#801)
* Async I2S support

* Add CHANGELOG.md entry
2023-09-20 22:23:50 +00:00
Georges
107732b111
Add support for splitting esp32 uart into TX and RX (#754)
* Add support for splitting esp32 uart into TX and RX

* Keeps existing API for uart, but wraps it in Tx and Rx sub-types
* Adds split() method similar to embassy-rs nRF/stm32/rp for getting indepdendent TX and RX
parts
* Implements e-h traits for TX and RX types
* Add esp32s3 example

* finish implementing

* rebase examples

* declare new examples

* fix fmt

* rebase on 0.12.0

* fix fmt

* fix fmt

* merge embassy_serial_split example with embassy_serial

* fix changelog

* fix changelog
2023-09-20 13:19:34 +01:00
Juraj Sadel
856f0d1881
ECC peripheral support for ESP32C2, ESP32C6, and ESP32H2 (#785)
* Add ECC driver for ESP32C2 and ESP32C6

* Add ECC example for ESP32C2 and ESP32C6

* Add and modify dependencies

* ESP32H2: Add ECC driver support

* ESP32H2: Add ECC example

* ESP32C2 and ESP32C6: clean examples

* changelog

* refactor: remove enable_interrupt() and clear_interrupt()

* refactor: remove ugly if/else logic for padding
2023-09-19 05:24:32 -07:00
Jesse Braham
2badf86705
Bump the MSRV to 1.67, check the defmt feature in MSRV check (#798)
* Bump MSRV to 1.67, check with `defmt` feature enabled in MSRV checks where applicable

* Add `esp32c6-lp-hal-procmacros` package to VS Code workspace

* Update `CHANGELOG.md`
2023-09-19 05:19:55 -07:00
Dániel Buga
6d936680ea
Fix s3 RC_FAST_CLK powerdown (#796) 2023-09-18 12:45:09 +02:00
Mateusz
08a4722ca2
Add new_no_miso to Spi FullDuplexMode (#794)
* Add new_no_miso to Spi FullDuplexMode

* adjust changelog
2023-09-18 11:50:19 +02:00
Dániel Buga
04a23f8946
Remove unused Pin methods, optimize GPIO interrupt handler (#793)
* Remove unused methods from Pin

* Avoid CPU ID lookup on S3

* Split up gpio handling into two loops

* Remove trace print

* Add changelog entries
2023-09-18 11:37:05 +02:00
Dániel Buga
976549f440
Add defmt::Format to error enums (#786) 2023-09-14 20:16:41 +01:00
Björn Quentin
a0e5737a22
Macro to load LP core code (#779)
* Macro to load LP core code

* Fix imports, add CHANGELOG.md entry

* Avoid code warning

* Omit path from function signature

* More error checking

* Clippy fix

* Include the ELF used by the lp_core_basic example

* Make object dependency optional

* Use 1.65 for RISCV MSRV check

* Use RUSTC_BOOTSTRAP for RISCV MSRV check

* Remove the pre-compiled LP core example

* Pin toml_edit in esp32c6-lp-hal-procmacro
2023-09-14 12:16:12 +02:00
Björn Quentin
a642ee40da
Async RMT (#787)
* Async RMT

* Add CHANGELOG item

* Pin toml_edit transitive dependency
2023-09-13 09:02:36 +02:00
Björn Quentin
4c34ebe9e2
Add ESP32-C6 BLE clock enable/disable (#784)
* Add ESP32-C6 BLE clock enable/disable

* CHANGELOG.md
2023-09-06 16:36:08 +01:00
Jesse Braham
26b929d6da Begin next release cycle 2023-09-05 08:16:35 -07:00
Jesse Braham
ad74108e00 New package releases 2023-09-05 07:47:49 -07:00
Jesse Braham
ea5a8226fb Create separate CHANGELOG.md files for esp-riscv-rt and esp32c6-lp-hal 2023-09-05 06:57:05 -07:00
Jesse Braham
ce3933cf6d
Fix number of ADC attenuations for ESP32-C6 (#771)
* Fix number of ADC attenuations for ESP32-C6

* Update CHANGELOG
2023-09-05 06:31:45 -07:00
Dániel Buga
7866896b70
Add defmt support, make log optional (#773)
* Executor related touchups

* Make log optional

* Add defmt feature and derive on Debug structs

* Test both log drivers

* Update esp-println

* Document defmt msrv
2023-09-04 11:29:44 +01:00
Kirill Mikhailov
2f5ebad9fe
Update Clock module documentation (#774)
Added a record to Changelog

Fix typo
2023-09-01 09:51:22 -07:00
Jesse Braham
4dd9fbdb7b
Disable all watchdog timers at startup by default (#763)
* Rework watchdog timer drivers to allow enabling/disabling and feeding without traits

* Disable all watchdogs prior to `main` using the `__post_init` hook

* Update all watchdog-related examples

* Update CHANGELOG

* Address review comment
2023-08-30 08:54:01 -07:00
Dániel Buga
32d1ea0d42
Add missing conversion (#764) 2023-08-30 09:16:57 +02:00
Dániel Buga
92a2cc7c31
Update to embassy-executor 0.3 (#756) 2023-08-29 10:39:17 -07:00
Björn Quentin
9a894879a7
PARL_IO RX for ESP32-C6 / H2 (#760)
* PARL_IO RX for ESP32-C6 / H2

* Add PARL_IO RX to README.md

* Remove logger-init from PARL_IO_RX examples
2023-08-29 18:48:37 +02:00
Dániel Buga
e082d47a87
Multicore-aware executors (#723)
* Implement multicore-aware executors

* Add examples

* Use pre-defined config to import SystemPeripheral

* Use static_cell::make_static
2023-08-28 10:05:42 -07:00
Anthony Grondin
91b9b51426
feat(hmac): Add HMAC driver for hardware acceleration (#755)
* feat(hmac): Add HMAC driver for hardware acceleration

Driver code taken from: a9807ae67d

* fix build for target without hmac support.
2023-08-28 08:54:41 +02:00
Anthony Grondin
5a8be302b4
Move alignment helper to its own module in preparation of HMAC module (#753)
* Move alignment helper to its own module.

* fix wrong endian on ESP32

- Add CHANGELOG.md entry
- Change reg_access module visibility
2023-08-24 12:26:30 -07:00
Dániel Buga
6c2659f9e4
S3: GPIO wakeup source with RTC_IO pins (#690)
* Remove unnecessary Pin bounds

* S3: Add RTC_IO wakeup source

* Add s3 example

* Add changelog entry

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-08-23 10:54:51 -07:00
Björn Quentin
95a1255c3b
PARL_IO TX driver (#733)
* PARL_IO TX driver

* Update CHANGELOG.md

* Update esp-hal-common/src/dma/mod.rs

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

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-08-23 10:32:13 -07:00
Jesse Braham
9acb915fb9
Implement the ufmt_write::uWrite trait for the USB Serial JTAG driver (#751)
* Implement the `ufmt_write::uWrite` trait for the USB Serial JTAG driver

* Update CHANGELOG
2023-08-23 08:24:47 -07:00
Dániel Buga
bf4efcfd7f
Take FnOnce closure by value in start_app_core (#739) 2023-08-22 16:33:32 +02:00
Jesse Braham
7fce6e32f2
Update to 1.0.0-rc.1 version of embedded-hal-* crates (#747)
* Update a bunch of dependencies

* Implement `embedded-io` and `embedded-io-async` traits for USB Serial JTAG

* Implement `embedded-io` and `embedded-io-async` traits for UART

* Fix `embassy_serial` examples

* Update CHANGELOG

* Address review comments
2023-08-22 14:53:41 +01:00
Dániel Buga
db62ad5948
Timer driver improvements (#737)
* Slightly refactor systimer driver

* Remove redundant check

* Start timer on init

* Delete semicolon for consistent styling

* Add to changelog

* Remove unused code

* Remove unsafe code
2023-08-22 12:20:05 +01:00
Dániel Buga
eb8acaf4d4
Set alarm on correct timer (#730) 2023-08-16 12:54:54 +01:00
M4tsuri
9d5afbf1f5
Fixed wrong dram_seg length in esp32s2-hal linker script (#732) (#734)
* Fix size of ram_seg in ld script

* Update CHANGELOG.md
2023-08-16 13:26:52 +02:00
Jesse Braham
2dee0110be
[ESP32-C6-LP] Add input support for IO driver, implement more embedded-hal output traits (#720)
* Add input support for IO driver, implement more `embedded-hal` output traits

* Update CHANGELOG
2023-08-14 07:45:17 -07:00
Dániel Buga
a2ae6f37d1 Implement RTCIO pu/pd and hold control 2023-08-14 07:27:31 -07:00
Björn Quentin
92bda00296
Remove heap related symbols, use all remaining memory for the stack (#716)
* Use all remaining memory for stack(s)

* Remove HEAP related code from RISCV linker scripts

* Fix direct-boot / mcu-boot linker scripts

* Use a statically allocated stack for core-1
2023-08-14 13:38:36 +02:00
Jan Sosulski
659cdffcba
Fix psram check in esp-hal-common build.rs (#718)
* Fix psram check in esp-hal-common build.rs

* Update changelog.
2023-08-13 13:42:51 +00:00
Björn Quentin
bbe1e5df59
ESP32-C6 LP CORE delay and basic gpio (#715)
* ESP32-C6 LP CORE delay and basic gpio

* CHANGELOG.md, build LP examples in release mode
2023-08-12 14:04:25 +00:00
Jesse Braham
64556da803
Create the esp32c6-lp-hal package (#714)
* Create the `esp32c6-lp-hal` package

* Update CHANGELOG
2023-08-10 09:48:46 -07:00
Jesse Braham
846f3b0b50
New package releases (#713)
* Add/update `rust-version` to manifests where it is missing or out of date

* Use latest versions of published PACs

* New package releases
2023-08-10 08:44:15 -07:00
Scott Mabin
47b987fb66
Add FlashSafeDma wrapper for eh traits which ensure correct DMA transfers from flash (#678) 2023-08-09 13:07:20 -07:00
Björn Quentin
4ba618c875
Make sure to use wrap-mode for RMT TX (ESP32/S2) (#710)
* Make sure to use wrap-mode for RMT TX (ESP32/S2)

* Update CHANGELOG.md
2023-08-09 06:56:10 -07:00
Kirill Mikhailov
2bd10526a7
Documenting a number of peripherals and packages (#680)
* Initial documentation improvements

* More documentation improvements

* More documentation improvements


More modules documented

* Finished SOC documentation for esp32 + TWAI

* Fix: fix incorrect formatting

* Adding more documentation to rom, and soc peripherals for multiple chips

* Adding documentation for multiple peripherals

* Adding SOC module documentation

* Analog and clock modules are documented

* Adding module-level documentation for DMA and INTERRUPT peripherals

* Finishing job + minor fixes

* Fix unopened HTML break

* Rustfmt adjustment 


formatting


Fix typo

* Add CHANGELOG record


Fix typo

* Fix typos, mistakes, improving docs

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

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

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

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

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

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

Co-authored-by: Scott Mabin <scott@mabez.dev>
Fixing typos, mistakes, improving docs.

* Fix formatting, mistakes and typos

* Fixing a bunch of logical, grammatical and formatting mistakes
2023-08-09 06:33:50 -07:00
Dániel Buga
4baf0b96c6
Fix ESP32 radio clock code writing incorrect registers (#709)
* Fix ESP32 radio clocks

* Blanket-enable radio clocks
2023-08-08 08:22:07 +02:00
Dániel Buga
da497c8833
Fix ESP32-{S2/C2/C3} radio clocks (#681)
* Fix ESP32S2 radio clocks

* Fix C2

* Fix C3

* Fix changelog
2023-08-07 17:13:49 +02:00
Dániel Buga
544a966b40
Fix esp32s3 radio clocks (#679) 2023-08-07 15:37:03 +02:00
Scott Mabin
2f091161b4
Add ClockControl::max helper (#701)
* Add `ClockControl::max` helper

* Add changelog

* remove unneeded allow(unused)

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2023-08-02 06:47:32 -07:00
onsdagens
d6d5e0c86b
Adding direct vector table hooking support for RISC-V's (#621)
* direct vectoring support added

* provide minimal handlers for hooking the vector table directly

* changed direct vectoring interrupt enable interface to map to CPU interrupt

* direct vectoring interrupt nesting

* removed unused dependency

* added tentative c2 and c6 support for direct vector table hooking

* added direct vectoring examples

* added direct vectoring examples

* updated changelog

* added direct vectoring to CI

* Added H2 support and example, moved helpers to esp-hal-common

* Added H2 direct vectoring example to CI

* Removed remnants of removed feature

* C6 and H2 examples fixed

* C6 and H2 examples fixed

* C6 and H2 examples fixed

* Comment fixed

* Added preemption flag to RT

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2023-08-01 16:28:40 +01:00
Dániel Buga
822497b989
Clean up register access (#696) 2023-08-01 15:31:35 +01:00
Scott Mabin
18e803075b
Switch to micros instead of millis in set_periodic (#686)
* Switch to micros instead of millis

* Add changelog entry
2023-07-31 05:50:51 -07:00
Dániel Buga
fedd2ad0bc
Pin and RTCPin improvements (#687)
* Make Pin a supertrait

* Make Pin object-safe

* Add to changelog
2023-07-28 11:59:36 +01:00
Dániel Buga
c529d82599
Deep sleep: Decouple pin and slice lifetime (#689)
* Decouple pin and slice lifetime

* Add PR to changelog
2023-07-28 11:54:23 +01:00
Jesse Braham
00fac71b68
Update the PACs and resolve breaking changes, simplify rmt driver (#695)
* Update to latest (unreleased) versions of PACs

* Update `SDMCC` peripheral to `SDHOST` for ESP32

* Fix `USB_DEVICE` interrupts

* Fix references to various renamed GPIO fields for ESP32-S2

* Update and re-organize the `rmt` driver

* Update CHANGELOG
2023-07-27 23:16:39 +01:00
Jesse Braham
a95f6efb35
Update esp-hal-smartled to use the new rmt driver, remove old pulse_control driver (#694)
* Remove the old `pulse_control` driver

* Update `esp-hal-smartled` to use the new `rmt` driver instead

* Update the `hello_rgb` example for each chip

* Update CHANGELOG
2023-07-27 16:07:15 +01:00
Alex Johnson
debe2b8004
fixed async read w/o at_cmd (#652)
* fixed async read w/o at_cmd

* configurtion checks  for async `read`

* remove fifo thrhd check
2023-07-25 12:19:59 +01:00
Dániel Buga
9f5e2b59de
ESP32-S3 deep sleep (#660)
* Add changelog entry

* Copy esp32 impl, update RtcSleepConfig

* implement apply

* extract rtc_sleep_pu

* Implement base_settings based on esp-idf rtc_init

* Hide CPU-specific sleep code

* Set base_settings when constructing Rtc

* Add s3 deep sleep defaults

* Implement finish_sleep

* Turn magic constant into enum

* Clear ext1 wakeup status

* Add wakeup source impls

* Add examples
2023-07-24 20:20:30 +01:00
Dániel Buga
2472b6d7a9
Implement calibrated ADC API for S3 (#641)
* adc_cal: s3: Add efuse functions for reading calibration

* Add changelog entry

* Implement calibrated ADC API for S3

* adc_cal: s3: Add calibrated ADC reading example

* Clean up

* Prefer where clauses

* Clean up unnecessary unsafe blocks

* Fix autolinks

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2023-07-24 17:45:19 +01:00
C2D
d4f5afac67
MCPWM DeadTime configuration (#406)
* Add Initial MCPWM DeadTime configuration

* Add option to use other channel for action trigger

* Fix build for non-esp32s3 (register name difference)

* Fix changelog build & add a way to update RED/FED after construction

* Fix regs
2023-07-24 08:39:10 -07:00
Kirill Mikhailov
211fc0f8a0
Implementing async feature for USB Serial/JTAG peripheral. (#632)
* Implementing ASYNC features for USB_SERIAL_JTAG (work in progress)

Fix: Interrupt name

* Async works for USB Serial/JTAG 

PS. : Yet only for esp32c3, we need to update PACs
Temporary example fix

* Adjustment for different chips

+ Update examples according to upstream
+ Code cleaning


Rust format

* Add record to the CHANGELOG

* Code cleaning, getting rid of useless generic argument


Typo fix


Fix fmt
2023-07-24 07:33:15 -07:00
Björn Quentin
170d590b67
Make in-progress DMA transfers potentially fallible (#665) 2023-07-22 20:14:57 +01:00
Dániel Buga
b0126243c0
Fix GPIO interrupt status not being cleared (#670)
* Fix clearing interrupt status

* Use simpler way to clear bits

* Add note about xtensa

* Add to changelog
2023-07-22 20:03:35 +01:00
Dániel Buga
d89bd546e9
Fix RMT spelling (#667) 2023-07-21 11:43:52 +02:00
Scott Mabin
28ac202f1a
esp32s3: usb-serial-jtag interrupt (#664) 2023-07-19 15:48:08 -07:00
Björn Quentin
213dde9304
Add a new RMT driver (#653)
* Add a new RMT driver

* Add CHANGELOG entry

* Fix typos
2023-07-19 10:54:52 -07:00
Kazuki.Iida
fe1965e322
ESP32-S3: Disable usb_pad_enable when setting GPIO19/20 to input/output (#663) 2023-07-19 08:57:05 +02:00
liebman
37466fd9c7
deep sleep api for esp32 (#574)
* deep sleep api for esp32

* move to list of wakeup sources

* improve Ext0WakeupSource - still WIP

* add deep sleep with timer wakeup example
add Ext0 wakeup source (WIP/Non-working)

* removed alloc (using heapless now)

* Sleep: ext0 wakeup working

* add sleep_timer_ext0 example

* API change: move sleep into RTC as sleep, sleep_deep, sleep_light

* fix sleep examples for new API

* sleep only implemented for esp32 at this time

* sleep only implemented for esp32 at this time

* Implement a simple RTCPin trait to support sleep

* implement RTCPin for all xtensa SOC

* cargo fmt & update changelog

* fix change log order (accidentally swaped during rebase)

* implement Drop for Ext0WakeupSource

* added Ext1 wakeup source

* cargo fmt

* healpess was unused, removed

* fix pase macro usage
2023-07-14 15:44:13 +00:00
Jesse Braham
b0382c8fa1
Remove the allow-opt-level-z feature from esp32c3-hal (#654)
* Remove the `allow-opt-level-z` feature from `esp32c3-hal`

* Update CHANGELOG
2023-07-14 10:30:56 +01:00
Björn Quentin
24174c840c
Update esp-synopsys-usb-otg (#656)
* Update `esp-synopsys-usb-otg`

* Add PR number to CHANGELOG.md
2023-07-14 11:22:34 +02:00
Jesse Braham
58651f03b6
Derive the Clone and Copy traits for the Rng driver (#650)
* Derive the `Clone` and `Copy` traits for the `Rng` driver

* Update CHANGELOG
2023-07-12 07:11:32 -07:00
Björn Quentin
f7831be7ae
Add basic LP_IO support (#639)
* Add basic LP_IO support

* Add CHANGELOG.md entry

* Fix after rebase
2023-07-07 10:08:52 +02:00
Jesse Braham
49b2a3bf21
Update embedded-hal-* alpha packages to their latest versions (#640)
* Update `embedded-hal-*` alpha packages to their latest versions

* Update CHANGELOG

* Remove unnecessary patch
2023-07-05 09:09:07 -07:00