From 68a4fb29ed163f01107c0560caf2cc94325a1608 Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Thu, 2 May 2024 13:27:33 +0000 Subject: [PATCH] [1/3] Timer abstraction: refactor `systimer` and `timer` modules into a common `timer` module (#1527) * Refactor `systimer` and `timer` modules into a common `timer` module * Update `CHANGELOG.md` * Rebase and update new example --- esp-hal/CHANGELOG.md | 4 +++- esp-hal/src/delay.rs | 2 +- esp-hal/src/embassy/time_driver_systimer.rs | 2 +- esp-hal/src/embassy/time_driver_timg.rs | 4 ++-- esp-hal/src/lib.rs | 4 +--- esp-hal/src/prelude.rs | 6 +++--- esp-hal/src/soc/esp32/mod.rs | 2 +- esp-hal/src/soc/esp32c2/mod.rs | 2 +- esp-hal/src/soc/esp32c3/mod.rs | 2 +- esp-hal/src/soc/esp32c6/mod.rs | 2 +- esp-hal/src/soc/esp32h2/mod.rs | 2 +- esp-hal/src/soc/esp32s2/mod.rs | 2 +- esp-hal/src/soc/esp32s3/mod.rs | 2 +- esp-hal/src/time.rs | 4 ++-- esp-hal/src/timer/mod.rs | 6 ++++++ esp-hal/src/{ => timer}/systimer.rs | 0 esp-hal/src/{timer.rs => timer/timg.rs} | 0 examples/src/bin/ecc.rs | 2 +- examples/src/bin/embassy_hello_world.rs | 2 +- examples/src/bin/embassy_hello_world_systimer.rs | 2 +- examples/src/bin/embassy_i2c.rs | 2 +- examples/src/bin/embassy_i2c_bmp180_calibration_data.rs | 2 +- examples/src/bin/embassy_i2s_read.rs | 2 +- examples/src/bin/embassy_i2s_sound.rs | 2 +- examples/src/bin/embassy_multicore.rs | 2 +- examples/src/bin/embassy_multicore_interrupt.rs | 2 +- examples/src/bin/embassy_multiprio.rs | 2 +- examples/src/bin/embassy_parl_io_rx.rs | 2 +- examples/src/bin/embassy_parl_io_tx.rs | 2 +- examples/src/bin/embassy_rmt_rx.rs | 2 +- examples/src/bin/embassy_rmt_tx.rs | 2 +- examples/src/bin/embassy_serial.rs | 2 +- examples/src/bin/embassy_spi.rs | 2 +- examples/src/bin/embassy_systimer_delay.rs | 3 +-- examples/src/bin/embassy_twai.rs | 2 +- examples/src/bin/embassy_usb_serial.rs | 2 +- examples/src/bin/embassy_usb_serial_jtag.rs | 2 +- examples/src/bin/embassy_wait.rs | 2 +- examples/src/bin/etm_blinky_systimer.rs | 2 +- examples/src/bin/etm_timer.rs | 2 +- examples/src/bin/hmac.rs | 2 +- examples/src/bin/systimer.rs | 2 +- examples/src/bin/timer_interrupt.rs | 2 +- examples/src/bin/watchdog.rs | 2 +- examples/src/lib.rs | 2 +- hil-test/tests/gpio.rs | 2 +- 46 files changed, 55 insertions(+), 50 deletions(-) create mode 100644 esp-hal/src/timer/mod.rs rename esp-hal/src/{ => timer}/systimer.rs (100%) rename esp-hal/src/{timer.rs => timer/timg.rs} (100%) diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index d9223f9559f..badf76e824c 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -6,11 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + - Updated example on i2c to use the new `interrupt_handler` parameter (#1376) ### Added -- i2c: implement `I2C:transaction` for `embedded-hal` and `embedded-hal-async` +- i2c: implement `I2C:transaction` for `embedded-hal` and `embedded-hal-async` - ESP32-PICO-V3-02: Initial support (#1155) - `time::current_time` API (#1503) - ESP32-S3: Add LCD_CAM Camera driver (#1483) @@ -30,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - RNG is no longer TRNG, the `CryptoRng` implementation has been removed. To track this being re-added see #1499 (#1498) - Make software interrupts shareable (#1500) - The `SystemParts` struct has been renamed to `SystemControl`, and now has a constructor which takes the `SYSTEM` peripheral (#1495) +- Timer abstraction: refactor `systimer` and `timer` modules into a common `timer` module (#1527) ### Removed diff --git a/esp-hal/src/delay.rs b/esp-hal/src/delay.rs index c747a4df3ff..72575de0fdd 100644 --- a/esp-hal/src/delay.rs +++ b/esp-hal/src/delay.rs @@ -75,7 +75,7 @@ impl embedded_hal::delay::DelayNs for Delay { #[cfg(riscv)] mod implementation { use super::*; - use crate::{clock::Clocks, systimer::SystemTimer}; + use crate::{clock::Clocks, timer::systimer::SystemTimer}; impl Delay { /// Create a new `Delay` instance diff --git a/esp-hal/src/embassy/time_driver_systimer.rs b/esp-hal/src/embassy/time_driver_systimer.rs index 5a5ed6ca868..300198d2090 100644 --- a/esp-hal/src/embassy/time_driver_systimer.rs +++ b/esp-hal/src/embassy/time_driver_systimer.rs @@ -5,7 +5,7 @@ use super::AlarmState; use crate::{ clock::Clocks, peripherals, - systimer::{Alarm, SystemTimer, Target}, + timer::systimer::{Alarm, SystemTimer, Target}, }; pub const ALARM_COUNT: usize = 3; diff --git a/esp-hal/src/embassy/time_driver_timg.rs b/esp-hal/src/embassy/time_driver_timg.rs index ffc3cfc91d4..c88ad982ca9 100644 --- a/esp-hal/src/embassy/time_driver_timg.rs +++ b/esp-hal/src/embassy/time_driver_timg.rs @@ -3,12 +3,12 @@ use peripherals::TIMG0; use super::AlarmState; #[cfg(any(esp32, esp32s2, esp32s3))] -use crate::timer::Timer1; +use crate::timer::timg::Timer1; use crate::{ clock::Clocks, peripherals, prelude::*, - timer::{Instance, Timer0, TimerGroup}, + timer::timg::{Instance, Timer0, TimerGroup}, }; #[cfg(not(any(esp32, esp32s2, esp32s3)))] diff --git a/esp-hal/src/lib.rs b/esp-hal/src/lib.rs index b9ce22a37fc..9f9cabaa046 100644 --- a/esp-hal/src/lib.rs +++ b/esp-hal/src/lib.rs @@ -151,10 +151,8 @@ pub mod sha; pub mod spi; #[cfg(any(dport, hp_sys, pcr, system))] pub mod system; -#[cfg(systimer)] -pub mod systimer; pub mod time; -#[cfg(any(timg0, timg1))] +#[cfg(any(systimer, timg0, timg1))] pub mod timer; #[cfg(trace0)] pub mod trace; diff --git a/esp-hal/src/prelude.rs b/esp-hal/src/prelude.rs index 0475184ef6c..8be8fb9eb8f 100644 --- a/esp-hal/src/prelude.rs +++ b/esp-hal/src/prelude.rs @@ -37,9 +37,9 @@ pub use crate::ledc::{ timer::{TimerHW as _esp_hal_ledc_timer_TimerHW, TimerIFace as _esp_hal_ledc_timer_TimerIFace}, }; #[cfg(any(timg0, timg1))] -pub use crate::timer::{ - Instance as _esp_hal_timer_Instance, - TimerGroupInstance as _esp_hal_timer_TimerGroupInstance, +pub use crate::timer::timg::{ + Instance as _esp_hal_timer_timg_Instance, + TimerGroupInstance as _esp_hal_timer_timg_TimerGroupInstance, }; #[cfg(any(uart0, uart1, uart2))] pub use crate::uart::{Instance as _esp_hal_uart_Instance, UartPins as _esp_hal_uart_UartPins}; diff --git a/esp-hal/src/soc/esp32/mod.rs b/esp-hal/src/soc/esp32/mod.rs index c97a73fa08f..6806e65e0c2 100644 --- a/esp-hal/src/soc/esp32/mod.rs +++ b/esp-hal/src/soc/esp32/mod.rs @@ -8,7 +8,7 @@ use core::ptr::addr_of_mut; use self::peripherals::{LPWR, TIMG0, TIMG1}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod cpu_control; pub mod efuse; diff --git a/esp-hal/src/soc/esp32c2/mod.rs b/esp-hal/src/soc/esp32c2/mod.rs index 341332b9074..2225d460cbf 100644 --- a/esp-hal/src/soc/esp32c2/mod.rs +++ b/esp-hal/src/soc/esp32c2/mod.rs @@ -6,7 +6,7 @@ //! for interacting with various system-related peripherals on `ESP32-C2` chip. use self::peripherals::{LPWR, TIMG0}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod efuse; pub mod gpio; diff --git a/esp-hal/src/soc/esp32c3/mod.rs b/esp-hal/src/soc/esp32c3/mod.rs index b461679a849..8e583f0ca62 100644 --- a/esp-hal/src/soc/esp32c3/mod.rs +++ b/esp-hal/src/soc/esp32c3/mod.rs @@ -10,7 +10,7 @@ //! * I2S_DEFAULT_CLK_SRC: 2 - I2S clock source use self::peripherals::{LPWR, TIMG0, TIMG1}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod efuse; pub mod gpio; diff --git a/esp-hal/src/soc/esp32c6/mod.rs b/esp-hal/src/soc/esp32c6/mod.rs index ef49ce117ce..50f3f9433b1 100644 --- a/esp-hal/src/soc/esp32c6/mod.rs +++ b/esp-hal/src/soc/esp32c6/mod.rs @@ -11,7 +11,7 @@ //! * I2S_SCLK: 160_000_000 - I2S clock frequency use self::peripherals::{LPWR, TIMG0, TIMG1}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod efuse; pub mod gpio; diff --git a/esp-hal/src/soc/esp32h2/mod.rs b/esp-hal/src/soc/esp32h2/mod.rs index a7a0bac0b0f..90aeac63ea4 100644 --- a/esp-hal/src/soc/esp32h2/mod.rs +++ b/esp-hal/src/soc/esp32h2/mod.rs @@ -11,7 +11,7 @@ //! * I2S_SCLK: 96_000_000 - I2S clock frequency use self::peripherals::{LPWR, TIMG0, TIMG1}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod efuse; pub mod gpio; diff --git a/esp-hal/src/soc/esp32s2/mod.rs b/esp-hal/src/soc/esp32s2/mod.rs index f7b30243a23..d9a5b5bdec1 100644 --- a/esp-hal/src/soc/esp32s2/mod.rs +++ b/esp-hal/src/soc/esp32s2/mod.rs @@ -12,7 +12,7 @@ use core::ptr::addr_of_mut; use self::peripherals::{LPWR, TIMG0, TIMG1}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod efuse; pub mod gpio; diff --git a/esp-hal/src/soc/esp32s3/mod.rs b/esp-hal/src/soc/esp32s3/mod.rs index 2f2acaed91a..a35f19512f8 100644 --- a/esp-hal/src/soc/esp32s3/mod.rs +++ b/esp-hal/src/soc/esp32s3/mod.rs @@ -12,7 +12,7 @@ use core::ptr::addr_of_mut; use self::peripherals::{LPWR, TIMG0, TIMG1}; -use crate::{rtc_cntl::Rtc, timer::Wdt}; +use crate::{rtc_cntl::Rtc, timer::timg::Wdt}; pub mod cpu_control; pub mod efuse; diff --git a/esp-hal/src/time.rs b/esp-hal/src/time.rs index 126838696e0..034e7acd228 100644 --- a/esp-hal/src/time.rs +++ b/esp-hal/src/time.rs @@ -42,10 +42,10 @@ pub fn current_time() -> fugit::Instant { #[cfg(not(esp32))] let (ticks, div) = { // otherwise use SYSTIMER - let ticks = crate::systimer::SystemTimer::now(); + let ticks = crate::timer::systimer::SystemTimer::now(); ( ticks, - (crate::systimer::SystemTimer::TICKS_PER_SECOND / 1_000_000), + (crate::timer::systimer::SystemTimer::TICKS_PER_SECOND / 1_000_000), ) }; diff --git a/esp-hal/src/timer/mod.rs b/esp-hal/src/timer/mod.rs new file mode 100644 index 00000000000..17159187547 --- /dev/null +++ b/esp-hal/src/timer/mod.rs @@ -0,0 +1,6 @@ +//! General-purpose timers. + +#[cfg(systimer)] +pub mod systimer; +#[cfg(any(timg0, timg1))] +pub mod timg; diff --git a/esp-hal/src/systimer.rs b/esp-hal/src/timer/systimer.rs similarity index 100% rename from esp-hal/src/systimer.rs rename to esp-hal/src/timer/systimer.rs diff --git a/esp-hal/src/timer.rs b/esp-hal/src/timer/timg.rs similarity index 100% rename from esp-hal/src/timer.rs rename to esp-hal/src/timer/timg.rs diff --git a/examples/src/bin/ecc.rs b/examples/src/bin/ecc.rs index 0b4ec3bf69e..ab097aeadb9 100644 --- a/examples/src/bin/ecc.rs +++ b/examples/src/bin/ecc.rs @@ -23,7 +23,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, rng::Rng, - systimer::SystemTimer, + timer::systimer::SystemTimer, }; use esp_println::{print, println}; use hex_literal::hex; diff --git a/examples/src/bin/embassy_hello_world.rs b/examples/src/bin/embassy_hello_world.rs index 6506df51eb8..26ac4549d59 100644 --- a/examples/src/bin/embassy_hello_world.rs +++ b/examples/src/bin/embassy_hello_world.rs @@ -19,7 +19,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; #[embassy_executor::task] diff --git a/examples/src/bin/embassy_hello_world_systimer.rs b/examples/src/bin/embassy_hello_world_systimer.rs index af3c11aa77a..b11796ead04 100644 --- a/examples/src/bin/embassy_hello_world_systimer.rs +++ b/examples/src/bin/embassy_hello_world_systimer.rs @@ -21,7 +21,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - systimer::SystemTimer, + timer::systimer::SystemTimer, }; #[embassy_executor::task] diff --git a/examples/src/bin/embassy_i2c.rs b/examples/src/bin/embassy_i2c.rs index c5b97b6abc6..2ca34f06819 100644 --- a/examples/src/bin/embassy_i2c.rs +++ b/examples/src/bin/embassy_i2c.rs @@ -28,7 +28,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use lis3dh_async::{Lis3dh, Range, SlaveAddr}; diff --git a/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs b/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs index 83a208216f7..fb3cc37201c 100644 --- a/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs +++ b/examples/src/bin/embassy_i2c_bmp180_calibration_data.rs @@ -29,7 +29,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; #[main] diff --git a/examples/src/bin/embassy_i2s_read.rs b/examples/src/bin/embassy_i2s_read.rs index 92a76bca96f..08009d46cc5 100644 --- a/examples/src/bin/embassy_i2s_read.rs +++ b/examples/src/bin/embassy_i2s_read.rs @@ -30,7 +30,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; diff --git a/examples/src/bin/embassy_i2s_sound.rs b/examples/src/bin/embassy_i2s_sound.rs index 29dcd275179..df80e35bbbe 100644 --- a/examples/src/bin/embassy_i2s_sound.rs +++ b/examples/src/bin/embassy_i2s_sound.rs @@ -45,7 +45,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; diff --git a/examples/src/bin/embassy_multicore.rs b/examples/src/bin/embassy_multicore.rs index 7ab88bdabc0..46ddc6a962c 100644 --- a/examples/src/bin/embassy_multicore.rs +++ b/examples/src/bin/embassy_multicore.rs @@ -25,7 +25,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; use static_cell::make_static; diff --git a/examples/src/bin/embassy_multicore_interrupt.rs b/examples/src/bin/embassy_multicore_interrupt.rs index 649146cb011..d2908ee5ef7 100644 --- a/examples/src/bin/embassy_multicore_interrupt.rs +++ b/examples/src/bin/embassy_multicore_interrupt.rs @@ -25,7 +25,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; use static_cell::make_static; diff --git a/examples/src/bin/embassy_multiprio.rs b/examples/src/bin/embassy_multiprio.rs index c58b17b49af..403af9ca78f 100644 --- a/examples/src/bin/embassy_multiprio.rs +++ b/examples/src/bin/embassy_multiprio.rs @@ -32,7 +32,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; use static_cell::make_static; diff --git a/examples/src/bin/embassy_parl_io_rx.rs b/examples/src/bin/embassy_parl_io_rx.rs index 07612d23790..c0be0866c91 100644 --- a/examples/src/bin/embassy_parl_io_rx.rs +++ b/examples/src/bin/embassy_parl_io_rx.rs @@ -23,7 +23,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; diff --git a/examples/src/bin/embassy_parl_io_tx.rs b/examples/src/bin/embassy_parl_io_tx.rs index 67f673f622f..0378df55db9 100644 --- a/examples/src/bin/embassy_parl_io_tx.rs +++ b/examples/src/bin/embassy_parl_io_tx.rs @@ -34,7 +34,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; diff --git a/examples/src/bin/embassy_rmt_rx.rs b/examples/src/bin/embassy_rmt_rx.rs index d3d2378f868..ea3e27471ae 100644 --- a/examples/src/bin/embassy_rmt_rx.rs +++ b/examples/src/bin/embassy_rmt_rx.rs @@ -45,7 +45,7 @@ async fn main(spawner: Spawner) { let system = SystemControl::new(peripherals.SYSTEM); let clocks = ClockControl::boot_defaults(system.clock_control).freeze(); - let timer_group0 = esp_hal::timer::TimerGroup::new_async(peripherals.TIMG0, &clocks); + let timer_group0 = esp_hal::timer::timg::TimerGroup::new_async(peripherals.TIMG0, &clocks); embassy::init(&clocks, timer_group0); let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); diff --git a/examples/src/bin/embassy_rmt_tx.rs b/examples/src/bin/embassy_rmt_tx.rs index f002ac9f93b..1e33e968972 100644 --- a/examples/src/bin/embassy_rmt_tx.rs +++ b/examples/src/bin/embassy_rmt_tx.rs @@ -20,7 +20,7 @@ use esp_hal::{ prelude::*, rmt::{asynch::TxChannelAsync, PulseCode, Rmt, TxChannelConfig, TxChannelCreatorAsync}, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; diff --git a/examples/src/bin/embassy_serial.rs b/examples/src/bin/embassy_serial.rs index 0b0b80a8d5a..5de67d5e5f7 100644 --- a/examples/src/bin/embassy_serial.rs +++ b/examples/src/bin/embassy_serial.rs @@ -19,7 +19,7 @@ use esp_hal::{ peripherals::{Peripherals, UART0}, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, uart::{config::AtCmdConfig, Uart, UartRx, UartTx}, Async, }; diff --git a/examples/src/bin/embassy_spi.rs b/examples/src/bin/embassy_spi.rs index bca2a4a9daa..46afc87fc9a 100644 --- a/examples/src/bin/embassy_spi.rs +++ b/examples/src/bin/embassy_spi.rs @@ -37,7 +37,7 @@ use esp_hal::{ SpiMode, }, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; #[main] diff --git a/examples/src/bin/embassy_systimer_delay.rs b/examples/src/bin/embassy_systimer_delay.rs index 2bbf9c2d871..1bda407a95e 100644 --- a/examples/src/bin/embassy_systimer_delay.rs +++ b/examples/src/bin/embassy_systimer_delay.rs @@ -18,8 +18,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - systimer::SystemTimer, - timer::TimerGroup, + timer::{systimer::SystemTimer, timg::TimerGroup}, }; #[main] diff --git a/examples/src/bin/embassy_twai.rs b/examples/src/bin/embassy_twai.rs index 8c460b62372..4d6ac16fff4 100644 --- a/examples/src/bin/embassy_twai.rs +++ b/examples/src/bin/embassy_twai.rs @@ -29,7 +29,7 @@ use esp_hal::{ peripherals::{self, Peripherals, TWAI0}, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, twai::{self, EspTwaiFrame, TwaiRx, TwaiTx}, }; use esp_println::println; diff --git a/examples/src/bin/embassy_usb_serial.rs b/examples/src/bin/embassy_usb_serial.rs index 517b879dca8..ab064c75262 100644 --- a/examples/src/bin/embassy_usb_serial.rs +++ b/examples/src/bin/embassy_usb_serial.rs @@ -27,7 +27,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; #[main] diff --git a/examples/src/bin/embassy_usb_serial_jtag.rs b/examples/src/bin/embassy_usb_serial_jtag.rs index 05223a90236..c5fd6fa8b48 100644 --- a/examples/src/bin/embassy_usb_serial_jtag.rs +++ b/examples/src/bin/embassy_usb_serial_jtag.rs @@ -18,7 +18,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, usb_serial_jtag::{UsbSerialJtag, UsbSerialJtagRx, UsbSerialJtagTx}, Async, }; diff --git a/examples/src/bin/embassy_wait.rs b/examples/src/bin/embassy_wait.rs index 649eaec66e0..8c367f130b0 100644 --- a/examples/src/bin/embassy_wait.rs +++ b/examples/src/bin/embassy_wait.rs @@ -19,7 +19,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; #[main] diff --git a/examples/src/bin/etm_blinky_systimer.rs b/examples/src/bin/etm_blinky_systimer.rs index 623d7c0c4cf..65ad3b5a4b4 100644 --- a/examples/src/bin/etm_blinky_systimer.rs +++ b/examples/src/bin/etm_blinky_systimer.rs @@ -11,7 +11,7 @@ use esp_hal::{ gpio::{etm::GpioEtmChannels, Io}, peripherals::Peripherals, prelude::*, - systimer::{etm::SysTimerEtmEvent, SystemTimer}, + timer::systimer::{etm::SysTimerEtmEvent, SystemTimer}, }; use fugit::ExtU32; diff --git a/examples/src/bin/etm_timer.rs b/examples/src/bin/etm_timer.rs index a6698378156..046878b69da 100644 --- a/examples/src/bin/etm_timer.rs +++ b/examples/src/bin/etm_timer.rs @@ -17,7 +17,7 @@ use esp_hal::{ peripherals::{Peripherals, TIMG0}, prelude::*, system::SystemControl, - timer::{ + timer::timg::{ etm::{TimerEtmEvents, TimerEtmTasks}, Timer, Timer0, diff --git a/examples/src/bin/hmac.rs b/examples/src/bin/hmac.rs index f518833cdcd..10392e5a25f 100644 --- a/examples/src/bin/hmac.rs +++ b/examples/src/bin/hmac.rs @@ -65,7 +65,7 @@ use esp_hal::{ prelude::*, rng::Rng, system::SystemControl, - systimer::SystemTimer, + timer::systimer::SystemTimer, }; use esp_println::println; use hmac::{Hmac as HmacSw, Mac}; diff --git a/examples/src/bin/systimer.rs b/examples/src/bin/systimer.rs index 45f241d40ed..5bb4fce4d4f 100644 --- a/examples/src/bin/systimer.rs +++ b/examples/src/bin/systimer.rs @@ -18,7 +18,7 @@ use esp_hal::{ peripherals::{Interrupt, Peripherals}, prelude::*, system::SystemControl, - systimer::{Alarm, Periodic, SystemTimer, Target}, + timer::systimer::{Alarm, Periodic, SystemTimer, Target}, Blocking, }; use esp_println::println; diff --git a/examples/src/bin/timer_interrupt.rs b/examples/src/bin/timer_interrupt.rs index 1abe4ec5ab8..e80b76c1253 100644 --- a/examples/src/bin/timer_interrupt.rs +++ b/examples/src/bin/timer_interrupt.rs @@ -17,7 +17,7 @@ use esp_hal::{ peripherals::{Interrupt, Peripherals, TIMG0}, prelude::*, system::SystemControl, - timer::{Timer, Timer0, TimerGroup, TimerInterrupts}, + timer::timg::{Timer, Timer0, TimerGroup, TimerInterrupts}, }; static TIMER0: Mutex, esp_hal::Blocking>>>> = diff --git a/examples/src/bin/watchdog.rs b/examples/src/bin/watchdog.rs index 026ee8ce0cf..00ba024813c 100644 --- a/examples/src/bin/watchdog.rs +++ b/examples/src/bin/watchdog.rs @@ -15,7 +15,7 @@ use esp_hal::{ peripherals::Peripherals, prelude::*, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; use esp_println::println; diff --git a/examples/src/lib.rs b/examples/src/lib.rs index 3587c09f64e..d81eda6f545 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -8,6 +8,6 @@ pub fn cycles() -> u64 { #[cfg(not(feature = "esp32"))] { - esp_hal::systimer::SystemTimer::now() + esp_hal::timer::systimer::SystemTimer::now() } } diff --git a/hil-test/tests/gpio.rs b/hil-test/tests/gpio.rs index f51847dfcf0..497e104e32a 100644 --- a/hil-test/tests/gpio.rs +++ b/hil-test/tests/gpio.rs @@ -20,7 +20,7 @@ use esp_hal::{ macros::handler, peripherals::Peripherals, system::SystemControl, - timer::TimerGroup, + timer::timg::TimerGroup, }; static COUNTER: Mutex> = Mutex::new(RefCell::new(0));