Can user change port direction during runtime

If you have a simple question and just want an answer.
radaudio
Junior Member
Posts: 7
Joined: Sat Jul 14, 2012 5:14 pm

Can user change port direction during runtime

Post by radaudio »

Hi,

Is it possible to change IO port directions during program execution? Say I want to change input to output when I change mode of a serial port from master to slave.

Thanks in advance,

gx



User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

You can declare the port without specifying the port direction and use as both input and output in your design. You can use peek() function to peek the value on the port.