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

Gp timer api #332

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 13 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ alloc = []
nightly = ["embedded-hal-async", "embedded-io-async"]
esp-idf-sys = ["dep:esp-idf-sys", "atomic-waker"]
riscv-ulp-hal = []
wake-from-isr = [] # Only enable if you plan to use the `edge-executor` crate
embassy-sync = [] # Only for backwards compatibility
wake-from-isr = [] # Only enable if you plan to use the `edge-executor` crate
embassy-sync = [] # Only for backwards compatibility
gp_timer_api = [] # ESP-IDF 5 generap purpose timer api


# Propagated esp-idf-sys features
native = ["esp-idf-sys/native"]
Expand All @@ -37,12 +39,16 @@ libstart = ["esp-idf-sys/libstart"]
nb = "1.0.0"
embedded-can = "0.4.1"
embedded-hal = "=1.0.0-rc.1"
embedded-hal-0-2 = { package = "embedded-hal", version = "0.2.7", features = ["unproven"] }
embedded-hal-0-2 = { package = "embedded-hal", version = "0.2.7", features = [
"unproven",
] }
embedded-hal-nb = "=1.0.0-rc.1"
embedded-hal-async = { version = "=1.0.0-rc.1", optional = true }
embedded-io = "0.6"
embedded-io-async = { version = "0.6", optional = true }
esp-idf-sys = { version = "0.33.5", optional = true, default-features = false, features = ["native"] }
esp-idf-sys = { version = "0.33.5", optional = true, default-features = false, features = [
"native",
] }
critical-section = { version = "1.1.1", optional = true }
heapless = "0.7"
num_enum = { version = "0.7", default-features = false }
Expand All @@ -51,6 +57,9 @@ log = { version = "0.4", default-features = false }
atomic-waker = { version = "1.1.1", optional = true, default-features = false }
embassy-sync = { version = "0.3" }

[patch.crates-io]
esp-idf-sys = { git = "https://github.com/Vollbrecht/esp-idf-sys", branch = "gp-timer-api"}

[build-dependencies]
embuild = "0.31.3"

Expand Down
9 changes: 9 additions & 0 deletions src/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use crate::spi;
))]
use crate::task::watchdog;
#[cfg(not(feature = "riscv-ulp-hal"))]
#[cfg(not(feature = "gp_timer_api"))]
use crate::timer;
#[cfg(not(feature = "riscv-ulp-hal"))]
use crate::uart;
Expand Down Expand Up @@ -124,24 +125,28 @@ pub struct Peripherals {
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer00")
))]
#[cfg(not(feature = "gp_timer_api"))]
pub timer00: timer::TIMER00,
#[cfg(all(
any(esp32, esp32s2, esp32s3),
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer01")
))]
#[cfg(not(feature = "gp_timer_api"))]
pub timer01: timer::TIMER01,
#[cfg(all(
not(esp32c2),
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer10")
))]
#[cfg(not(feature = "gp_timer_api"))]
pub timer10: timer::TIMER10,
#[cfg(all(
any(esp32, esp32s2, esp32s3),
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer11")
))]
#[cfg(not(feature = "gp_timer_api"))]
pub timer11: timer::TIMER11,
#[cfg(all(
not(feature = "riscv-ulp-hal"),
Expand Down Expand Up @@ -278,24 +283,28 @@ impl Peripherals {
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer00")
))]
#[cfg(not(feature = "gp_timer_api"))]
timer00: timer::TIMER00::new(),
#[cfg(all(
any(esp32, esp32s2, esp32s3),
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer01")
))]
#[cfg(not(feature = "gp_timer_api"))]
timer01: timer::TIMER01::new(),
#[cfg(all(
not(esp32c2),
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer10")
))]
#[cfg(not(feature = "gp_timer_api"))]
timer10: timer::TIMER10::new(),
#[cfg(all(
any(esp32, esp32s2, esp32s3),
not(feature = "riscv-ulp-hal"),
not(feature = "embassy-time-isr-queue-timer11")
))]
#[cfg(not(feature = "gp_timer_api"))]
timer11: timer::TIMER11::new(),
#[cfg(all(
not(feature = "riscv-ulp-hal"),
Expand Down
Loading