read fast pin states

Hi,

i need to read the pin state to track an encoder signal. Is there a way like on ARM microcontrollers to read the pin state ?
like PINB or PINC macros? So to acces directly the registers?

Thanks in advances for your answer.

Amine