Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
STM32 F0/4/7 GPIO input
uint8_t pin2 = pin * 2;
instance.regs->MODER &= ~(0x3 << pin2);
instance.regs->PUPDR &= ~(0x3 << pin2);
if (pupd == GPIO_PULL_UP) {
instance.regs->PUPDR |= (0x1 << pin2);
}
else {
instance.regs->PUPDR |= (0x2 << pin2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.