HAL library 1.5- GPIO for STM32Fxxx

GPIO library is second mainly used library in your project. It is designed to be very easily used for initializing GPIO pins without making sure if clock is enabled or not because this will library do for you.

It can init pin as normal or alternate with passing alternate function, it can deinit pin to set it as analog input, it can read pin, set pin and more.


Read more about new HAL libraries


  • Initialize pins with single function clock,
  • Initialize pins as alternate,
  • Deinitialize pin,
  • Fast set pull resistors,
  • Read GPIO pin,
  • Set GPIO pin,


  • HAL
    • GPIO
  • TM
    • STM32Fxxx HAL
    • defines.h

Functions and enumerations


For this library is example not shown because GPIO lib is used everywhere. In future libs you will be able to see example of using this library.


Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!