Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ jobs:
cd esp32s2-hal/
cargo +esp check --example=embassy_hello_world --features=embassy,embassy-time-timg0,embassy-executor-thread
cargo +esp check --example=embassy_multiprio --features=embassy,embassy-time-timg0,embassy-executor-interrupt
- name: check esp32s2-hal (embassy, systick)
run: |
cd esp32s2-hal/
cargo +esp check --example=embassy_hello_world --features=embassy,embassy-time-systick,embassy-executor-thread
cargo +esp check --example=embassy_multiprio --features=embassy,embassy-time-systick,embassy-executor-interrupt
- name: check esp32s2-hal (embassy, timg0, async)
run: |
cd esp32s2-hal/
Expand All @@ -420,6 +425,13 @@ jobs:
cargo +esp check --example=embassy_i2s_sound --features=embassy,embassy-time-timg0,async,embassy-executor-thread
cargo +esp check --example=embassy_rmt_rx --features=embassy,embassy-time-timg0,async,embassy-executor-thread --release
cargo +esp check --example=embassy_rmt_tx --features=embassy,embassy-time-timg0,async,embassy-executor-thread
- name: check esp32s2-hal (embassy, systick, async)
run: |
cd esp32s2-hal/
cargo +esp check --example=embassy_wait --features=embassy,embassy-time-systick,async,embassy-executor-thread
cargo +esp check --example=embassy_spi --features=embassy,embassy-time-systick,async,embassy-executor-thread
cargo +esp check --example=embassy_serial --features=embassy,embassy-time-systick,async,embassy-executor-thread
cargo +esp check --example=embassy_i2c --features=embassy,embassy-time-systick,async,embassy-executor-thread
- name: check esp32s2-hal (embassy, log/defmt)
run: |
cd esp32s2-hal/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added `embassy-time-systick` to ESP32-S2 (#827)
- Implement enabling/disabling BLE clock on ESP32-C6 (#784)
- Async support for RMT (#787)
- Implement `defmt::Format` for more types (#786)
Expand Down
2 changes: 1 addition & 1 deletion esp-hal-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ embedded-hal-async = { version = "=1.0.0-rc.1", optional = true }
embedded-io-async = { version = "0.5.0", optional = true }
embassy-executor = { version = "0.3.0", features = ["integrated-timers"], optional = true }
embassy-sync = { version = "0.3.0", optional = true }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }
embassy-futures = { version = "0.1.0", optional = true }

# RISC-V
Expand Down
2 changes: 1 addition & 1 deletion esp32-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ categories = [

[dependencies]
esp-hal-common = { version = "0.12.0", features = ["esp32"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }

[dev-dependencies]
aes = "0.8.3"
Expand Down
2 changes: 1 addition & 1 deletion esp32c2-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ categories = [

[dependencies]
esp-hal-common = { version = "0.12.0", features = ["esp32c2"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }

[dev-dependencies]
critical-section = "1.1.2"
Expand Down
2 changes: 1 addition & 1 deletion esp32c3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ categories = [
[dependencies]
cfg-if = "1.0.0"
esp-hal-common = { version = "0.12.0", features = ["esp32c3"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }

[dev-dependencies]
aes = "0.8.3"
Expand Down
2 changes: 1 addition & 1 deletion esp32c6-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ categories = [

[dependencies]
esp-hal-common = { version = "0.12.0", features = ["esp32c6"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }

[dev-dependencies]
aes = "0.8.3"
Expand Down
2 changes: 1 addition & 1 deletion esp32h2-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ categories = [

[dependencies]
esp-hal-common = { version = "0.12.0", features = ["esp32h2"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }

[dev-dependencies]
aes = "0.8.3"
Expand Down
7 changes: 2 additions & 5 deletions esp32s2-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ categories = [

[dependencies]
esp-hal-common = { version = "0.12.0", features = ["esp32s2"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }
xtensa-atomic-emulation-trap = "0.4.0"

[dev-dependencies]
Expand Down Expand Up @@ -66,10 +66,7 @@ vectored = ["esp-hal-common/vectored"]

# Embassy support
embassy = ["esp-hal-common/embassy"]
# FIXME:
# - add 80_000_000 support to embassy time
# - Fix https://github.com/esp-rs/esp-hal/issues/253
# embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-1_000_000"]
embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-80_000_000"]
embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"]
embassy-executor-interrupt = ["esp-hal-common/embassy-executor-interrupt"]
embassy-executor-thread = ["esp-hal-common/embassy-executor-thread"]
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ async fn main(spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ async fn main(_spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
14 changes: 11 additions & 3 deletions esp32s2-hal/examples/embassy_i2s_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use esp32s2_hal::{
pdma::Dma,
peripherals::Peripherals,
prelude::*,
timer::TimerGroup,
IO,
};
use esp_backtrace as _;
Expand All @@ -38,8 +37,17 @@ async fn main(_spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

let timer_group0 = TimerGroup::new(peripherals.TIMG0, &clocks);
embassy::init(&clocks, timer_group0.timer0);
#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
embassy::init(&clocks, timer_group0.timer0);
}

let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);

Expand Down
14 changes: 11 additions & 3 deletions esp32s2-hal/examples/embassy_i2s_sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ use esp32s2_hal::{
pdma::Dma,
peripherals::Peripherals,
prelude::*,
timer::TimerGroup,
IO,
};
use esp_backtrace as _;
Expand All @@ -63,8 +62,17 @@ async fn main(_spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

let timer_group0 = TimerGroup::new(peripherals.TIMG0, &clocks);
embassy::init(&clocks, timer_group0.timer0);
#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
embassy::init(&clocks, timer_group0.timer0);
}

let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);

Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_multiprio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ fn main() -> ! {
// Set GPIO2 as an output, and set its state high initially.
let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_rmt_rx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ async fn main(spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_rmt_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ async fn main(_spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ async fn main(spawner: Spawner) {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ async fn main(_spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
6 changes: 6 additions & 0 deletions esp32s2-hal/examples/embassy_wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ async fn main(_spawner: Spawner) -> ! {
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

#[cfg(feature = "embassy-time-systick")]
embassy::init(
&clocks,
esp32s2_hal::systimer::SystemTimer::new(peripherals.SYSTIMER),
);

#[cfg(feature = "embassy-time-timg0")]
{
let timer_group0 = esp32s2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks);
Expand Down
2 changes: 2 additions & 0 deletions esp32s2-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
//! using this feature.
//! - `embassy-executor-interrupt` - Use the interrupt-mode embassy executor
//! - `embassy-executor-thread` - Use the thread-mode embassy executor
//! - `embassy-time-systick` - Enable the [embassy] time driver using the
//! `SYSTIMER` peripheral
//! - `embassy-time-timg0` - Enable the [embassy] time driver using the `TIMG0`
//! peripheral
//! - `log` - enable log output using the `log` crate
Expand Down
2 changes: 1 addition & 1 deletion esp32s3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ categories = [

[dependencies]
esp-hal-common = { version = "0.12.0", features = ["esp32s3"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.3", features = ["nightly"], optional = true }
embassy-time = { version = "0.1.4", features = ["nightly"], optional = true }
r0 = { version = "1.0.0", optional = true }

[dev-dependencies]
Expand Down