366 Commits

Author SHA1 Message Date
Go Suzuki
6b735e1510
feat(example): Add LP I2C Example (SHT30 temp. and humid. sensor) (#4679)
* feat(example): Add LP I2C Example (SHT30 temp. and humid. sensor)

* Fix the wrong attribute name `required_features` in Cargo.toml.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix file name.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Added descriptions for constants.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Added some spaces.

* Split write and read.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Added descriptions for addresses.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Added descriptions for addresses on main.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Changed I2C failure handling.

* Fix link.

* Change the variable name

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-23 09:19:35 +00:00
Jesse Braham
01e941346d
Move more types out of wifi module and into csi and scan submodules instead (#4588)
* Move CSI-related types to their own module, enable `csi` feature in docs

* Move more types to `scan` module

* Miscellaneous fixes/cleanup

* Update changelog and migration guide

* Review comments

* ¯\_(ツ)_/¯
2025-12-03 21:49:39 +00:00
Juraj Sadel
dcdd28b97b
esp-radio: Rename Client to Station (#4546)
* esp-radio: Rename Client to Station

* changelog

* Change AP to AccessPoint and Sta to Station

* changelog update

* MG
2025-11-25 13:45:37 +00:00
Juraj Sadel
036d98bba5
Fix cargo machete (#4538) 2025-11-21 11:39:26 +00:00
Juraj Sadel
1e508e2e1e
Refactor esp_radio::init() (#4482)
* Refactor esp_radio::init()

* Introduce BleInitError and WifiInitError enums and call RadioRefGuard new and drop in critical section

* reviews (wifi::new returns WifiError)

* Changelog and MG

* Redo tests

* Add coex qa-test that drops ble and test if wifi still works
2025-11-20 13:24:10 +00:00
Jesse Braham
dadb034238
Refactor: extract submodules from esp_radio::wifi module (#4460)
* Clean up `wifi` module imports

* Move Wi-Fi sniffer types/functions to their own module

* Move Wi-Fi AP types to their own module

* Move STA/EAP types to their own modules

* Fix docs build

* Move `convert_ap_info` function to `ap` module

* Update changelog and migration guide

* Address review feedback
2025-11-17 17:51:10 +00:00
Benedikt
240afa9ac9
RMT: Various cleanups, small API enhancements (#4302)
* RMT: avoid dropping/recreating peripheral guards in into_async

regression from https://github.com/esp-rs/esp-hal/pull/4174 (arguably,
before that, the code was just wrong)

* RMT: CHANNEL_INDEX_COUNT -> ChannelIndex::MAX

this seems slighly cleaner, since it more clearly indicates how the two
are related

* RMT: rename RmtTxFuture, RmtRxFuture -> TxFuture, RxFuture

removing the redundant prefix

this isn't breaking API, since both types are private

* RMT: rename SingleShotTxTransaction -> TxTransaction

the previous name was quite unwieldy, and this also better shows the
symmetry between RxTransaction and TxTransaction

* RMT: more consistent code formatting in low-level methods

Note that it's important how the closures for PAC register `modify` and
`write` calls are layed out. Compare

```rust
pub fn clear_tx_interrupts(&self) {
    let rmt = crate::peripherals::RMT::regs();

    rmt.int_clr().write(|w| {
	let ch_idx = self.ch_idx as u8;

	w.ch_tx_end(ch_idx).set_bit();
	w.ch_tx_err(ch_idx).set_bit();
	w.ch_tx_loop(ch_idx).set_bit();
	w.ch_tx_thr_event(ch_idx).set_bit()
    });
}
```

and

```rust
pub fn clear_tx_interrupts(&self) {
    let rmt = crate::peripherals::RMT::regs();
    let ch_idx = self.ch_idx as u8;

    rmt.int_clr().write(|w| {
	w.ch_tx_end(ch_idx).set_bit();
	w.ch_tx_err(ch_idx).set_bit();
	w.ch_tx_loop(ch_idx).set_bit();
	w.ch_tx_thr_event(ch_idx).set_bit()
    });
}
```

In the first example, the cast from `self.ch_idx: ChannelIndex` to `u8`
happens in the closure, whereas in the second case, the closure will be
built without the information about the restricted range of
`ChannelIndex` and assume `ch_idx` to be any `u8`. That leads to bounds
check being present (from the PAC register writer), which greatly
increases the closure size, and might push it above the compiler's
threshold for inlining. However, we generally rely quite a bit on
inlining with these methods to generate efficient code here and in
similar methods.

* RMT: merge two register modifications

* RMT: consistently inline(always) low-level methods

In practice, this happened anyway, but better enforce this:
- many of these methods are designed to allow for optimizations after
  inling (e.g. removing conditionals due to compile-time known
  values)
- if they end up being not inlined, the place_rmt_driver_in_ram feature
  doesn't take full effect

* RMT: change method receivers for DynChannelAccess from &self to self

Since it is Copy. We expect all of this to be inlined, so there
shouldn't be a difference in the final code. This should however
simplify the compiler's job a tiny bit and more importantly prevent
pointer indirection and spilling to stack if one of these methods ends
up being not inlined for whatever reason.

* RMT: Ensure that all pub types derive Debug

* RMT: rename set_generate_repeat_interrupt -> set_loopmode

more consistent with the new LoopMode type, and avoids suggesting that
this method might do anything like enabling an interrupt (which it
doesn't)

* RMT: Channel configuration returns channel and pin on failure

instead of permanently consuming them.

This requires quite a bit of refactoring since we must not call
pin.into() before verifying all inputs in order to be able to return the
original pin type on error.

* RMT: ensure that all rx/tx methods return the channel on error

instead of consuming it, which gives no way to recover/recreate the
channel

* RMT: Update HIL tests to account for return type changes

* RMT: With place_rmt_driver_in_ram, also place the interrupt handler in RAM

* RMT: Merge interrupt flag reset methods into clear_?x_interrupts

By adding an EnumSet argument. This nicely mirrors the listen/unlisten
functions, which take the same type of argument. It also helps to avoid
proliferation of a large number of methods when using more interrupts
(such as the loopcount interrupt, which I intend to do in a later PR).

There should be no performance negative, since these methods are always
inlined with compile-time known arguments, such that the compiler can
remove all conditionals.

* RMT: also #[inline(always)] closures for PAC modify and write calls

* RMT: rewrite clear_*x_interrupt in obviously branch-free manner

This make the code slightly more concise and obviously branch-free
(although the compiler seems to make that optimization on it's own, as
well).

This code remains equivalent, because int_clr has only a write-to-clear
bits and the register writer will be initialized to all zeroes before
the closure is invoked.

* RMT: refactor channel configuration

- move configure_tx, configure_rx out of Channel again so that they
  don't end up being duplicated via monomorphization of Dm = Blocking and Async
  in spite of being virtually identical.
  It's probably a bit of an edge case to have both Blocking and Async
  channels in one binary (the HIL test do, though), so it's not really
  an important optimization, but it still seems cleaner this way.

- both methods take the configuration by reference instead of by value
  (it ended up being passed on the stack anyway, so this doesn't really
  change the generated code, but allows the caller to re-use the
  configuration)

* RMT: changelog and migration guide

* fixup! RMT: With place_rmt_driver_in_ram, also place the interrupt handler in RAM

* RMT: also implement defmt::Format for Debug types

Previously, not all types that implemented Debug also implemented
defmt::Format.

For RmtState, this removes the Debug derive, since it's purely internal
and there's no need for it.

* Partially revert "RMT: also #[inline(always)] closures for PAC modify and write calls"

This partially reverts commit 53da105c85fc771f185c1f30772b77466b50f04c.

This retains the #[inline(always)] for closures realated to `int_ena`
and `int_clr` accesses: These tend to generate relatively large code,
but are expected to optimize substantially due to their compile-time
known arguments. Without explicit inlining, compiler behavior is
somewhat brittly in their case.

* Partially revert "RMT: consistently inline(always) low-level methods"

This partially reverts commit d845e7bc3e3ee249268c0c2e10b16be1e27117f5.

It retains explicit inline hints for methods that strongly rely upon
inlining to optimize either
- the method based on compile-time known arguments
- the caller dispatching based on an Event result to avoid constructing
  the event entirely and fully inline bit tests
The relevant methods are also on the larger side, such that inlining
might otherwise not reliably happen, leading to unexpectedly large code
for simple operations.

* RMT: don't rely on inlining to eliminate dead code

stop_tx isn't reliably inlined depending on optimization settings, but
we relied on propagation of the bool return value to eliminate code that
is not relevant on all targets

* RMT: split pin assignment out of configure_*x methods

Such that assigning a pin is an infallible operation, and the pin won't
be permanently consumed if configuration fails.

* RMT: add PinGuard

* RMT: be sure that there's no extraneous pulse when connecting a pin

similar to other drivers

* RMT: validate idle_threshold in RxChannelConfig setter

to remove one reason why ChannelCreator::configure_rx can fail. For now,
this methods remains fallible, but it would eventually be nice to make
it infallible to avoid the inconvenient return type on error.
The only remaining error case is due to invalid memsize, which can be
avoided by refactoring such that extra channel memory can be assigned by
consuming another Channel(Creator)

* RMT: make zero loopcount test more reliable

for some reason, this started to be flaky recently...

* RMT: update changelog & migration guide

* RMT: Revert idle_threshold changes; add apply_config instead

As highlighted in review, validating idle_threshold in the
RxChannelConfig setter is a bit awkward, and counter to what other
drivers do.

The standard solution in esp-hal to deal with possibly invalid configs
seems to be `apply_config`, which the RMT driver was missing, so add
that.

* RMT: update changelog + migration guide

* doc + migration guide fixes

* remove unnecessary trait bound
2025-11-13 11:20:42 +00:00
Juraj Sadel
788d52cf69
Add app_desc to uart-interrupt example (#4477) 2025-11-11 07:01:06 +00:00
Zach Grimaldi
7fc858d836
feat: uart break send + detect (#4284)
* feat: uart break send + detect

* fix: example configs

* fix: not needed directives

* fix: instability::unstable; one line doc comment

* Update esp-hal/CHANGELOG.md

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

* fix: fold in hil test

* chore: remove old test from toml

* feat: add missing `wait_for_break` fn

* fix: self.regs

* feat: wait_for_break with timeout + async

* chore: fmt

* fix: pins now match embassy_serial example

* test: increase break length

* test: uses wait_for_break method

* test: with timeout

* fix: extend break on other test

* fix: missing assert

* test: explicit enable before first break

* test: delay after enable

* test: sync_regs on c6/h2

* test: interleaved

* test: sync and delay

* test: c6/h2 sync on send

* test: sync only without additional delay

* test: break detection amongst transmission

* fix: data tests should flush to allow full tx

* fix: delete unneeded example

* feat: added break sending to uart example

* fix: use time::Duration

* fix: TRMs dictate c3 and s3 need sync_regs after write to conf0

* fix: use Duration in HIL tests

* fix: save unoptimizable register read

* fix: remove cancellation safe (they're not)

* fix: reg assignment bits()

* test: no sync after enable_listen_rx (just after conf0 writes)

* chore: retrigger ci

* chore: retrigger ci again

* chore: update example payload to be something more relevant

* test: put back sync for c6/h2

* docs: update changelog

* docs: clarify changelog entry

* fix: missing byte in example

* fix: changelog version

* Update esp-hal/src/uart/mod.rs

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

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
2025-11-10 08:04:34 +00:00
Dániel Buga
99a0840ad6
RTOS: use FROM_CPUn interrupts for context switching on ESP32 (#4459)
* Extract magic constant

* Clean up a bit

* Make sure PS is appropriate

* Use FROM_CPU0 on ESP32 to yield

* Add a test case

* Undo esp-hal change

* Fix build on S2

* Fix esp-radio doc example

* Fix build
2025-11-07 09:22:09 +00:00
Juraj Sadel
5dccb0beb0
examples: Remove unneded esp-radio/unstable feature from embassy_wifi examples (#4457) 2025-11-06 17:40:32 +00:00
Sergio Gasquez Arcos
177324f3ef
docs: Update example description (#4367) 2025-10-16 10:54:24 +00:00
Åke Amcoff
cf856ff5b4
Add OtaUpdater::next_partition (#4339)
* derive Copy for PartitionEntry

* Add entry for OtaUpdater::next_partition in changelog

* update tests

* remove with_next_partition
2025-10-15 10:53:07 +00:00
Björn Quentin
c099a759ec
Less wasted memory for the BLE examples (#4355) 2025-10-15 10:47:49 +00:00
Sergio Gasquez Arcos
fb573a4617
build: Bump trouble-host (#4347) 2025-10-14 15:03:10 +00:00
Dániel Buga
ff31b5951c
Simplify/clarify some docs/syntax in wifi code (#4294)
* Simplify

* Clarify docs

* Rename blocking function, fix links to items
2025-10-08 13:29:19 +00:00
Dániel Buga
c4ba10beca
Remove default features from esp-rtos, update docs (#4283)
* Remove default esp-rtos features

* Update rtos docs

* Fix allocating types with larger alignment requirements

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix ESP32 perf

* Remove redundant trace call

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-08 11:56:33 +00:00
Juraj Sadel
952f5ffa47
esp-radio: Rename Config to WifiApStaConfig and WifiConfig to Config (#4278)
* esp-radio: Rename Config to WifiApStaConfigi and WifiConfig to Config

* mg

* changelog

* build error

* remove WifiConfig entries from MG and changelog
2025-10-07 14:30:17 +00:00
Dániel Buga
6869eedc92
Touch up dependencies (#4280)
* Remove esp-metadata dependency

* Update dependencies

* Remove litrs
2025-10-07 13:18:33 +00:00
Dániel Buga
fb8aa314f6
Add more BLE config options (#4259)
* C2: Set actually configured defaults

* Allow configuring maximum number of connections

* Allow configuring QA test mode

* Allow configuring advertising filter cache size

* Small tweaks

* Complete ESP32 options

* Allow configuring antennas and tx power

* More S3/C3 opions

* Use constants for NPL version/magic

* More C2 config options

* Fixups

* Add max_connections to C3/S3 config

* Fix range of scan_duplicate_refresh_period

* Rename field

* Update docs, ranges, add missing H2 validation rules

* Apply suggestion from @bugadani
2025-10-06 15:50:40 +00:00
Dániel Buga
fb90c646e7
Add ram(reclaimed) (#4245) 2025-10-02 15:34:58 +00:00
Dániel Buga
c0784cc929
Remove outdated limitation (#4232) 2025-10-02 08:50:37 +00:00
Juraj Sadel
0ed765feab
Remove unused deps (#4230) 2025-10-02 07:07:28 +00:00
Dániel Buga
f99dd18974
Make BLE task configurable (#4223) 2025-10-01 15:45:20 +00:00
Dániel Buga
be34396b2e
Rename esp-preempt to esp-rtos (#4206)
* Rename esp-preempt to esp-rtos

* Also update procmacros

* Fix formatting

* Rename the driver crate, too

* Changelog-check the driver crate
2025-09-30 07:05:50 +00:00
Dániel Buga
55e4594194
Integrate esp-hal-embassy into esp-preempt (#4172)
* Integrate embassy bits, delete eh-embassy

* I2C: Check for errors when everything is done

* Fix multicore examples

* Prevent deleting a task that is currently running on another cpu

* Save some memory on wait queues

* Remove the yield event concept

* Modify pins to let the example run on ESP32

* Clean up

* Make sure a task does not execute instructions after deleting itself
2025-09-29 09:05:29 +00:00
Ulf Lilleengen
9930c10747
fix: use version of bt-hci with command complete fix (#4186)
* fix: use version of bt-hci with command complete fix

* Use a version of bt-hci that properly parses command complete event.
* Remove workaround in esp-radio ble controller

* Update esp-radio/CHANGELOG.md

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

* fix: use trouble-host supporting newer bt-hci

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-09-26 12:19:18 +00:00
Juraj Sadel
0180a38ba0
esp-storage now depends on esp-hal (#4173)
* esp-storage now depends on esp-hal

* clean up cfg gates

* changelog
2025-09-24 08:55:26 +00:00
Dániel Buga
f3907af22b
Possibly awful SMP implementation (#4152)
* Test and fix time slicing

* Possibly awful SMP implementation

Co-authored-by: g1ibby <wss.world@gmail.com>

* Remove __esp_radio_builtin_scheduler

---------

Co-authored-by: g1ibby <wss.world@gmail.com>
2025-09-24 08:34:55 +00:00
Björn Quentin
5da68279bc
Rework ota (#4150)
* OTA Fixes

- Support up to 16 OTA app partitions
- Fixed some bugs and shortcomings
- Added an OTA helper

* Changelog

* CHANGELOG.md

* Fix

* Constants

* Code comments

* Make code more readable

* Fix auto-complete's sins
2025-09-22 13:48:59 +00:00
Juraj Sadel
5129e326a0
Remove unused deps across workspace (#4158) 2025-09-22 12:10:43 +00:00
Ulf Lilleengen
62529e2fd3
chore: update bt-hci version (#4146)
* chore: update bt-hci version

* chore: use released version of trouble-host

* Make sure clippy fails, fix warning

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-09-19 13:48:49 +00:00
Björn Quentin
37f048f20b
Fix ota-update example (#4145) 2025-09-19 08:11:24 +00:00
Juraj Sadel
3d0d20002e
Make a singleton form FlashStorage constructor, removed Default (#4132)
* Make a singleton form FlashStorage constructor, removed Default

* changelog

* Simplify, don't need the Singleton

* changelog

* reviews and build errors

* fix dead links

* fmt
2025-09-18 14:33:42 +00:00
Dániel Buga
1eed542f64
Use cargo-batch to build tests and examples, avoid linting so much (#4108)
* Use cargo-batch

* Run CI on mac runner

* Rely on MSRV and nightly jobs to lint

* Build docs separately

* Don't copy examples - fix builds on stable

* Run everything by default, set CI env var in ci command

* Run batched commands with RUSTC_BOOTSTRAP enabled

* Force cargo-batch to correctly ignore unstable option

* Test with nightly

* Use a persistent target folder, remove cache

* Don't delete the lp examples

* Restore target dir

* Build with stable again

* Fix rebase fail

* Remove handling tests

* Remove redundant code

* Restore repeated test run option

* Add simpler cargo check

* Introduce check-packages

* Remove stabilized -Zdoctest-xcompile

* Clean up commented code

* Remove more stuff

* Fix uart_uhci test

* No badger for us
2025-09-18 11:25:11 +00:00
Dániel Buga
42297811be
Use TLSF by default (#4130)
* Use TLSF by default

* Update example heap usage to leave more stack

* Fix test configurations
2025-09-17 14:03:32 +00:00
Dániel Buga
646495eb16
Runtime wifi config options (#4121)
* Turn country code and default power mode into runtime configs

* Move G_CONFIG setup to wifi::new

* Turn most configs into runtime options

* Set core ID to current one

* Mark most options unstable
2025-09-17 08:13:18 +00:00
Dániel Buga
54d0da12af
Add defmt+esp-println example (#4122)
* Add defmt+esp-println example

* Fix warning

* Un-nit the pick
2025-09-16 15:09:06 +00:00
Dániel Buga
9d596ca752
esp-radio: remove scheduler lifecycle management, remove idle task (#4093)
* Start scheduler on preempt init, remove deinit

* Static-allocate the main task context

* taskless idle

* Remove the need for an idle task
2025-09-15 12:47:39 +00:00
Juraj Sadel
a5a0833318
Add a CI workflow for checking links in .rs, .md, and .toml files acc… (#4098)
* Add a CI workflow for checking links in .rs, .md, and .toml files accross esp-hal workspace

fix dead links

* exclude unpublished crate documentation's links

* Add .lycheeignore with excluded links

* play with patterns

* don't forget to remove
2025-09-12 10:48:04 +00:00
Juraj Sadel
e888f574fb
Update embassy-futures (#4079) 2025-09-08 14:39:42 +00:00
Björn Quentin
27c89c3adc
Fix wifi event names (#4065)
* Fix wifi event names

* CHANGELOG.md

---------

Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
2025-09-08 07:09:04 +00:00
Alexei Pastuchov
6aaf12a08d
examples/README.md: clarify xtask subcommand usage and arguments (#4067)
- Update example commands to use the new `--chip` argument format for `build examples` and `run example` subcommands.
- Improve clarity by showing explicit argument order and usage.
- Reflect recent changes in xtask interface for building and running examples.

Signed-off-by: Alexei Pastuchov <info@maximka.de>
2025-09-06 10:01:15 +00:00
Dániel Buga
24d2122c14
Remove ConcurrentQueue & other minor tweaks (#4058)
* Remove ConcurrentQueue

* Unrequire preempt driver for 802.15.4
2025-09-05 14:59:08 +00:00
Dániel Buga
91e0cea412
Update embassy, embedded-test (#3945) 2025-09-05 13:51:26 +00:00
Dániel Buga
a84d3cc89f
Make timekeeping the driver's job (#4047) 2025-09-05 07:31:40 +00:00
Kirill Mikhailov
38fd991ff7
More cleanup in esp-radio (#4040)
* More cleanup in `esp-radio`

* misc

* address reviews

* docs update

* fmt
2025-09-04 14:03:19 +00:00
Juraj Sadel
34b908dc56
Remove wifi_state and split WifiState into WifiStaState and WifiApState (#4046)
* Remove wifi_state adn split WifiState into WifiStaState and WifiApState

* MG

* changelog

* review
2025-09-04 11:28:00 +00:00
Benedikt
a13def7df6
RMT: Type-erase channels (#3980)
* RMT: add HIL test that exercises all channels

to ensure that there are no issues with channel/register indexing; see
also the code comments.

no user-facing changes

* RMT: store ch_idx instead of channel number

`ConstChannelAccess` and `DynChannelAccess` used to store the channel number
and have a `Direction` generic parameter.
However, there are invalid combinations of `Direction` and the channel
number on some chips (e.g. on esp32c3, there is no channel with (Tx, 2),
because channel 2 and 3 only support Rx).

In constrast, the tuple `(Dir, ch_idx)` also uniquely identifies a
channel and its configuration, and any combination of it is valid as long as the
channel index is in bounds.

This makes it somewhat easier to work with; in particular, it will allow
removing bounds checks on ch_idx in a later commit by replacing
`ch_idx: u8` with an enum type.

This also refactors the `async_interrupt_handler` accordingly.

This is user-visible via the `ConstChannelAccess` type, however a later
commit in this PR will remove that entirely.

* RMT: elide bounds checks via ChannelIndex enum

If the channel index is not known at compile time in a given function,
the compiler will insert bounds checks on

- indexing the STATE global
- register access via the PAC

The compiler seems to be able to deduplicate them since low-level
functions are mostly inlined, but each function will retain at least one
bounds check.

This change helps the compiler to elide these checks by using a custom
type for channel indices that can only take values for which a channel
exists.
Specifically, this uses an enum to serve as a refinement of u8 to help
the compiler restrict value ranges. Due to inlining, this restricted
value range is propagated by the compiler until the potential bounds checks,
even if there's intermediate cast to u8,
cf. https://github.com/rust-lang/rust/issues/109958

There are no user-facing changes. (`ChannelIndex` is `pub` because it
appears in a `[doc(hidden)]` trait member.)

* RMT: always type-erase channels

- remove the `Raw` generic on `Channel`: This simplifies the types,
  should have negligible performance impact (helped by elided bounds
  checks via the recently introduced `ChannelIndex` enum), and greatly
  reduce code size if several channels are used (by avoiding
  monomorphization per channel)

- this also changed the arguments to configure_(tx,rx)_channel such that
  they don't contain generics, again avoiding code bloat due to
  monomorphization

This requires user code to change type annotations for channels and
transactions, and remove any manual type erasure (via `channel.degrade()`).

* RMT: impl blocking tx/rx methods directly on Channel

There's now only a single type that should implement these methods due
to erasing the channel index const generic, so the indirection via a
trait serves no purpose. Implementing methods directly on the channel
probably also helps to make the docs more discoverable.

This requires user code to remove the `TxChannel` and `RxChannel`
imports.

* RMT: impl async tx/rx methods directly on Channel

There's now only a single type that should implement these methods due
to erasing the channel index const generic, so the indirection via a
trait serves no purpose. Implementing methods directly on the channel
probably also helps to make the docs more discoverable.

This requires user code to remove the `TxChannelAsync` and `RxChannelAsync`
imports.

* RMT: impl *ChannelInternal traits only on DynChannelAccess

rather than as a blanket impl for RawChannelAccess, which includes
ConstChannelAccess: We don't intend to perform any accesses via
ConstChannelAccess anymore, so enforce that.
We could also get rid of the traits entirely and directly impl their
methods for DynChannelAccess, but it seems somewhat useful to keep them
around to guarantee that the interfaces in both chip_specific modules
are consistent.

There are no user-facing changes here.

* RMT: remove `pub` on various internal types

that used to be visible somewhere in the API's trait bounds, but are not
part of the API themselves

This is user-visible, but user code should not have used these types in
the first place.

* RMT: rm ConstChannelAccess, RawChannelAccess, private DynChannelAccess

now that Channel has no `Raw: RawChannelAccess` type parameter:

- we don't need low-level channel methods to be implemented for
  ConstChannelAccess, since all accesses go through DynChannelAccess.
  Thus, remove the *ChannelInternal traits and implement their methods directly
  on DynChannelAccess
- none of these types need to be public (although one might consider
  actually making them public with an unsafe constructor to provide an
  unsafe low-level interface to the hardware)

This is user-visible (imports need to be removed; they're not used
anymore since the previous commit that always type-erased the `Raw`
parameter of `Channel`)

* RMT: changelog and migration guide for type-erased channels

* RMT: (review) remove stray comment

* RMT: (review) remove is_tx() from Direction trait

we can simply use the const item directly
2025-09-03 12:15:51 +00:00
Björn Quentin
ec22515d05
Don't talk too much about xtasks (#4034) 2025-09-03 07:06:30 +00:00