Skip to content

Commit

Permalink
Replace the radio module with peripheral singleton structs (#852)
Browse files Browse the repository at this point in the history
* Replace the `radio` module with peripheral singleton structs

* Update `CHANGELOG.md`
  • Loading branch information
jessebraham authored Oct 20, 2023
1 parent d41e306 commit 62a174f
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 151 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The `spi` and `spi_slave` modules have been refactored into the `spi`, `spi::master`, and `spi::slave` modules (#843)
- The `WithDmaSpi2`/`WithDmaSpi3` structs are no longer generic around the inner peripheral type (#853)
- The `SarAdcExt`/`SensExt` traits are now collectively named `AnalogExt` instead (#857)
- Replace the `radio` module with peripheral singleton structs (#852)

## [0.12.0]

Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ symbols = [
"adc",
"dac",
"pdma",
"radio",
"phy",
"bt",
"wifi",
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32c2/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ symbols = [
"adc",
"assist_debug_sp_monitor",
"gdma",
"radio",
"phy",
"bt",
"wifi",
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32c3/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ symbols = [
"assist_debug_sp_monitor",
"assist_debug_region_monitor",
"gdma",
"radio",
"phy",
"bt",
"wifi",
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32c6/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ symbols = [
"gdma",
"large_intr_status",
"plic",
"radio",
"phy",
"bt",
"wifi",
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32h2/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ symbols = [
"assist_debug_region_monitor",
"gdma",
"plic",
"radio",
"phy",
"bt",
"ieee802154",
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32s2/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ symbols = [
"adc",
"dac",
"pdma",
"radio",
"phy",
"wifi",
"psram",
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/devices/esp32s3/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ symbols = [
"adc",
"assist_debug_region_monitor",
"gdma",
"radio",
"phy",
"bt",
"wifi",
Expand Down
2 changes: 0 additions & 2 deletions esp-hal-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ pub mod parl_io;
pub mod pcnt;
pub mod peripheral;
pub mod prelude;
#[cfg(radio)]
pub mod radio;
#[cfg(any(hmac, sha))]
mod reg_access;
pub mod reset;
Expand Down
2 changes: 0 additions & 2 deletions esp-hal-common/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ pub use crate::ledc::{
},
timer::{TimerHW as _esp_hal_ledc_timer_TimerHW, TimerIFace as _esp_hal_ledc_timer_TimerIFace},
};
#[cfg(radio)]
pub use crate::radio::RadioExt as _esp_hal_RadioExt;
#[cfg(spi3)]
pub use crate::spi::master::dma::WithDmaSpi3 as _esp_hal_spi_dma_WithDmaSpi3;
#[cfg(any(spi0, spi1, spi2, spi3))]
Expand Down
127 changes: 0 additions & 127 deletions esp-hal-common/src/radio.rs

This file was deleted.

9 changes: 6 additions & 3 deletions esp-hal-common/src/soc/esp32/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ crate::peripherals! {
AES <= AES,
APB_CTRL <= APB_CTRL,
BB <= BB,
// SYSTEM is derived from DPORT
SYSTEM <= DPORT,
EFUSE <= EFUSE,
FLASH_ENCRYPTION <= FLASH_ENCRYPTION,
FRC_TIMER <= FRC_TIMER,
Expand Down Expand Up @@ -65,6 +63,8 @@ crate::peripherals! {
SPI1 <= SPI1,
SPI2 <= SPI2,
SPI3 <= SPI3,
// SYSTEM is derived from DPORT:
SYSTEM <= DPORT,
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
Expand All @@ -73,6 +73,9 @@ crate::peripherals! {
UART2 <= UART2,
UHCI0 <= UHCI0,
UHCI1 <= UHCI1,
RADIO <= virtual,

// Virtual peripherals:
BT <= virtual,
PSRAM <= virtual,
WIFI <= virtual,
}
5 changes: 4 additions & 1 deletion esp-hal-common/src/soc/esp32c2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@ crate::peripherals! {
UART0 <= UART0,
UART1 <= UART1,
XTS_AES <= XTS_AES,
RADIO <= virtual

// Virtual peripherals:
BT <= virtual,
WIFI <= virtual,
}
5 changes: 4 additions & 1 deletion esp-hal-common/src/soc/esp32c3/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@ crate::peripherals! {
UHCI1 <= UHCI1,
USB_DEVICE <= USB_DEVICE,
XTS_AES <= XTS_AES,
RADIO <= virtual

// Virtual peripherals:
BT <= virtual,
WIFI <= virtual,
}
10 changes: 7 additions & 3 deletions esp-hal-common/src/soc/esp32c6/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ crate::peripherals! {
PARL_IO <= PARL_IO,
PAU <= PAU,
PCNT <= PCNT,
// SYSTEM is derived from PCR
SYSTEM <= PCR,
PMU <= PMU,
RMT <= RMT,
RNG <= RNG,
Expand All @@ -81,6 +79,8 @@ crate::peripherals! {
SPI0 <= SPI0,
SPI1 <= SPI1,
SPI2 <= SPI2,
// SYSTEM is derived from PCR
SYSTEM <= PCR,
SYSTIMER <= SYSTIMER,
TEE <= TEE,
TIMG0 <= TIMG0,
Expand All @@ -92,6 +92,10 @@ crate::peripherals! {
UART1 <= UART1,
UHCI0 <= UHCI0,
USB_DEVICE <= USB_DEVICE,
RADIO <= virtual,

// Virtual peripherals:
BT <= virtual,
IEEE802154 <= virtual,
LP_CORE <= virtual,
WIFI <= virtual,
}
9 changes: 6 additions & 3 deletions esp-hal-common/src/soc/esp32h2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ crate::peripherals! {
PARL_IO <= PARL_IO,
PAU <= PAU,
PCNT <= PCNT,
// SYSTEM is derived from PCR
SYSTEM <= PCR,
PMU <= PMU,
RMT <= RMT,
RNG <= RNG,
Expand All @@ -73,6 +71,8 @@ crate::peripherals! {
SPI0 <= SPI0,
SPI1 <= SPI1,
SPI2 <= SPI2,
// SYSTEM is derived from PCR:
SYSTEM <= PCR,
SYSTIMER <= SYSTIMER,
TEE <= TEE,
TIMG0 <= TIMG0,
Expand All @@ -83,5 +83,8 @@ crate::peripherals! {
UART1 <= UART1,
UHCI0 <= UHCI0,
USB_DEVICE <= USB_DEVICE,
RADIO <= virtual,

// Virtual peripherals:
BT <= virtual,
IEEE802154 <= virtual,
}
4 changes: 3 additions & 1 deletion esp-hal-common/src/soc/esp32s2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ crate::peripherals! {
USB0 <= USB0,
USB_WRAP <= USB_WRAP,
XTS_AES <= XTS_AES,
RADIO <= virtual,

// Virtual peripherals:
PSRAM <= virtual,
ULP_RISCV_CORE <= virtual,
WIFI <= virtual,
}
5 changes: 4 additions & 1 deletion esp-hal-common/src/soc/esp32s3/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ crate::peripherals! {
USB_WRAP <= USB_WRAP,
WCL <= WCL,
XTS_AES <= XTS_AES,
RADIO <= virtual,

// Virtual peripherals:
BT <= virtual,
PSRAM <= virtual,
ULP_RISCV_CORE <= virtual,
WIFI <= virtual,
}

0 comments on commit 62a174f

Please sign in to comment.