Rust wrapper for ESP32-S2 Touch Sensor touchRead()

jellsworth
Posts: 1
Joined: Mon Aug 21, 2023 9:38 pm

Rust wrapper for ESP32-S2 Touch Sensor touchRead()

Postby jellsworth » Mon Mar 18, 2024 10:20 pm

I am seeking pre-wrapped safe code for Touch sensor. Something similar to the touchRead() in Adurino and MicroPython.


In Micro python it looks like:
self.touch2 = TouchPad(Pin(2))
s2v = self.touch2.read()

In Adurino it looks like:
int reading = touchRead(GPIO);

I found some reference in the Rust docs to what looks like related structure but not sure how to get from there to working code.
On Page: https://docs.esp-rs.org/esp-idf-sys/esp_idf_sys/
touch_filter_config Touch sensor filter configuration
touch_pad_denoise Touch sensor denoise configuration
touch_pad_sleep_channel_t Touch sensor channel sleep configuration
touch_pad_waterproof Touch sensor waterproof configuration

Here are the espressif docs for this feature:
https://docs.espressif.com/projects/esp ... h_pad.html

It could be that it has already been ported and I just never found an example of using it. If so then some example code showing how to access would be greatly appreciated.

This and one other chip feature, access to the onboard temperature sensor are blocking my ability to port our app to Rust. I would love to make the switch but don't have time to figure this out right now. I am wiolling to donate a $100 via paypal if somebody who better understands linking in functions from espressif can provide the function and contribute it back to the community. Just let me know where you want the paypal payment sent.

Who is online

Users browsing this forum: No registered users and 34 guests