Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use newly published versions of all PACs in esp-hal #2025

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions esp-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ xtensa-lx = { version = "0.9.0", optional = true }
# IMPORTANT:
# Each supported device MUST have its PAC included below along with a
# corresponding feature.
esp32 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32c2 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32c3 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32c6 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32h2 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32s2 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32s3 = { git = "https://github.com/esp-rs/esp-pacs", rev = "bf5890e", features = ["critical-section", "rt"], optional = true }
esp32 = { version = "0.33.0", features = ["critical-section", "rt"], optional = true }
esp32c2 = { version = "0.22.0", features = ["critical-section", "rt"], optional = true }
esp32c3 = { version = "0.25.0", features = ["critical-section", "rt"], optional = true }
esp32c6 = { version = "0.16.0", features = ["critical-section", "rt"], optional = true }
esp32h2 = { version = "0.12.0", features = ["critical-section", "rt"], optional = true }
esp32s2 = { version = "0.24.0", features = ["critical-section", "rt"], optional = true }
esp32s3 = { version = "0.28.0", features = ["critical-section", "rt"], optional = true }

[target.'cfg(target_arch = "riscv32")'.dependencies]
esp-riscv-rt = { version = "0.9.0", path = "../esp-riscv-rt" }
Expand Down
15 changes: 2 additions & 13 deletions esp-hal/src/gpio/rtc_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,13 @@ impl<'d, const PIN: u8> LowPowerOutputOpenDrain<'d, PIN> {
}
}

#[cfg(esp32s3)]
#[inline(always)]
fn get_pin_reg(pin: u8) -> &'static crate::peripherals::rtc_io::TOUCH_PAD0 {
unsafe {
let rtc_io = &*crate::peripherals::RTC_IO::PTR;
let pin_ptr = (rtc_io.touch_pad0().as_ptr()).add(pin as usize);

&*(pin_ptr as *const esp32s3::generic::Reg<esp32s3::rtc_io::touch_pad0::TOUCH_PAD0_SPEC>)
}
}

#[cfg(esp32s2)]
#[cfg(any(esp32s2, esp32s3))]
#[inline(always)]
fn get_pin_reg(pin: u8) -> &'static crate::peripherals::rtc_io::TOUCH_PAD {
unsafe {
let rtc_io = &*crate::peripherals::RTC_IO::PTR;
let pin_ptr = (rtc_io.touch_pad(0).as_ptr()).add(pin as usize);

&*(pin_ptr as *const esp32s2::generic::Reg<esp32s2::rtc_io::touch_pad::TOUCH_PAD_SPEC>)
&*(pin_ptr as *const crate::peripherals::rtc_io::TOUCH_PAD)
}
}
60 changes: 30 additions & 30 deletions esp-hal/src/soc/esp32s3/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,21 @@ crate::gpio::gpio! {
}

