Skip to content

Instantly share code, notes, and snippets.

@MayaPosch
Created October 28, 2020 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MayaPosch/a84fb356eb096e3c435a50c0ec494d4f to your computer and use it in GitHub Desktop.
Save MayaPosch/a84fb356eb096e3c435a50c0ec494d4f to your computer and use it in GitHub Desktop.
STM32 GPIO read
uint32_t idr = instance.regs->IDR;
out = (idr >> pin) & 1U; // Read out desired bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment