Skip to main content
LBona.2
Associate II
April 18, 2020
Solved

SPC584B-DIS GPIO configuration and usage

  • April 18, 2020
  • 2 replies
  • 2223 views

Hi I'm a student, I'm trying to program for the first time a SPC584B-DIS developer board. I'm trying to set 6 pin as GPIO because I want to control 6 switches by setting the voltage to 0V for close and to 5V for open but I can't figure out how to do it.

    This topic has been closed for replies.
    Best answer by Erwan YVIN

    hello ,

    You can configure the pin like GPIO

    and use the code as below

     pal_lld_togglepad(PORT_E, LED_4);
     osalThreadDelayMilliseconds(300);
     pal_lld_togglepad(PORT_A, LED_3);
     osalThreadDelayMilliseconds(300);
     pal_lld_togglepad(PORT_D, LED_5);
     osalThreadDelayMilliseconds(300);

    Best Regards

    Erwan

    0693W000000WvR3QAK.png

    2 replies

    Erwan YVIN
    Erwan YVINBest answer
    ST Employee
    May 5, 2020

    hello ,

    You can configure the pin like GPIO

    and use the code as below

     pal_lld_togglepad(PORT_E, LED_4);
     osalThreadDelayMilliseconds(300);
     pal_lld_togglepad(PORT_A, LED_3);
     osalThreadDelayMilliseconds(300);
     pal_lld_togglepad(PORT_D, LED_5);
     osalThreadDelayMilliseconds(300);

    Best Regards

    Erwan

    0693W000000WvR3QAK.png

    LBona.2
    LBona.2Author
    Associate II
    May 6, 2020

    Thank you very much for the help

    Ludovico