AnyTouchPin, type erased GPIO pin that implements TouchPin
Motivations
Statically allocating space for multiple gpio pins is easy with AnyPin, but there is currently no equivalent for the TouchPin trait.
Also, it makes any async function that needs to work with TouchPin generic, meaning if invoked with different pins, futures it returns are different types.
Solution
A TouchPin::degrade(self) -> AnyTouchPin method, analogous to Pin::degrade(self) -> AnyPin.
Alternatives
Currently I'm just dealing with generics, using function signatures similar to this:
fn foo<T0, T1, T2> (..., pins: (T0, T1, T2))
where
T0: TouchPin,
T1: TouchPin,
T2: TouchPin
{}
Additional context
Good idea, I think. If we do this, we should also add the same for the rest of the pin types (AnalogPin, RtcPin, but not InputPin/OutputPin). Internally, we can just convert back to AnyPin so it wouldn't be too much change, either.