Hi all, I have a question.
How can I redirect a set of defined ports to a variable? Or better, treat all they as a variable.
I try to explain it better:
I have in my application:
#define PORT_OUT_1 (GPIO_PORT_E | GPIO_PIN11)
#define PORT_OUT_2 (GPIO_PORT_E | GPIO_PIN8)
Then, in the code:
PORT_OUT_1 | GPIO_PIN_STATUS_0,
PORT_OUT_2 | GPIO_PIN_STATUS_0,
PORT_OUT_3 | GPIO_PIN_STATUS_0,
PORT_OUT_4 | GPIO_PIN_STATUS_0,
PORT_OUT_6 | GPIO_PIN_STATUS_0,
PORT_OUT_7 | GPIO_PIN_STATUS_0,
PORT_OUT_8 | GPIO_PIN_STATUS_0,
And in some place:
port_file = fopen("gpio:write", (char_ptr) &pins_control);
Then, what I want is to write:
pins_control = "0xAA";
And obtain the values independently in the ports:
This can be done? I hope I explained.
Thanks. Kind regards.
PS: Sorry about my english.