Basically Port 4D is my Lower Nibble and Port 4C is my Upper Nibble... I want to be able to switch from output to input and back again on the 4bit wide ports.
Code: Select all
out port pU = XS1_PORT_4C;
out port pL = XS1_PORT_4D;
out port * moveable ppU = &pU;
out port * moveable ppL = &pL;
in port:4 * movable p_IN_UPPER;
in port:4 * movable p_IN_LOWER;
//then use this to set to INPUT
p_IN_UPPER = reconfigure_port(move(ppU), in port:4);
p_IN_LOWER = reconfigure_port(move(ppL), in port:4);
//This to set back to output
ppU = reconfigure_port(move(p_IN_UPPER), out port);
ppL = reconfigure_port(move(p_IN_LOWER), out port);