espidf
C+ bindings for ESP-IDF on the esp32-xtensa target: just enough of the
platform for a control loop to drive pins, read the clock, sleep, and print. See
Embedded & ESP32 for the bigger picture.
Four modules:
espidf/gpio—reset,set_direction,set_level,get_level, and the mode values.espidf/timer—now_us, theesp_timerclock asi64microseconds since boot.espidf/task—delay_ms/delay_us(newlibusleep, so they are tick-rate independent).espidf/log—print_line/print_i32/print_i64over the UART.
The gpio and timer externs are #[no_alloc] + #[no_block] leaves, so a
#[realtime] control loop can call them and keep its contract.
The bindings themselves stay on i32 / u32 / *u8 and #str_ptr literals so
they are usable from #[no_alloc] code, while Text / Vec remain available on
the chip's newlib heap when you do want them.
Building and entry point
A consuming package declares espidf = "*" and builds as a [lib] staticlib:
cpc build --target esp32-xtensa
cpc stops at the archive; the ESP-IDF / CMake build links the firmware (the
bound symbols live in IDF's driver, esp_timer, and newlib components). The
app exports cplus_app_main, and IDF's main component keeps a two-line C shim
that calls it from app_main. The full entry convention is on the
Embedded & ESP32 page.