Module esp_idf_svc::hal::delay

source ·
Expand description

Delay providers.

If you don’t know how large your delays will be, you’ll probably want to use Delay. Otherwise use Ets for delays <10ms and FreeRtos for delays >=10ms.

Example of an Ets vs. FreeRtos auto-selecting delay:

    use esp_idf_hal::delay::Delay;

    let delay: Delay = Default::default();
    // ...
    delay.delay_us(42);
    // ...
    delay.delay_ms(142);
    // ...

Example of a small microsecond delay:

    use esp_idf_hal::delay::Ets;

    Ets::delay_us(42);

Example of a millisecond delay:

    use esp_idf_hal::delay::FreeRtos;

    FreeRtos::delay_ms(42);

Example of an embedded_hal::delay::DelayNs consumer with an Ets vs. FreeRtos auto-selecting delay:

    use esp_idf_hal::delay::Delay;

    let mut delay: Delay = Default::default();
    some_trait_user(&mut delay);

Structs§

  • A delay provider that uses Ets for delays below a certain threshold and FreeRtos for delays equal or above the threshold.
  • Espressif’s built-in delay provider for small delays
  • FreeRTOS-based delay provider for delays larger than 10 ms.
  • Transparent wrapper around TickType_t with conversion methods.

Constants§

  • Sentinel value used as “maximum delay” or “maximum blocking” marker.
  • Sentinel value used as “no delay” or “no blocking” marker.
  • The configured OS tick rate in Hz. There are TICK_RATE_HZ number of TickType ticks per second.

Type Aliases§