crate::gpio::analog! {
( 0, 0, touch_pad0(), mux_sel, fun_sel, fun_ie, rue, rde)
( 1, 1, touch_pad1(), mux_sel, fun_sel, fun_ie, rue, rde)
( 2, 2, touch_pad2(), mux_sel, fun_sel, fun_ie, rue, rde)
( 3, 3, touch_pad3(), mux_sel, fun_sel, fun_ie, rue, rde)
( 4, 4, touch_pad4(), mux_sel, fun_sel, fun_ie, rue, rde)
( 5, 5, touch_pad5(), mux_sel, fun_sel, fun_ie, rue, rde)
( 6, 6, touch_pad6(), mux_sel, fun_sel, fun_ie, rue, rde)
( 7, 7, touch_pad7(), mux_sel, fun_sel, fun_ie, rue, rde)
( 8, 8, touch_pad8(), mux_sel, fun_sel, fun_ie, rue, rde)
( 9, 9, touch_pad9(), mux_sel, fun_sel, fun_ie, rue, rde)
(10, 10, touch_pad10(), mux_sel, fun_sel, fun_ie, rue, rde)
(11, 11, touch_pad11(), mux_sel, fun_sel, fun_ie, rue, rde)
(12, 12, touch_pad12(), mux_sel, fun_sel, fun_ie, rue, rde)
(13, 13, touch_pad13(), mux_sel, fun_sel, fun_ie, rue, rde)
(14, 14, touch_pad14(), mux_sel, fun_sel, fun_ie, rue, rde)
( 0, 0, touch_pad(0), mux_sel, fun_sel, fun_ie, rue, rde)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet

( 1, 1, touch_pad(1), mux_sel, fun_sel, fun_ie, rue, rde)
( 2, 2, touch_pad(2), mux_sel, fun_sel, fun_ie, rue, rde)
( 3, 3, touch_pad(3), mux_sel, fun_sel, fun_ie, rue, rde)
( 4, 4, touch_pad(4), mux_sel, fun_sel, fun_ie, rue, rde)
( 5, 5, touch_pad(5), mux_sel, fun_sel, fun_ie, rue, rde)
( 6, 6, touch_pad(6), mux_sel, fun_sel, fun_ie, rue, rde)
( 7, 7, touch_pad(7), mux_sel, fun_sel, fun_ie, rue, rde)
( 8, 8, touch_pad(8), mux_sel, fun_sel, fun_ie, rue, rde)
( 9, 9, touch_pad(9), mux_sel, fun_sel, fun_ie, rue, rde)
(10, 10, touch_pad(10), mux_sel, fun_sel, fun_ie, rue, rde)
(11, 11, touch_pad(11), mux_sel, fun_sel, fun_ie, rue, rde)
(12, 12, touch_pad(12), mux_sel, fun_sel, fun_ie, rue, rde)
(13, 13, touch_pad(13), mux_sel, fun_sel, fun_ie, rue, rde)
(14, 14, touch_pad(14), mux_sel, fun_sel, fun_ie, rue, rde)
(15, 15, xtal_32p_pad(), x32p_mux_sel, x32p_fun_sel, x32p_fun_ie, x32p_rue, x32p_rde)
(16, 16, xtal_32n_pad(), x32n_mux_sel, x32n_fun_sel, x32n_fun_ie, x32n_rue, x32n_rde)
(17, 17, pad_dac1(), pdac1_mux_sel,pdac1_fun_sel,pdac1_fun_ie, pdac1_rue, pdac1_rde)
Expand All @@ -430,21 +430,21 @@ crate::gpio::analog! {
}

crate::gpio::rtc_pins! {
( 0, 0, touch_pad0(), "", touch_pad0_hold, rue, rde)
( 1, 1, touch_pad1(), "", touch_pad1_hold, rue, rde)
( 2, 2, touch_pad2(), "", touch_pad2_hold, rue, rde)
( 3, 3, touch_pad3(), "", touch_pad3_hold, rue, rde)
( 4, 4, touch_pad4(), "", touch_pad4_hold, rue, rde)
( 5, 5, touch_pad5(), "", touch_pad5_hold, rue, rde)
( 6, 6, touch_pad6(), "", touch_pad6_hold, rue, rde)
( 7, 7, touch_pad7(), "", touch_pad7_hold, rue, rde)
( 8, 8, touch_pad8(), "", touch_pad8_hold, rue, rde)
( 9, 9, touch_pad9(), "", touch_pad9_hold, rue, rde)
(10, 10, touch_pad10(), "", touch_pad10_hold, rue, rde)
(11, 11, touch_pad11(), "", touch_pad11_hold, rue, rde)
(12, 12, touch_pad12(), "", touch_pad12_hold, rue, rde)
(13, 13, touch_pad13(), "", touch_pad13_hold, rue, rde)
(14, 14, touch_pad14(), "", touch_pad14_hold, rue, rde)
( 0, 0, touch_pad(0), "", touch_pad0_hold, rue, rde)
( 1, 1, touch_pad(1), "", touch_pad1_hold, rue, rde)
( 2, 2, touch_pad(2), "", touch_pad2_hold, rue, rde)
( 3, 3, touch_pad(3), "", touch_pad3_hold, rue, rde)
( 4, 4, touch_pad(4), "", touch_pad4_hold, rue, rde)
( 5, 5, touch_pad(5), "", touch_pad5_hold, rue, rde)
( 6, 6, touch_pad(6), "", touch_pad6_hold, rue, rde)
( 7, 7, touch_pad(7), "", touch_pad7_hold, rue, rde)
( 8, 8, touch_pad(8), "", touch_pad8_hold, rue, rde)
( 9, 9, touch_pad(9), "", touch_pad9_hold, rue, rde)
(10, 10, touch_pad(10), "", touch_pad10_hold, rue, rde)
(11, 11, touch_pad(11), "", touch_pad11_hold, rue, rde)
(12, 12, touch_pad(12), "", touch_pad12_hold, rue, rde)
(13, 13, touch_pad(13), "", touch_pad13_hold, rue, rde)
(14, 14, touch_pad(14), "", touch_pad14_hold, rue, rde)
(15, 15, xtal_32p_pad(), x32p_, x32p_hold, x32p_rue, x32p_rde)
(16, 16, xtal_32n_pad(), x32n_, x32n_hold, x32n_rue, x32n_rde)
(17, 17, pad_dac1(), pdac1_, pdac1_hold, pdac1_rue, pdac1_rde)
Expand Down
18 changes: 7 additions & 11 deletions esp-hal/src/timer/timg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ where
.modify(|_, w| w.level_int_en().set_bit());

self.register_block()
.int_ena_timers()
.int_ena()
.modify(|_, w| w.t(self.timer_number()).bit(state));
}

fn clear_interrupt(&self) {
self.register_block()
.int_clr_timers()
.int_clr()
.write(|w| w.t(self.timer_number()).clear_bit_by_one());
}

Expand All @@ -512,7 +512,7 @@ where

fn is_interrupt_set(&self) -> bool {
self.register_block()
.int_raw_timers()
.int_raw()
.read()
.t(self.timer_number())
.bit_is_set()
Expand Down Expand Up @@ -707,19 +707,19 @@ where
.modify(|_, w| w.level_int_en().set_bit());

self.register_block()
.int_ena_timers()
.int_ena()
.modify(|_, w| w.t(T).set_bit());
}

fn unlisten(&self) {
self.register_block()
.int_ena_timers()
.int_ena()
.modify(|_, w| w.t(T).clear_bit());
}

fn clear_interrupt(&self) {
self.register_block()
.int_clr_timers()
.int_clr()
.write(|w| w.t(T).clear_bit_by_one());
}

Expand Down Expand Up @@ -752,11 +752,7 @@ where
}

fn is_interrupt_set(&self) -> bool {
self.register_block()
.int_raw_timers()
.read()
.t(T)
.bit_is_set()
self.register_block().int_raw().read().t(T).bit_is_set()
}

fn set_divider(&self, divider: u16) {
Expand Down