Skip to main content

Module delay

Module 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§

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

Constants§

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

Type Aliases§

TickType_t
The raw OS tick type. Also see TickType.