I'd like to use a bidirectional pin and change its direction from the code. This doesn't seem to be possible using the provided API. What's the easiest way to configure a bidirectional pin as input, and then change it to output?
I'm using a PSoC 5LP.
You typically do not need to do that. Use an output drive mode 'open drain', then you can read and write at the same time without problems.