Module esp32c3_hal::systimer

source ·
Expand description

System Timer peripheral driver

Overview

This software module provides an interface to interact with the system timer (SYSTIMER) peripheral on ESP microcontroller chips.

Each ESP chip provides a timer (52-bit or 64-bit, depends on chip), which can be used to generate tick interrupts for operating system, or be used as a general timer to generate periodic interrupts or one-time interrupts. With the help of the RTC timer, system timer can be kept up to date after Light-sleep or Deep-sleep.

The driver supports features such as retrieving the current system time, setting alarms for specific time points or periodic intervals, enabling and clearing interrupts, configuring various settings of the system timer.

By using the SYSTIMER peripheral driver, you can leverage the system timer functionality of ESP chips for accurate timing measurements, event triggering and synchronization in your applications.

Example

let peripherals = Peripherals::take();

let syst = SystemTimer::new(peripherals.SYSTIMER);
println!("SYSTIMER Current value = {}", SystemTimer::now());

Structs