Skip to content

Commit

Permalink
Implement UART type erasure
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 24, 2024
1 parent a4bc053 commit 40da306
Show file tree
Hide file tree
Showing 16 changed files with 596 additions and 499 deletions.
2 changes: 2 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `AnyPin` now implements `From<GpioPin<N>>`. (#2326)
- Added `AnySpi` and `AnySpiDmaChannel`. (#2334)
- Added `AnyI2s` and `AnyI2sDmaChannel`. (#2367)
- Added `AnyUart`. (#2381)
- `Pins::steal()` to unsafely obtain GPIO. (#2335)

### Changed

- Peripheral type erasure for SPI (#2334)
- Peripheral type erasure for I2S (#2367)
- Peripheral type erasure for UART (#2381)

### Fixed

Expand Down
1 change: 1 addition & 0 deletions esp-hal/MIGRATING-0.21.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ peripherals:

- SPI (both master and slave)
- I2S
- UART

```diff
-Spi<'static, SPI2, FullDuplexMode>
Expand Down
6 changes: 3 additions & 3 deletions esp-hal/src/soc/esp32/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ crate::peripherals! {
TIMG1 <= TIMG1,
TOUCH <= virtual,
TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UART2 <= UART2,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
[Uart2] UART2 <= UART2,
UHCI0 <= UHCI0,
UHCI1 <= UHCI1,
WIFI <= virtual,
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/soc/esp32c2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ crate::peripherals! {
SYSTIMER <= SYSTIMER,
SW_INTERRUPT <= virtual,
TIMG0 <= TIMG0,
UART0 <= UART0,
UART1 <= UART1,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
WIFI <= virtual,
XTS_AES <= XTS_AES,
MEM2MEM1 <= virtual,
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/soc/esp32c3/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ crate::peripherals! {
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
UHCI0 <= UHCI0,
UHCI1 <= UHCI1,
USB_DEVICE <= USB_DEVICE,
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/soc/esp32c6/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ crate::peripherals! {
TRACE0 <= TRACE,
TWAI0 <= TWAI0,
TWAI1 <= TWAI1,
UART0 <= UART0,
UART1 <= UART1,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
UHCI0 <= UHCI0,
USB_DEVICE <= USB_DEVICE,
WIFI <= virtual,
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/soc/esp32h2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ crate::peripherals! {
TIMG1 <= TIMG1,
TRACE0 <= TRACE,
TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
UHCI0 <= UHCI0,
USB_DEVICE <= USB_DEVICE,
MEM2MEM1 <= virtual,
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/soc/esp32s2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ crate::peripherals! {
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
UHCI0 <= UHCI0,
ULP_RISCV_CORE <= virtual,
USB0 <= USB0,
Expand Down
6 changes: 3 additions & 3 deletions esp-hal/src/soc/esp32s3/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ crate::peripherals! {
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UART2 <= UART2,
[Uart0] UART0 <= UART0,
[Uart1] UART1 <= UART1,
[Uart2] UART2 <= UART2,
UHCI0 <= UHCI0,
UHCI1 <= UHCI1,
ULP_RISCV_CORE <= virtual,
Expand Down
Loading

0 comments on commit 40da306

Please sign in to comment.