I only occasionally do Arduino programming and I've not explored the capactive touch but I did a bit of noodling and and I'll ask around to try and find you a proper answer.
It looks like it's implemented in CircuitPython as some simple code which sends a pulse to the pad as an output and then measures it as high impedance input. There's a lengthy discussion of how it was implemented for the nRF52840 in
GitHub: adafruit/circuitpython nrf: implement touchio.TouchIn #1048 which ended up a time-based measurement approach. I think the code ended up in
https://github.com/adafruit/circuitpyth ... le/touchio and that's used by anything which doesn't have native support in the hardware.
I see there's an
Adafruit_FreeTouch arduino library but the comments and code suggest it's very SAMD21 specific and it doesn't show recent updates for SAMD51 or nRF52840.
There is code in the
Adafruit_CircuitPlayground library for capacitive touch. That initially doesn't sound promising but it's been enhanced to work with the nRF52840-based Circuit Playground Bluefruit so I think all the code exists it's just a question of finding the right library or failing that best example to borrow.