Graham Stott <gbcstott1@...>
My project only needs two PWM outputs so I want to switch the two unused PWM to GPIOs. The best candidates are PWM 0 (IO 3) and PWM 1 (IO 5) however these are the pins that are connected to another output pin from Curie. Curie pins B1 and H1 go to IO-3 and A3 and G2 go to IO-5. The GPIOs that I want to switch to, are on the other Curie output pins. For example GPIO 17 comes from pin B1 while PWM 0 comes from H1.
I believe that I need to put the unused pin in a high impedance mode so that it does not affect the other pin. I do not see any were in Zephyr where this is done so I presume that the OS assumes that the hardware comes up in this state and therefore it only does the pinmax for the pin to IO-3 and IO-5 that it wants. Note that there are in fact three other pins that are like this (IO-11, IO-12 and IO-13) which the documentation does not mention. The documentation is not helpful as it just says “IO-3 and IO-5 require both pins to be set for functionality changes. I did look at the pinmux.c and the header files but they were not helpful.
Can anyone point me to an example where/how this is done. I looked at the sample code and online and could not find anything.
My guess is that I need to put the unused pin in input mode with no pull up and then pinmux the other pin to the output I want.