cancel
Showing results for 
Search instead for 
Did you mean: 

SPC584B-DIS GPIO configuration and usage

LBona.2
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

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

View solution in original post

2 REPLIES 2
Erwan YVIN
ST Employee

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
Associate II

Thank you very much for the help

Ludovico