Configuring a port as output using lib_xcore

Technical questions regarding the XTC tools and programming with XMOS.
michaelf
Junior Member
Posts: 5
Joined: Thu Mar 14, 2024 7:44 pm

Configuring a port as output using lib_xcore

Post by michaelf »

I'm just trying to translate a piece of code from XC to C, and I would like to confirm some functionality when configuring a port.

XC code:

Code: Select all

buffered out port:32 buffered_output_port = /* port */;
C code so far:

Code: Select all

port_t buffered_output_port = /* port */;
port.start_buffered(buffered_output_port, 32);
// how can I now change it from an "in" port (as is the default) to an "out" port?
I see that there is a function

Code: Select all

port_set_inout_data
, but the docs are ambiguous (I think there's a missing word):

Code: Select all

inline void port_set_inout_data(port_t __p)
Set a port drive out the data value (default state).

Parameters:
__p – Port to change the mode of.
.

Does called "set_port_inout_data(port)" set the port as an output port?