Hello!
I am using Platformio with an ESP32 D1 MINI in Arduino framework:
[env:wemos_d1_mini32]
platform = espressif32
board = wemos_d1_mini32
framework = arduino
lib_deps =
janelia-arduino/TMC2209@^9.0.7
adafruit/Adafruit GFX Library@^1.11.9
adafruit/Adafruit SSD1306@^2.5.9
Works beautifully so far
I build a capacitive fluid level sensor using the touch API. Espressif provides a pretty good description how that capacity measurement works incl. API:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/touch_pad.html
This in general works good for, let’s say human body touch detection. However I want to modify the voltage thresholds, measurement time and filter settings to tune the measurement quality of my design.
However Arduino framework encapsulates most of that:
https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/touch.html
If I, for example, try to call “touch_pad_get_voltage()” I get an error:
src/main.cpp:60:2: error: ‘touch_pad_get_voltage’ was not declared in this scope
(Yes I know I don’t call the function correctly with pointers etc, but it should complain then about the arguments and not say “not found”…)
I tried to locate the library source code in the Arduino framework, but only found layers of layers of .h files, but wasn’t able to figure out how to access the “lower levels”. Well there are actually comments in the header files not to do so, but what shall I do? Quite confusing to me and clearly out of my C++ capabilities
So I guess my question sums up to: How do I bypass the Arduino HAL and access the ESP HW directly from main.cpp? Is there simply an “#include…” missing to make the EspressIF API available on top level?? Also EspressIF uses Python, when I understand correctly? I have no idea how that actually relates, but that may also be a different story…
Anybody able to help?
Best regards
Daniel