is there a convenient way, either graphically or C code to implement a pull up on a digtial input for STM32f0 processors?

Code: Select all
#define PULL_UP(port, pin) GPIO##port->PUPDR |= (1 << (pin *2))
#define PULL_DOWN(port, pin) GPIO##port->PUPDR |= (2 << (pin *2))
Code: Select all
PULL_UP(B, 8);