1924 Commits

Author SHA1 Message Date
Davo
9a28bdfdbd
ADC: Add async support for oneshot reads for esp32c3 and esp32c6 (#2925)
* ADC: Add async support for oneshot reads for esp32c3 and esp32c6

* ADC: change interrupt waking logic

- fix migrating document
- add ADC2 reading qa example and fix sensor reading

* ADC: run `cargo xtask fmt-packages`

* ADC: remove TODO comment
2025-01-31 07:52:47 +00:00
Dániel Buga
6aa17819a5
DMA test: Avoid starving out thread-mode executor (#3064)
* Avoid looping without delay

* Avoid starving out thread-mode executor

* Clean up a bit
2025-01-30 17:14:54 +00:00
Juraj Sadel
e513f1ba8a
Use #[instability::unstable] where possible, cleanup and improve consistency (#3055)
* Use #[instability::unstable] where possible, cleanup and improve consistency

* De-duplicate marking SpiDma as unstable

* Remove #[unstable] from private structs, functions and inherent impl blocks, address review comments

* Don't mark uWrite as unstable

* API guidelines entry

* mark uWrite unstable again

* Make SetConfig and InterruptConfigurable consistent and add inherent set_interrupt_handler functions vol.2

* warnings
2025-01-30 16:40:14 +00:00
Dániel Buga
0ddcbf5647
Fix async SPI with ESP32 (#3057)
* Fix async SPI on ESP32

* Add note
2025-01-30 12:16:14 +00:00
Björn Quentin
6c2fd59e0b
Avoid unwrap in examples (#3050)
* Avoid `.unwrap`

* Less `unwrap` in examples

* de-noise UART interrupt example code

* Weaken the precalculation recommendation a bit
2025-01-30 11:08:11 +00:00
Dániel Buga
5206436243
Rename api-guidelines and add config sturct guidelines (#3049)
* Rename api-guidelines and add config sturct guidelines

* Relax BuilderLite guideline
2025-01-30 10:08:06 +00:00
Dániel Buga
af6ee36d93
Ability to precompute/cache config register values (#3011)
* Cache bus clock register and support clock source

* Recalculate eagerly to keep Config Copy

* Destabilize UART clock source

* Update I2C

* Changelog

* Refactor builder lite helpers for more flexibility

* Flatten config structs

* Add getters, hide fields

* Hide all config fields

* Fix changelog

* Document the precomputation
2025-01-30 09:44:52 +00:00
Björn Quentin
bb1ad1485a
I2C: Make non-async fn available in async-mode (#3056)
* I2C: Make non-async fn available in async-mode

* PR number
2025-01-29 13:30:35 +00:00
Kirill Mikhailov
2ff28b14b5
Resolve C-FAILURE violations (#3036)
* progress towards C-FAILURE issues

fmt

* reviews

dumb0

* I2C: FIFO cannot be exceeded

fmt
2025-01-28 08:55:06 +00:00
Dániel Buga
ad1b645b0f
Don't register waker if the DMA is done (#3045)
* Don't register waker if the DMA is done

* Update embassy-executor in HIL tests
2025-01-28 08:45:28 +00:00
Dániel Buga
fbca764c85
Don't enable unstable for stable SPI tests (#3047) 2025-01-28 08:19:35 +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
Dániel Buga
6495130492
Fix build-documentation-index UX (#3043) 2025-01-27 16:30:18 +00:00
Björn Quentin
e5836ae52a
Better not block in 802.15.4 sniffer (#3044) 2025-01-27 15:55:46 +00:00
Jesse Braham
570e768bdb
Rework documentation generation functionality of xtask (#3026)
* Rework the `xtask` to build documentation for all packages in the repo

* Fixes for `esp-config` and `esp-storage`
2025-01-27 15:06:56 +00:00
Dániel Buga
5139ff1a48
Remove yml exception for S3 (#3039)
* Remove yml exception for S3

* Fix warnings
2025-01-27 12:59:03 +00:00
Björn Quentin
b0060a1169
Format all sources (#3037)
* List all sources to fmt

* Fix

* Allow formatting specific packages

* Reformat (all) code
2025-01-27 11:40:18 +00:00
Dániel Buga
f7be6a3f6c
Allow specifying env vars for examples/HIL tests (#3028)
* Remove unused CHIP-FEATURES

* Refactor metadata collection

s

* Allow specifying esp-config options

* Document xtask

* Try to explain multiple configurations a bit better
2025-01-27 10:41:31 +00:00
Dániel Buga
24f8458183
Remove DerefMut from PeripheralRef (#3017) 2025-01-24 09:13:19 +00:00
Björn Quentin
f247b4099c
Remove flip-link feature, replace by flip-link option (#3001)
* Fix renamed config options

* Make `flip-link` feature into a config-option

* Remove `psram-quad`/`psram-octal` - replaced by `psram`

* Changelogs

* Fix

* Add `esp_config::Validator::Enumeration`

* Fix HIL-tests

* HIL: use octal psram for the S3

* Fix xtask

* xtask

* examples

* Make `spi-address-workaround` only available on ESP32

* Always allow `cfg(spi_address_workaround)`

* Make config-options valid for all targets
2025-01-23 15:21:46 +00:00
Dániel Buga
e842ec4c6c
Slight GPIO cleanup, un-stabilize Io (#3021)
* Clean up, add fixme

* Destabilize Io, add inherent set_interrupt_handler

* Explicitly mark functions, not the impl block
2025-01-23 15:02:11 +00:00
Juraj Sadel
2bb0a55cd3
Introduce PinGuard and reconnecting an output signal to a different pin now clears previous connections (#3012)
* wip

* Fix and clean up

* Introduce PinGuard and reconnecting an output signal to a different pin clears previous connections

* Add demft for PinGuard

* Keep pins around in SpiDma

* Simplify i2c

* Changelog

* Clean up

* Don't use PeripheralRef directly

* Handle RTS pin

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-01-23 14:04:09 +00:00
Kirill Mikhailov
fc2815b9fc
gpio, spi and i2c::master cleanup, smaller updates (#3010)
* `gpio` and `i2c::master` cleanup, smaller updates

fmt

* spi docs update

* fmt

* alter `split` doc example for different pin types

* address reviews

* adjust to changes after rebase
2025-01-23 12:27:01 +00:00
Björn Quentin
16af010e71
esp-wifi: fix possible deadlock (#3015)
* Fix possible deadlock

* CHANGELOG

* avoid `mem::forget`
2025-01-22 14:21:54 +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
Kirill Mikhailov
67c9159176
Add separate config for Rx and Tx (UART) (#2965)
* wip

* wip2

* derive Default for Config and TxConfig

* Roll back changes related to SharedConfig

* fmt

* sure

* Changelog + migration guide entry

* `tx.apply_config(&TxConfig)` -> `tx.apply_config(&Config)`

 to be consistent

* address review

* Reflect the removal of the rx prefix in migration guide

* reviews + rebase
2025-01-22 09:58:29 +00:00
Dániel Buga
ae35b465bf
Fix DMA not having data available in time (#3003)
* Fix DMA not having data available in time

* Fix not registering I2S interrupts when only using TX
2025-01-21 20:28:15 +00:00
Kirill Mikhailov
3cb90cba62
UART documentation fixes (#2996)
* UART documentation fixes

* reviews

* sure

* reviews
2025-01-21 17:23:15 +00:00
Dániel Buga
537829df36
Remove Deref to pac register block from peripheral singletons (#2956) 2025-01-21 14:12:27 +00:00
Zach Grimaldi
9e4cbbd316
fix: default uart tx_idle_num to 0 (#2859)
* feat: uart configurable `tx_idle_num`

* fix: remove extraneous setter

* fix: use `ConfigError` instead of `assert!`; clarify unit of bit time

* fix: remove unneeded assert

* chore: revert by updating to newest main

* fix: just set to 0

* fix: unsafe on the register modification

* Fix changelog

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-01-21 12:26:57 +00:00
Dániel Buga
5ec8be4af2
Fix LCD_CAM disabling its clocks (#3007) 2025-01-21 10:31:20 +00:00
TheTechRobo
53ba3ce95d
Add support for 32MB flash (#3004)
This doesn't seem to be listed on the "Firmware Image Format" page in
the docs, but it follows the pattern of the other values.

Confirmed working on my ESP32-S3-WROOM-2 with 32MB flash.
2025-01-21 07:34:10 +00:00
Dániel Buga
04ba779f2d
Async: !Send (#2980)
* Actually add inherent set_interrupt_handler fns

* Mark Async drivers !Send
2025-01-20 18:31:02 +00:00
Sergio Gasquez Arcos
9ab751f55f
Update I2C module documentation (#3000)
* feat: Avoid raw md link

* docs: Improve i2c master docs

* fix: Typo

Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>

---------

Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
2025-01-20 16:03:32 +00:00
Benedikt
d1ee2ba733
RMT: Small cleanups (#2991)
* rmt: remove unnecessary generic parameter from *ChannelInternal

* rmt: minor cleanup of clock configuration

simplify usage of cfg attributes

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-01-20 10:46:58 +00:00
flippette
6a8bcfa8df
make esp_wifi::init take impl Peripheral for the RNG source (#2992)
* implement Peripheral<P = Self> for Rng and Trng

* make esp_wifi::init take impl Peripheral for RNG source

* implement Sealed for Rng and Trng

* use Copy impl for Rng in Peripheral::clone_unchecked
2025-01-20 10:45:41 +00:00
Dániel Buga
0894e301c9
Replace pointer derefs with regs function (#2974)
* Do not mix peripheral singletons with PAC types

* Replace pointer derefs with regs function
2025-01-20 08:30:05 +00:00
Dániel Buga
18ef297a47
Remove RtcPin trait impls from Flex (#2938) 2025-01-17 16:41:28 +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
Sergio Gasquez Arcos
c88dbefff8
Avoid using nb::Result as a return type (#2882)
* feat: Avoid using nb::Result in spi

* feat: Avoid using nb::Result in hmac

* feat: Avoid using nb::Result in sha

* feat: Avoid using nb::Result in usb_serial_jtag

* feat: Avoid using nb::Result in adc::read_oneshot

* feat: Avoid using nb::Result in rsa::ready

* feat: Avoid using nb::Result in timer::wait

* feat: Avoid using nb in uart and twai. Udpate examples and tests to avoid using block!

* feat: Block on sha calls, remove Option<> results

* feat: Block on hmac calls, remove Option<> results

* fix: Clippy lints

* feat: Block on spi calls, remove Option<> results

* feat: Block on timer calls, remove Option<> results

* feat: Block on twai calls, remove Option<> results

* docs: Fix wait docstring

* feat: Remove embedded_hal_nb traits

* feat: Block on uart calls, remove Option<> results

* feat: Remove nb stuff from usb_serial_jtag

* feat: Block on rsa calls, remove Option<> results

* feat: Clippy lints

* feat: Make read_bytes return how many bytes it read from the fifo and fix docs/tests

* fix: run_test_periodic_timer test

* feat: Only remove nb from stabilizing drivers

* feat: Remove unused functions

* feat: Remove emnbedded-hal-nb

* test: Adapt tests

* docs: Update changelog and migration

* test: Adapt tests

* docs: Update migration guide

* docs: Update migration

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

* docs: Update changelog and migration guide

* feat: Make `write_bytes` return an Result

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-01-17 15:46:20 +00:00
Tomasz Kramkowski
48b52e087b
0.22 migration document additions/fixes (#2986)
* fix small typo

* Adjust `new_with_config` removal example

Remove the `config` parameter construction as it has changed and is not
relevant to this example.

* Mention builder lite

* Mention `Spi` enum prefix removal

* Remove `new_with_config` from unrelated examples

* Code block fix `dif` -> `diff` typo
2025-01-17 15:45:59 +00:00
Björn Quentin
5d0145eca9
esp-wifi: Late enable BT interrupts (#2981)
* Enable BT interrupts AFTER setting the callback

* Reduce logging level

* Use published `edge-*` crates

* CHANGELOG.md
2025-01-17 15:45:26 +00:00
Dániel Buga
40d552fd7b
Create newtypes for all PAC peripherals, mark unstable peripheral singletons (#2957)
* Create newtypes for all PAC peripherals, mark unstable peripheral singletons

* Hide unstable singletons
2025-01-17 15:20:34 +00:00
Benedikt
2105ba0f81
RMT: Use gpio::Level for carrier and pulse levels (#2989)
* rmt: Use gpio::Level instead of bool to specify output levels

* rmt: Use gpio::Level for PulseCode::level{1|2}
2025-01-17 11:58:34 +00:00
liebman
da7dda37a8
i2s: fix pin offset for 8bit parallel on i2s1 (#2886)
* i2s: fix pin offset for 8bit parallel on i2s1

* i2s: fix pin offset for 8bit parallel on i2s1

* changelog

* changelog

* fix changelog
2025-01-17 10:36:06 +00:00
Benedikt
e150a537fc
rmt: don't use the paste! macro (#2976)
There's no need for it, the PACs have accessor methods that take channel
indices (which were already used in a few places).
2025-01-17 09:08:51 +00:00
Dániel Buga
3fac1979d0
Add repr(C) to DmaDescriptor, allow unstably constructing dma::Channel (#2988)
* Add repr(C) to DmaDescriptor

* Allow creating DMA channel drivers
2025-01-17 08:55:18 +00:00
Benedikt
81382bafc7
RMT: Implement builder-lite for {Rx|Tx}ChannelConfig (#2978) 2025-01-16 17:48:22 +00:00
Taiki Endo
0120cb3ecc
Fix esp-println build failure when critical-section feature is disabled (#2979) 2025-01-16 17:07:28 +00:00
Dániel Buga
a50ce4f8a1
Fix low_power_wait (#2975) 2025-01-16 17:06:18 +00:00