This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: Instructions CCS



Tool/software: Code Composer Studio

Could you explain what these lines of code do? What is the function they perform ?.

Thank you very much to all.

void Gpio_select(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPAMUX2.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPBMUX1.all = 0x00000000; // All GPIO
GpioCtrlRegs.GPADIR.all = 0xFFFFFFFF; // All outputs
GpioCtrlRegs.GPBDIR.all = 0x00001FFF; // All outputs
EDIS;
}

  • Hello,

    This is some basic GPIO configuration code. The lines that say "MUX" are configuring the GPIOs numbered 0 to 63 to behave as GPIO by setting the mux registers to all 0s. The lines that say "DIR" are configuring the GPIOs numbered 0 to 44 to be outputs by setting their corresponding bits to 1.

    Please read the descriptions for these registers in the GPIO chapter of the TRM:

    (Wasn't sure which device you're using, so link above is for the F28004x. If you go to the product page for the device you're actually using, you should be able to find an equivilent document.)

    Whitney