Is there a simple way within MQX to toggle a pin from DSPIO mode to GPIO mode and back again, or do I need to dig in and change the PAR_DSPIOWH directly?
The default nature of the SPI driver doesn't allow me to verify that the data on the a/d is ready, so I need to switch to gpio mode to wait for the a/d to assert the SIN line before I do my SPI read.
thanks,
Travis
Solved! Go to Solution.
Hello Travis,
if the documentation does not provide enough information, open the source of your interest (code files: lwgpio and lwgpio_mcf5441).
lwgpio_set_pin_output calls lwpgio_init, which sets only value and direction. There's lwgpio_set_functionality to set GPIO function (line 225).
Regards,
MartinK
Hello,
you did not specify target MCU. I assume it is MCF5225 or MCF5441. You need to change it directly, I did not find any function which enables desired functionality, at least in lwgpio driver.
Regards,
MartinK
Hi Martin,
Yes, we're using the MCF54418.
I was wondering, does using lwgpio_set_pin_output and lwgpio_get_pin_input change the pin from spi to gpio? I was having a hard time understanding all the lwgpio documentation and the purpose behind it.
thanks,
Travis
Hello Travis,
if the documentation does not provide enough information, open the source of your interest (code files: lwgpio and lwgpio_mcf5441).
lwgpio_set_pin_output calls lwpgio_init, which sets only value and direction. There's lwgpio_set_functionality to set GPIO function (line 225).
Regards,
MartinK
Thanks,
I ended up using standard GPIO calls along with toggling the PAR_DSPIOWH register.
Once I got digging through the source files it was fairly straightforward.
-Travis