DSPIO and GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DSPIO and GPIO

Jump to solution
718 Views
t_k
Contributor II

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

0 Kudos
1 Solution
537 Views
c0170
Senior Contributor III

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

View solution in original post

0 Kudos
4 Replies
539 Views
c0170
Senior Contributor III

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

0 Kudos
539 Views
t_k
Contributor II

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

0 Kudos
538 Views
c0170
Senior Contributor III

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

0 Kudos
539 Views
t_k
Contributor II

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

0 Kudos