Fatal error: driver/temperature_sensor.h: No such file or directory

Hello, sorry for, probably, such a simple question, trying to switch from Arduino IDE to VSCode+Platformio for ESP32 projects, so they don’t take half a day to compile, and I had a project in Arduino IDE using ESP32S2 that uses this header file:
#include “driver/temperature_sensor.h”

After installing Platformio in VSCode I imported this project, renamed the .ino file to .cpp, added #include “Arduino.h” and the necessary libraries like adafruit_gfx, onewire, dallastemperature etc using the PIO Home>Projects>(projectname)-Configure>Library Options and it will compile fine, but part of the project also requires monitoring the internal chip temperature that uses that temperature_sensor.h, but I cannot figure out how to add the necessary path information so the compiler knows where to find this.
As far as I understand it, in Arduino IDE it is done automatically somehow, and the necessary files are located “C:\Users(username)\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-bd2b9390ef\esp32s2\include\driver\temperature_sensor\include\driver\temperature_sensor.h”

But what must I do in Platformio to let the compiler find it?

As per release page, PlatformIO’s standard espressif32 platform uses Arduino-ESP32 v2.0.16. The files from your Arduino IDE show that you are using Arduino-ESP32 3.x. As thus, the file won’t be found in PlatformIO.

You can make PlatformIO use Arduino-ESP32 3.x as per Making Sense of the upload Behavior of an ESP32C3 SuperMini - #5 by maxgerhardt or Problems with alternative ESP32 arduino core 3 - #2 by sivar2311

PlatformIO does not use any Arduino package files. It has its own package management. All configuration must be done via the platformio.ini per above.

that much I understand, what I couldn’t figure out, or perhaps was searching using wrong keywords, was how to find where Platformio is keeping board specific header files and how to include them like in was done in the Arduino IDE example:

All PlatformIO files are in C:\Users\<user>\.platformio\packages. E.g., framework-arduinoespressif will have the Arduino-ESP32 core downloaded. If you followed the above instructions to use Arduino-ESP32 3.x, you will also have framework-arduinoespressif32-libs.