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.

initialization of gpio pin ports of launchpad

Hi,

What's the best way to initializate states or values of the gpio pin ports of my launchpad board? 

thanks!!!

  • Hello Jose,

    The GPIO's can be configured only when the device has started executing the Flash code. They cannot be pre-init at time of power up. By default at power up all pins are input mode.

    To configure a GPIO to a predetermined value during flash execution is

    GPIOPinTypeGPIOOutput(Base Address of GPIO, GPIO Pin Number from 0-7);
    GPIOPinWrite(Base Address of GPIO, GPIO Pin Number from 0-7, 0); // for 0
    or
    GPIOPinWrite(Base Address of GPIO, GPIO Pin Number from 0-7, GPIO Pin Number from 0-7); // for 1

    Regards
    Amit