SpenceKonde / megaTinyCore

Arduino core for the tinyAVR 0/1/2-series - Ones's digit 2,4,5,7 (pincount, 8,14,20,24), tens digit 0, 1, or 2 (featureset), preceded by flash in kb. Library maintainers: porting help available!
Other
553 stars 143 forks source link

Integrate QTouch functionality #1141

Open Ilidur opened 2 weeks ago

Ilidur commented 2 weeks ago

Hello, the QTouch functionality for the ATTiny chips is not available in this library. I've manage to put together a functional but slightly hacked together implementation borrowing the work from https://github.com/xukangmin/TinyCore .

My target is the ATTiny1616 so I won't be able to test any suggestions on any other board. Would the project be interested in this contribution? The license of the original library by @xukangmin is MIT.

hmeijdam commented 2 weeks ago

The PTC peripheral has always been a mystery to me. A peripheral without any associated registers gives me a headache.

So is the TinyTouch you refer to really using the PTC peripheral or is it bitbanging touch functionality through ADC, Timer(s) and interrupts?

Ilidur commented 2 weeks ago

Yes, it uses the QTouch library, although it is proprietary, comes as a precompiled library. https://github.com/xukangmin/TinyCore/tree/master/avr/libraries/Touch/src

MX682X commented 1 day ago

The code on github has already a PTC library. However, I'm finishing up the DA support right now and made some small changes in the API, like changes to the argument order (it will be x, y instead of y, x for the pin bitmap, should only affect self-cap sensing). I managed to make it even possible to support 8k chips, which have the peripheral, but lack the memory to support qTouch