Unfortunately, this RC rise time method has quite a number of issues with interference (which is quite common, if you have a switching charger attached or a GSM cell phone nearby). Some form of demodulation (or even dual slope conversion) will greatly improve real world performance. A wide variety of algorithms are also required to minimize false activation and "stuck" buttons in the presence of noise/moisture.
I would recommend that those looking for good solutions for capacitive buttons search the literature. There are quite a few articles from ~2000 (and patents expiring) that describe unencumbered IO based methods of sensing... although many require more than one IO per sensor or some method of multiplexing.
It seems that the best method to use with non-specialized GPIO is the charge transfer. Instead of using a resistor, charge a sampling capacitor.
The presentation below deals with a specialized block, but the only major change is using hardware for cycle counting and multiplexing a single sampling capacitor.
Charge sampling is nice because it effectively puts a (leaky) integrator into the measurement narrowing the band. It looks like the ST solution requires an internal mux to share the storage/sampling cap, which may be present in your micro-controller/FPGA, but isn't quite so standard. The cited patent (above) actually shows how to reuse IOs to get a pair of sensors on a pair of IOs (and a shared component cap), which is fairly efficient for charge transfer.
However, be careful of IP... I can only really recommend OpenSource implementations that read directly on out of coverage patents. There are even sigma-delta and other relatively narrow-band IO based solutions, but they may carry IP risk.
I was about to link Atmel QTouch, they do the same thing with plain vanilla GPIO, but annoyingly do not provide the exact sequence of operations as ST presentation does. But they seem to be equivalent.
I would recommend that those looking for good solutions for capacitive buttons search the literature. There are quite a few articles from ~2000 (and patents expiring) that describe unencumbered IO based methods of sensing... although many require more than one IO per sensor or some method of multiplexing.
This expired (2019) patent comes to mind: https://patentimages.storage.googleapis.com/52/dc/c3/005f65c...
In full disclosure, I'm listed on other capacitive sensing patents, but many do not expire for several more years.