Dear Champs,
I am asking this for our customer.
The user wants to change a GPIO direction and value during runtime (in C28x ISR/background and in CLA tasks/background task8).
Would you please help confirm the considerations?
1. From GPIO input to output
In 10.3 Configuration Overview of TRM, it says in Step 4: Select the direction of any general-purpose I/O pins
"By default, all GPIO pins are inputs. Before changing a pin to an output, load the output latch with the value to be driven by writing that value to the GPySET, GPyCLEAR, or GPyDAT registers. Once the latch is loaded, write to GPyDIR to change the pin direction."
The user has to follow the sequence both in the GPIO initialization and runtime.
For example,
GPIO_writePin(myGPIO0, 1);
GPIO_setDirectionMode(myGPIO0, GPIO_DIR_MODE_OUT);
Is it correct?
2. From GPIO output to input,
The user can change the direction directly?
Is there any consideration like sequence here?
GPIO_setDirectionMode(myGPIO0, GPIO_DIR_MODE_IN);