You can read the status of external pins through the FLAG register.
You need to make sure that they are configured as inputs.
The dedicated FLAG pins can be read directly.
You can also read any DPI pin via the FLAG register by connecting it to a FLAG pin via the SRU.
Klaus
p.s. you can have a look at this thread for details: