Skip to main content
AndrewR
Associate II
Jan 30, 2025 7:29 PM UTC
Solved

GPIO Demo Program etc

Hello, can someone point me to where there are some demo programs for working with GPIO as individual pins and creating a bus from a number of outputs. I am also looking for a demo program with general s/w based timers, for example, in mbed which is what I am porting from, you would do

thread_sleep_for(1000);  // 1ms timer or delay

and to create a bus

BusOut select_drv(dp11,dp4, dp5, dp6, dp9, dp10); //creates a bus called select_drv

thanks

AndrewR

 

(I attached the code)

 

This topic has been closed for replies.
TDK
TDKBest answer
Jan 30, 2025 8:47 PM UTC

There is no "create a bus" function in HAL. You can control individual pins with HAL_GPIO_WritePin.

A delay of 1-2ms can be done with HAL_Delay(1)

"If you feel a post has answered your question, please click ""Accept as Solution""."

7 replies

mƎALLEm
ST Technical Moderator
Jan 30, 2025 8:23 PM UTC

Hello,

For MBED questions please open a thread in their community.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
AndrewR
AndrewRAuthor
Associate II
Jan 30, 2025 8:33 PM UTC

Hello, I'm trying to get away from mbed* and on to a stable dev platform which is why I came here.  I really want to avoid using mbed moving forward and I dont want or need anyone to write or debug my code.I'm just looking for STM32Cube IDE demo programs so I can see how to work with the peripherals - are these available anywhere? Is there a repository where I can get these?

Regards

AndrewR

 

*mbed is going to be closed down in 2026, and developers are leaving the platform. There isn't any point in remaining with it.

mƎALLEm
ST Technical Moderator
Jan 30, 2025 8:40 PM UTC

In that case you need to tell which board you are using in order to guide you efficiently.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
AndrewR
AndrewRAuthor
Associate II
Jan 30, 2025 8:50 PM UTC

Hi, I am using the NUCLEO-GO31K8

TDK
TDKBest answer
Jan 30, 2025 8:47 PM UTC

There is no "create a bus" function in HAL. You can control individual pins with HAL_GPIO_WritePin.

A delay of 1-2ms can be done with HAL_Delay(1)

"If you feel a post has answered your question, please click ""Accept as Solution""."