Missing #include headers for core ESP32 GPIO filtering - uptodate packages

Beginner here - using VSCode + PIO for the first time.

Goal: I am trying to implement hardware GPIO glitch filtering for the ESP32 S2/S3 series as per Glitch Filtering from Espressif.

All packages are updated using CLI pio upgrade and pkg update commands.

PIO 6.1.15
Platform Manager: espressif32@6.8.1 is already up-to-date
Tool Manager: framework-arduinoespressif32@3.20017.0 is already up-to-date
Tool Manager: tool-esptoolpy@1.40501.0 is already up-to-date
Tool Manager: toolchain-riscv32-esp@8.4.0+2021r2-patch5 is already up-to-date
Tool Manager: toolchain-xtensa-esp32s2@8.4.0+2021r2-patch5 is already up-to-date

Platformio.ini contents:

[env:lolin_s2_mini]

platform = espressif32

board = lolin_s2_mini

framework = arduino

lib_deps =

4-20ma/ModbusMaster@^2.0.1

build_flags = -I include

My includes:

#include <ModbusMaster.h>

#include <driver/gpio_filter.h>

Compile failes with GPIO_filter not found. I would have thought this would have been included as standard as this is a ‘core’ Espressif API feature, but I am probably wrong. Can anyone point me in the right direction as to what I am doing wrong here, so I can try to implement this glitch filtering?

The GPIO filtering is available since ESP-IDF 5.x (Espressif Arduino 3.x) which is not available on PlatformIO yet.

See Support Arduino ESP32 v3.0 based on ESP-IDF v5.1 · Issue #1225 · platformio/platform-espressif32 · GitHub