I have a function that needs a pin argument, for example:
void blink(int pin) {
digitalWrite(pin, HIGH);
digitalWrite(pin, LOW);
}
blink(PA6);
I'm using STM32 and it has 2 ways to use pins, normal way (e.g. PA6) and "fast" way (e.g. PA_6 and then use digitalWriteFast(PA_6,...)). I want to use "fast" pin functions inside my function, but I still want to use normal pins as an argument of my function. How can I convert normal pins to "fast pins"?
void blink(int pin) {
SomeType p = SomeFunction(pin);
digitalWriteFast(p, HIGH);
digitalWriteFast(p, LOW);
}
What is the SomeType and what is the SomeFunction? I wasn't able to find it.