Miscellaneous fixes/improvements (#627)

* Un-comment remaining device peripheral definitions for ESP32-H2

* Re-work `RadioExt` implementations, add support for ESP32-H2

* README updates for ESP32-C6/H2

* Update CHANGELOG
This commit is contained in:
Jesse Braham 2023-06-27 07:14:31 -07:00 committed by GitHub
parent 16f78b1fb2
commit c5f0060d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 54 deletions

View File

@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Change LED pin to GPIO2 in ESP32 blinky example (#581) - Change LED pin to GPIO2 in ESP32 blinky example (#581)
- Update ESP32-H2 and ESP32-C6 clocks and remove `i2c_clock` for all chips but ESP32 (#592) - Update ESP32-H2 and ESP32-C6 clocks and remove `i2c_clock` for all chips but ESP32 (#592)
- Use both timers in `TIMG0` for embassy time driver when able (#609) - Use both timers in `TIMG0` for embassy time driver when able (#609)
- Re-work `RadioExt` implementations, add support for ESP32-H2 (#627)
### Fixed ### Fixed

View File

@ -8,13 +8,13 @@ peripherals = [
"apb_saradc", "apb_saradc",
"assist_debug", "assist_debug",
"dma", "dma",
# "ds", "ds",
# "ecc", "ecc",
"efuse", "efuse",
"gpio", "gpio",
# "hmac", "hmac",
# "hp_apm", "hp_apm",
# "hp_sys", "hp_sys",
"i2c0", "i2c0",
"i2c1", "i2c1",
"i2s0", "i2s0",
@ -22,20 +22,20 @@ peripherals = [
"intpri", "intpri",
"io_mux", "io_mux",
"ledc", "ledc",
# "lp_ana", "lp_ana",
# "lp_aon", "lp_aon",
# "lp_apm", "lp_apm",
"lp_clkrst", "lp_clkrst",
# "lp_peri", "lp_peri",
# "lp_timer", "lp_timer",
"lp_wdt", "lp_wdt",
"mcpwm0", "mcpwm0",
"mem_monitor", "mem_monitor",
"modem_lpcon", "modem_lpcon",
"modem_syscon", "modem_syscon",
# "otp_debug", "otp_debug",
# "parl_io", "parl_io",
# "pau", "pau",
"pcnt", "pcnt",
"pcr", "pcr",
"pmu", "pmu",
@ -43,19 +43,19 @@ peripherals = [
"rng", "rng",
"rsa", "rsa",
"sha", "sha",
# "soc_etm", "soc_etm",
"spi0", "spi0",
"spi1", "spi1",
"spi2", "spi2",
"systimer", "systimer",
# "tee", "tee",
"timg0", "timg0",
"timg1", "timg1",
# "trace", "trace",
# "twai0", # "twai0",
"uart0", "uart0",
"uart1", "uart1",
# "uhci0", "uhci0",
"usb_device", "usb_device",
# Additional peripherals defined by us (the developers): # Additional peripherals defined by us (the developers):

View File

@ -70,17 +70,7 @@ impl crate::peripheral::Peripheral for LowRate {
impl crate::peripheral::sealed::Sealed for LowRate {} impl crate::peripheral::sealed::Sealed for LowRate {}
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(any(esp32, esp32c2, esp32c3, esp32s3))] { if #[cfg(all(bt, ieee802154, wifi))] {
impl RadioExt for crate::peripherals::RADIO {
type Components = (Wifi, Bluetooth);
fn split(self) -> Self::Components {
unsafe {
(Wifi::steal(), Bluetooth::steal())
}
}
}
} else if #[cfg(esp32c6)] {
impl RadioExt for crate::peripherals::RADIO { impl RadioExt for crate::peripherals::RADIO {
type Components = (Wifi, Bluetooth, LowRate); type Components = (Wifi, Bluetooth, LowRate);
@ -90,7 +80,27 @@ cfg_if::cfg_if! {
} }
} }
} }
} else if #[cfg(esp32s2)] { } else if #[cfg(all(bt, ieee802154))] {
impl RadioExt for crate::peripherals::RADIO {
type Components = (Bluetooth, LowRate);
fn split(self) -> Self::Components {
unsafe {
(Bluetooth::steal(), LowRate::steal())
}
}
}
} else if #[cfg(all(bt, wifi))] {
impl RadioExt for crate::peripherals::RADIO {
type Components = (Wifi, Bluetooth);
fn split(self) -> Self::Components {
unsafe {
(Wifi::steal(), Bluetooth::steal())
}
}
}
} else if #[cfg(wifi)] {
impl RadioExt for crate::peripherals::RADIO { impl RadioExt for crate::peripherals::RADIO {
type Components = Wifi; type Components = Wifi;

View File

@ -12,13 +12,13 @@ crate::peripherals! {
APB_SARADC => true, APB_SARADC => true,
ASSIST_DEBUG => true, ASSIST_DEBUG => true,
DMA => true, DMA => true,
// DS => true, DS => true,
// ECC => true, ECC => true,
EFUSE => true, EFUSE => true,
GPIO => true, GPIO => true,
// HMAC => true, HMAC => true,
// HP_APM => true, HP_APM => true,
// HP_SYS => true, HP_SYS => true,
I2C0 => true, I2C0 => true,
I2C1 => true, I2C1 => true,
I2S0 => true, I2S0 => true,
@ -26,20 +26,20 @@ crate::peripherals! {
INTPRI => true, INTPRI => true,
IO_MUX => true, IO_MUX => true,
LEDC => true, LEDC => true,
// LP_ANA => true, LP_ANA => true,
// LP_AON => true, LP_AON => true,
// LP_APM => true, LP_APM => true,
LP_CLKRST => true, LP_CLKRST => true,
// LP_PERI => true, LP_PERI => true,
// LP_TIMER => true, LP_TIMER => true,
LP_WDT => true, LP_WDT => true,
MCPWM0 => true, MCPWM0 => true,
MEM_MONITOR => true, MEM_MONITOR => true,
MODEM_LPCON => true, MODEM_LPCON => true,
MODEM_SYSCON => true, MODEM_SYSCON => true,
// OTP_DEBUG => true, OTP_DEBUG => true,
// PARL_IO => true, PARL_IO => true,
// PAU => true, PAU => true,
PCNT => true, PCNT => true,
PCR => true, PCR => true,
PMU => true, PMU => true,
@ -47,19 +47,19 @@ crate::peripherals! {
RNG => true, RNG => true,
RSA => true, RSA => true,
SHA => true, SHA => true,
// SOC_ETM => true, SOC_ETM => true,
SPI0 => true, SPI0 => true,
SPI1 => true, SPI1 => true,
SPI2 => true, SPI2 => true,
SYSTIMER => true, SYSTIMER => true,
// TEE => true, TEE => true,
TIMG0 => true, TIMG0 => true,
TIMG1 => true, TIMG1 => true,
// TRACE => true, TRACE => true,
// TWAI0 => true, TWAI0 => true,
UART0 => true, UART0 => true,
UART1 => true, UART1 => true,
// UHCI0 => true, UHCI0 => true,
USB_DEVICE => true, USB_DEVICE => true,
RADIO => false, RADIO => false,
} }

View File

@ -33,7 +33,7 @@ By default, [espflash](https://github.com/esp-rs/espflash) fetches the required
#### Direct Boot #### Direct Boot
[Direct Boot](https://github.com/espressif/esp32c6-direct-boot-example#direct-boot-in-esp32-c6) allows an application stored in the External Flash to be executed directly, without being copied into Internal RAM. [Direct Boot](https://github.com/espressif/esp32c3-direct-boot-example#direct-boot-in-esp32-c3) allows an application stored in the External Flash to be executed directly, without being copied into Internal RAM.
##### Booting the Hello World example using Direct Boot ##### Booting the Hello World example using Direct Boot

View File

@ -1,17 +1,17 @@
# esp32h2-hal # esp32h2-hal
<!-- [![Crates.io](https://img.shields.io/crates/v/esp32h2-hal?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/esp32h2-hal) [![Crates.io](https://img.shields.io/crates/v/esp32h2-hal?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/esp32h2-hal)
[![docs.rs](https://img.shields.io/docsrs/esp32h2-hal?labelColor=1C2C2E&color=C96329&logo=rust&style=flat-square)](https://docs.rs/esp32h2-hal) [![docs.rs](https://img.shields.io/docsrs/esp32h2-hal?labelColor=1C2C2E&color=C96329&logo=rust&style=flat-square)](https://docs.rs/esp32h2-hal)
![Crates.io](https://img.shields.io/crates/l/esp32h2-hal?labelColor=1C2C2E&style=flat-square) --> ![Crates.io](https://img.shields.io/crates/l/esp32h2-hal?labelColor=1C2C2E&style=flat-square)
[![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&labelColor=1C2C2E&color=BEC5C9&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org) [![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&labelColor=1C2C2E&color=BEC5C9&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org)
`no_std` HAL for the ESP32-H2 from Espressif. Implements a number of the traits defined by [embedded-hal](https://github.com/rust-embedded/embedded-hal). `no_std` HAL for the ESP32-H2 from Espressif. Implements a number of the traits defined by [embedded-hal](https://github.com/rust-embedded/embedded-hal).
This device uses the RISC-V ISA, which is officially supported by the Rust compiler via the `riscv32imac-unknown-none-elf` target. Refer to the [Getting Started](#getting-started) section below for more information. This device uses the RISC-V ISA, which is officially supported by the Rust compiler via the `riscv32imac-unknown-none-elf` target. Refer to the [Getting Started](#getting-started) section below for more information.
<!-- ## [Documentation] ## [Documentation]
[documentation]: https://docs.rs/esp32h2-hal/ --> [documentation]: https://docs.rs/esp32h2-hal/
## Getting Started ## Getting Started
@ -33,7 +33,7 @@ By default, [espflash](https://github.com/esp-rs/espflash) fetches the required
#### Direct Boot #### Direct Boot
Direct Boot allows an application stored in the External Flash to be executed directly, without being copied into Internal RAM. [Direct Boot](https://github.com/espressif/esp32c3-direct-boot-example#direct-boot-in-esp32-c3) allows an application stored in the External Flash to be executed directly, without being copied into Internal RAM.
##### Booting the Hello World example using Direct Boot ##### Booting the Hello World example using Direct Boot
@ -73,4 +73,4 @@ at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in
the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without
any additional terms or conditions. any additional terms or conditions.