I am trying to rewrite the code from AVR to STM32. How to translate this code into STM32?
#define READ_IO PIND & (1 << PD4)
volatile unsigned char data_in = 0;
data_in = (READ_IO) >> PD4;
I use STM32CubeIDE
Assuming pin4 on port D.
data_in = !!(GPIOD -> IDR & (1 << 4));